2016-12-01 20:43:36 +08:00
|
|
|
# This portfile adds the Qt Cryptographic Arcitecture
|
2016-12-03 19:41:39 +08:00
|
|
|
# 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
|
|
|
#
|
|
|
|
|
|
|
|
include(vcpkg_common_functions)
|
|
|
|
|
2018-12-06 08:28:35 +08:00
|
|
|
vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)
|
|
|
|
|
2016-12-03 19:41:39 +08:00
|
|
|
vcpkg_find_acquire_program(PERL)
|
|
|
|
get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
|
2018-12-06 08:28:35 +08:00
|
|
|
vcpkg_add_to_path(${PERL_EXE_PATH})
|
2016-11-25 18:40:29 +08:00
|
|
|
|
2018-12-06 08:28:35 +08:00
|
|
|
if(EXISTS "${CURRENT_BUILDTREES_DIR}/src/.git")
|
|
|
|
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/src)
|
2016-11-25 18:40:29 +08:00
|
|
|
endif()
|
|
|
|
|
2018-12-06 08:28:35 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO KDE/qca
|
2019-06-11 01:03:13 +08:00
|
|
|
REF v2.2.1
|
|
|
|
SHA512 6b10f9bbf9ebf136655d1c6464f3849c8581b3cd5ef07b0697ddd5f32611dce301af5148e8e6fe91e763301e68994957a62a278334ee7a78559101f411f27d49
|
|
|
|
PATCHES
|
|
|
|
0001-fix-path-for-vcpkg.patch
|
|
|
|
0002-fix-build-error.patch
|
2016-11-25 18:40:29 +08:00
|
|
|
)
|
|
|
|
|
2016-12-02 17:12:57 +08:00
|
|
|
# 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)
|
2016-12-03 19:41:39 +08:00
|
|
|
# Using file(DOWNLOAD) to use https
|
|
|
|
file(DOWNLOAD https://raw.githubusercontent.com/mozilla/gecko-dev/master/security/nss/lib/ckfw/builtins/certdata.txt
|
2019-04-05 12:10:53 +08:00
|
|
|
${CURRENT_BUILDTREES_DIR}/cert/certdata.txt
|
2016-12-02 17:12:57 +08:00
|
|
|
TLS_VERIFY ON
|
2016-12-01 20:43:36 +08:00
|
|
|
)
|
2016-12-03 19:41:39 +08:00
|
|
|
vcpkg_execute_required_process(
|
|
|
|
COMMAND ${PERL} ${CMAKE_CURRENT_LIST_DIR}/mk-ca-bundle.pl -n ${SOURCE_PATH}/certs/rootcerts.pem
|
2019-04-05 12:10:53 +08:00
|
|
|
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/cert
|
2016-12-03 19:41:39 +08:00
|
|
|
LOGNAME ca-bundle
|
|
|
|
)
|
2016-12-01 20:43:36 +08:00
|
|
|
message(STATUS "Importing certstore done")
|
|
|
|
|
2016-11-26 20:51:09 +08:00
|
|
|
# Configure and build
|
2016-11-25 18:40:29 +08:00
|
|
|
vcpkg_configure_cmake(
|
|
|
|
SOURCE_PATH ${SOURCE_PATH}
|
2018-12-06 08:28:35 +08:00
|
|
|
PREFER_NINJA
|
2016-11-25 18:40:29 +08:00
|
|
|
OPTIONS
|
|
|
|
-DUSE_RELATIVE_PATHS=ON
|
|
|
|
-DQT4_BUILD=OFF
|
|
|
|
-DBUILD_TESTS=OFF
|
2016-12-01 20:43:36 +08:00
|
|
|
-DBUILD_TOOLS=OFF
|
2016-11-30 17:10:01 +08:00
|
|
|
-DQCA_SUFFIX=OFF
|
2016-12-01 00:16:59 +08:00
|
|
|
-DQCA_FEATURE_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/share/qca/mkspecs/features
|
2016-11-25 18:40:29 +08:00
|
|
|
OPTIONS_DEBUG
|
2016-11-30 17:10:01 +08:00
|
|
|
-DQCA_PLUGINS_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/debug/bin/Qca
|
2016-11-25 18:40:29 +08:00
|
|
|
OPTIONS_RELEASE
|
2016-11-30 17:10:01 +08:00
|
|
|
-DQCA_PLUGINS_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/bin/Qca
|
2016-11-25 18:40:29 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
vcpkg_install_cmake()
|
|
|
|
|
2016-11-26 20:51:09 +08:00
|
|
|
# Patch and copy cmake files
|
2016-11-25 18:40:29 +08:00
|
|
|
message(STATUS "Patching files")
|
2016-11-26 20:51:09 +08:00
|
|
|
file(READ
|
|
|
|
${CURRENT_PACKAGES_DIR}/debug/share/qca/cmake/QcaTargets-debug.cmake
|
|
|
|
QCA_DEBUG_CONFIG
|
2016-11-25 18:40:29 +08:00
|
|
|
)
|
|
|
|
string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" QCA_DEBUG_CONFIG "${QCA_DEBUG_CONFIG}")
|
2016-11-26 20:51:09 +08:00
|
|
|
file(WRITE
|
|
|
|
${CURRENT_PACKAGES_DIR}/share/qca/cmake/QcaTargets-debug.cmake
|
|
|
|
"${QCA_DEBUG_CONFIG}"
|
|
|
|
)
|
2016-11-25 18:40:29 +08:00
|
|
|
|
2016-11-26 20:51:09 +08:00
|
|
|
file(READ ${CURRENT_PACKAGES_DIR}/share/qca/cmake/QcaTargets.cmake
|
|
|
|
QCA_TARGET_CONFIG
|
|
|
|
)
|
2016-11-25 18:40:29 +08:00
|
|
|
string(REPLACE "packages/qca_" "installed/" QCA_TARGET_CONFIG "${QCA_TARGET_CONFIG}")
|
2016-11-26 20:51:09 +08:00
|
|
|
file(WRITE ${CURRENT_PACKAGES_DIR}/share/qca/cmake/QcaTargets.cmake
|
|
|
|
"${QCA_TARGET_CONFIG}"
|
|
|
|
)
|
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
|
|
|
|
)
|
|
|
|
message(STATUS "Patching files done")
|
|
|
|
|
|
|
|
# Handle copyright
|
|
|
|
file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/qca)
|
|
|
|
file(RENAME ${CURRENT_PACKAGES_DIR}/share/qca/COPYING ${CURRENT_PACKAGES_DIR}/share/qca/copyright)
|