vcpkg/ports/qca/portfile.cmake

99 lines
3.3 KiB
CMake
Raw Normal View History

2016-12-01 20:43:36 +08:00
# This portfile adds the Qt Cryptographic Arcitecture
# Changes to the original build:
2016-12-01 20:43:36 +08:00
# No -qt5 suffix, which is recommended just for Linux
# Output directories according to vcpkg
# Updated certstore. See certstore.pem in the output dirs
2016-11-25 18:40:29 +08:00
#
vcpkg_find_acquire_program(PERL)
get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
vcpkg_add_to_path("${PERL_EXE_PATH}")
2016-11-25 18:40:29 +08:00
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO KDE/qca
2023-10-10 06:05:22 +08:00
REF "v${VERSION}"
SHA512 de06173aaea32aac19a24510b5dbb4bb79681217eb1e4256de36db9f7158ad485fa450ffba5e13c12a0425866923b54f9b4d6164d0eaf659fdf40e458f5ee017
PATCHES
0001-fix-path-for-vcpkg.patch
0002-fix-build-error.patch
0003-Define-NOMINMAX-for-botan-plugin-with-MSVC.patch
2016-11-25 18:40:29 +08:00
)
vcpkg_find_acquire_program(PKGCONFIG)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
set(QCA_FEATURE_INSTALL_DIR_DEBUG ${CURRENT_PACKAGES_DIR}/debug/bin/Qca)
set(QCA_FEATURE_INSTALL_DIR_RELEASE ${CURRENT_PACKAGES_DIR}/bin/Qca)
else()
set(QCA_FEATURE_INSTALL_DIR_DEBUG ${CURRENT_PACKAGES_DIR}/debug/lib/Qca)
set(QCA_FEATURE_INSTALL_DIR_RELEASE ${CURRENT_PACKAGES_DIR}/lib/Qca)
endif()
# According to:
# https://www.openssl.org/docs/faq.html#USER16
# it is up to developers or admins to maintain CAs.
# So we do it here:
2016-12-01 20:43:36 +08:00
message(STATUS "Importing certstore")
file(REMOVE "${SOURCE_PATH}/certs/rootcerts.pem")
# Using file(DOWNLOAD) to use https
file(DOWNLOAD https://raw.githubusercontent.com/mozilla/gecko-dev/master/security/nss/lib/ckfw/builtins/certdata.txt
"${CURRENT_BUILDTREES_DIR}/cert/certdata.txt"
TLS_VERIFY ON
2016-12-01 20:43:36 +08:00
)
vcpkg_execute_required_process(
COMMAND "${PERL}" "${CMAKE_CURRENT_LIST_DIR}/mk-ca-bundle.pl" -n "${SOURCE_PATH}/certs/rootcerts.pem"
WORKING_DIRECTORY "${CURRENT_BUILDTREES_DIR}/cert"
LOGNAME ca-bundle
)
2016-12-01 20:43:36 +08:00
message(STATUS "Importing certstore done")
set(PLUGINS gnupg logger softstore wincrypto)
2022-01-05 07:02:13 +08:00
if("botan" IN_LIST FEATURES)
list(APPEND PLUGINS botan)
2022-01-05 07:02:13 +08:00
endif()
[QCA] add openssl feature (#38104) <!-- If your PR fixes issues, please note that here by adding "Fixes #NNNNNN." for each fixed issue on separate lines. --> <!-- If you are still working on the PR, open it as a Draft: https://github.blog/2019-02-14-introducing-draft-pull-requests/. --> <!-- If this PR updates an existing port, please uncomment and fill out this checklist: - [ ] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md). - [ ] SHA512s are updated for each updated download. - [ ] The "supports" clause reflects platforms that may be fixed by this new version. - [ ] Any fixed [CI baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt) entries are removed from that file. - [ ] Any patches that are no longer applied are deleted from the port's directory. - [ ] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result. - [ ] Only one version is added to each modified port's versions file. END OF PORT UPDATE CHECKLIST (delete this line) --> <!-- If this PR adds a new port, please uncomment and fill out this checklist: - [ ] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md). - [ ] The name of the port matches an existing name for this component on https://repology.org/ if possible, and/or is strongly associated with that component on search engines. - [ ] Optional dependencies are resolved in exactly one way. For example, if the component is built with CMake, all `find_package` calls are REQUIRED, are satisfied by `vcpkg.json`'s declared dependencies, or disabled with [CMAKE_DISABLE_FIND_PACKAGE_Xxx](https://cmake.org/cmake/help/latest/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.html). - [ ] The versioning scheme in `vcpkg.json` matches what upstream says. - [ ] The license declaration in `vcpkg.json` matches what upstream says. - [ ] The installed as the "copyright" file matches what upstream says. - [ ] The source code of the component installed comes from an authoritative source. - [ ] The generated "usage text" is accurate. See [adding-usage](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/examples/adding-usage.md) for context. - [ ] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result. - [ ] Only one version is in the new port's versions file. - [ ] Only one version is added to each modified port's versions file. END OF NEW PORT CHECKLIST (delete this line) -->
2024-04-11 22:00:40 +08:00
if ("ossl" IN_LIST FEATURES)
list(APPEND PLUGINS ossl)
endif()
2022-01-05 07:02:13 +08:00
# Configure and build
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
2016-11-25 18:40:29 +08:00
OPTIONS
-DUSE_RELATIVE_PATHS=ON
"-DBUILD_PLUGINS=${PLUGINS}"
2016-11-25 18:40:29 +08:00
-DBUILD_TESTS=OFF
2016-12-01 20:43:36 +08:00
-DBUILD_TOOLS=OFF
-DBUILD_WITH_QT6=ON
2016-11-30 17:10:01 +08:00
-DQCA_SUFFIX=OFF
-DQCA_FEATURE_INSTALL_DIR=share/qca/mkspecs/features
-DOSX_FRAMEWORK=OFF
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
2016-11-25 18:40:29 +08:00
OPTIONS_DEBUG
-DQCA_PLUGINS_INSTALL_DIR=${QCA_FEATURE_INSTALL_DIR_DEBUG}
2016-11-25 18:40:29 +08:00
OPTIONS_RELEASE
-DQCA_PLUGINS_INSTALL_DIR=${QCA_FEATURE_INSTALL_DIR_RELEASE}
2016-11-25 18:40:29 +08:00
)
vcpkg_cmake_install()
2016-11-25 18:40:29 +08:00
vcpkg_cmake_config_fixup(CONFIG_PATH share/qca/cmake)
file(READ "${CURRENT_PACKAGES_DIR}/share/${PORT}/QcaConfig.cmake" QCA_CONFIG_FILE)
string(REGEX REPLACE "PACKAGE_PREFIX_DIR \"(.*)\" ABSOLUTE"
[[PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../" ABSOLUTE]]
QCA_CONFIG_FILE "${QCA_CONFIG_FILE}"
)
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/QcaConfig.cmake" "${QCA_CONFIG_FILE}")
2016-11-25 18:40:29 +08:00
# Remove unneeded dirs
file(REMOVE_RECURSE
"${CURRENT_BUILDTREES_DIR}/share/man"
"${CURRENT_PACKAGES_DIR}/share/man"
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
2016-11-25 18:40:29 +08:00
)
2021-12-21 00:26:20 +08:00
vcpkg_fixup_pkgconfig()
2016-11-25 18:40:29 +08:00
# Handle copyright
2023-10-10 06:05:22 +08:00
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")