Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[qca]support linux-osx-static build #13964

Merged
merged 20 commits into from
Oct 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 34 additions & 25 deletions ports/qca/0001-fix-path-for-vcpkg.patch
Original file line number Diff line number Diff line change
@@ -1,35 +1,47 @@
From a3a8d50f3bdcb4df630f7126718c21f23efd7832 Mon Sep 17 00:00:00 2001
From: Alexander Kaspar <[email protected]>
Date: Wed, 30 Nov 2016 15:45:12 +0100
Subject: [PATCH] fix path for vcpkg

---
CMakeLists.txt | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 605621b..3b5a9be 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -277,7 +277,7 @@ if(DEVELOPER_MODE)
diff --git "a/CMakeLists.txt" "b/CMakeLists.txt"
index 1f84c2c9e..f72ee9d8d 100644
--- "a/CMakeLists.txt"
+++ "b/CMakeLists.txt"
@@ -58,6 +58,7 @@ set(QCA_SUFFIX "qt5")
if(NOT BUILD_SHARED_LIBS OR QT_IS_STATIC)
set(STATIC_PLUGINS ON)
add_definitions(-DQT_STATICPLUGIN)
+ add_definitions(-DQCA_STATIC)
set(PLUGIN_TYPE "STATIC")
else()
set(PLUGIN_TYPE "MODULE")
@@ -266,10 +267,17 @@ if(DEVELOPER_MODE)
add_definitions(-DDEVELOPER_MODE)

# To prefer plugins from build tree when run qca from build tree
file(WRITE ${CMAKE_BINARY_DIR}/bin/qt.conf
"[Paths]
- file(WRITE ${CMAKE_BINARY_DIR}/bin/qt.conf
-"[Paths]
-Plugins=${CMAKE_BINARY_DIR}/lib/${QCA_LIB_NAME}
+Plugins=${CMAKE_BINARY_DIR}/bin/${QCA_LIB_NAME}
")
-")
+ if(NOT BUILD_SHARED_LIBS OR QT_IS_STATIC)
+ file(WRITE ${CMAKE_BINARY_DIR}/bin/qt.conf
+ "[Paths]
+ Plugins=${CMAKE_BINARY_DIR}/lib/${QCA_LIB_NAME}
+ ")
+ else()
+ file(WRITE ${CMAKE_BINARY_DIR}/bin/qt.conf
+ "[Paths]
+ Plugins=${CMAKE_BINARY_DIR}/bin/${QCA_LIB_NAME}
+ ")
+ endif()
endif()

@@ -320,7 +320,7 @@ else (qca_CERTSTORE)
if (APPLE)
@@ -309,7 +317,7 @@ else()
set( qca_CERTSTORE "${CMAKE_CURRENT_SOURCE_DIR}/certs/rootcerts.pem")
# note that INSTALL_FILES targets are relative to the current installation prefix...
if(NOT DEVELOPER_MODE)
- install(FILES "${qca_CERTSTORE}" DESTINATION "${QCA_PREFIX_INSTALL_DIR}/certs")
+ install(FILES "${qca_CERTSTORE}" DESTINATION "${QCA_PREFIX_INSTALL_DIR}/share/qca/certs")
endif()
endif (qca_CERTSTORE)
endif()
message(STATUS "certstore path: " ${qca_CERTSTORE})
@@ -401,10 +401,10 @@ endif(DOXYGEN_FOUND)
@@ -390,10 +398,10 @@ endif()
include(CMakePackageConfigHelpers)
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/QcaConfig.cmake.in"
Expand All @@ -43,7 +55,7 @@ index 605621b..3b5a9be 100644

if(NOT DEVELOPER_MODE)

@@ -472,10 +472,10 @@ if(NOT DEVELOPER_MODE)
@@ -461,10 +469,10 @@ if(NOT DEVELOPER_MODE)
endif()
endif()

Expand All @@ -58,6 +70,3 @@ index 605621b..3b5a9be 100644
+ DESTINATION ${QCA_PREFIX_INSTALL_DIR}/share/qca/cmake
)
endif()
--
2.8.1.windows.1

109 changes: 55 additions & 54 deletions ports/qca/0002-fix-build-error.patch
Original file line number Diff line number Diff line change
@@ -1,57 +1,58 @@
diff --git a/plugins/qca-gnupg/CMakeLists.txt b/plugins/qca-gnupg/CMakeLists.txt
index 1ed8e21..20890dd 100644
--- a/plugins/qca-gnupg/CMakeLists.txt
+++ b/plugins/qca-gnupg/CMakeLists.txt
@@ -68,6 +68,4 @@ if(NOT DEVELOPER_MODE)
LIBRARY DESTINATION "${QCA_CRYPTO_INSTALL_DIR}"
ARCHIVE DESTINATION "${QCA_CRYPTO_INSTALL_DIR}"
RUNTIME DESTINATION "${QCA_CRYPTO_INSTALL_DIR}")
-
- install_pdb(qca-gnupg ${QCA_CRYPTO_INSTALL_DIR})
endif()
diff --git a/plugins/qca-logger/CMakeLists.txt b/plugins/qca-logger/CMakeLists.txt
index ba6926e..45e1986 100644
--- a/plugins/qca-logger/CMakeLists.txt
+++ b/plugins/qca-logger/CMakeLists.txt
@@ -20,6 +20,4 @@ if(NOT DEVELOPER_MODE)
LIBRARY DESTINATION "${QCA_CRYPTO_INSTALL_DIR}"
ARCHIVE DESTINATION "${QCA_CRYPTO_INSTALL_DIR}"
RUNTIME DESTINATION "${QCA_CRYPTO_INSTALL_DIR}")
-
- install_pdb(qca-logger ${QCA_CRYPTO_INSTALL_DIR})
endif()
diff --git a/plugins/qca-ossl/CMakeLists.txt b/plugins/qca-ossl/CMakeLists.txt
index af3d756..c8480a3 100644
--- a/plugins/qca-ossl/CMakeLists.txt
+++ b/plugins/qca-ossl/CMakeLists.txt
@@ -65,8 +65,6 @@ if(OPENSSL_FOUND)
LIBRARY DESTINATION "${QCA_CRYPTO_INSTALL_DIR}"
ARCHIVE DESTINATION "${QCA_CRYPTO_INSTALL_DIR}"
RUNTIME DESTINATION "${QCA_CRYPTO_INSTALL_DIR}")
-
- install_pdb(qca-ossl ${QCA_CRYPTO_INSTALL_DIR})
endif()
diff --git "a/cmake/modules/QcaMacro.cmake" "b/cmake/modules/QcaMacro.cmake"
index 5d86e4725..62568626b 100644
--- "a/cmake/modules/QcaMacro.cmake"
+++ "b/cmake/modules/QcaMacro.cmake"
@@ -61,15 +61,6 @@ macro(add_qca_test TARGET DESCRIPTION)
endmacro(add_qca_test)

else(OPENSSL_FOUND)
diff --git a/plugins/qca-softstore/CMakeLists.txt b/plugins/qca-softstore/CMakeLists.txt
index d7af072..3c64870 100644
--- a/plugins/qca-softstore/CMakeLists.txt
+++ b/plugins/qca-softstore/CMakeLists.txt
@@ -20,6 +20,4 @@ if(NOT DEVELOPER_MODE)
LIBRARY DESTINATION "${QCA_CRYPTO_INSTALL_DIR}"
ARCHIVE DESTINATION "${QCA_CRYPTO_INSTALL_DIR}"
RUNTIME DESTINATION "${QCA_CRYPTO_INSTALL_DIR}")
macro(install_pdb TARGET INSTALL_PATH)
- if(MSVC)
- get_target_property(LOCATION ${TARGET} LOCATION_DEBUG)
- string(REGEX REPLACE "\\.[^.]*$" ".pdb" LOCATION "${LOCATION}")
- install(FILES ${LOCATION} DESTINATION ${INSTALL_PATH} CONFIGURATIONS Debug)
-
- install_pdb(qca-softstore ${QCA_CRYPTO_INSTALL_DIR})
endif()
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2e81974..907049c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -184,6 +184,5 @@ if(NOT DEVELOPER_MODE)
FRAMEWORK DESTINATION "${QCA_LIBRARY_INSTALL_DIR}"
PUBLIC_HEADER DESTINATION "${QCA_FULL_INCLUDE_INSTALL_DIR}" INCLUDES DESTINATION "${QCA_FULL_INCLUDE_INSTALL_DIR}"
)
- install_pdb(${QCA_LIB_NAME} ${QCA_BINARY_INSTALL_DIR})
endif()
- get_target_property(LOCATION ${TARGET} LOCATION_RELWITHDEBINFO)
- string(REGEX REPLACE "\\.[^.]*$" ".pdb" LOCATION "${LOCATION}")
- install(FILES ${LOCATION} DESTINATION ${INSTALL_PATH} CONFIGURATIONS RelWithDebInfo)
- endif()
endmacro(install_pdb)

macro(normalize_path PATH)
diff --git "a/plugins/qca-ossl/qca-ossl.cpp" "b/plugins/qca-ossl/qca-ossl.cpp"
index ee872d721..fa3e2c414 100644
--- "a/plugins/qca-ossl/qca-ossl.cpp"
+++ "b/plugins/qca-ossl/qca-ossl.cpp"
@@ -6910,6 +6910,7 @@ public:
else if ( type == QLatin1String("aes256-ccm") )
return new opensslCipherContext( EVP_aes_256_ccm(), 0, this, type);
#endif
+#ifndef OPENSSL_NO_BF
else if ( type == QLatin1String("blowfish-ecb") )
return new opensslCipherContext( EVP_bf_ecb(), 0, this, type);
else if ( type == QLatin1String("blowfish-cfb") )
@@ -6920,6 +6921,8 @@ public:
return new opensslCipherContext( EVP_bf_cbc(), 0, this, type);
else if ( type == QLatin1String("blowfish-cbc-pkcs7") )
return new opensslCipherContext( EVP_bf_cbc(), 1, this, type);
+#endif
+#ifndef OPENSSL_NO_DES
else if ( type == QLatin1String("tripledes-ecb") )
return new opensslCipherContext( EVP_des_ede3(), 0, this, type);
else if ( type == QLatin1String("tripledes-cbc") )
@@ -6936,6 +6939,8 @@ public:
return new opensslCipherContext( EVP_des_cfb(), 0, this, type);
else if ( type == QLatin1String("des-ofb") )
return new opensslCipherContext( EVP_des_ofb(), 0, this, type);
+#endif
+#ifndef OPENSSL_NO_CAST
else if ( type == QLatin1String("cast5-ecb") )
return new opensslCipherContext( EVP_cast5_ecb(), 0, this, type);
else if ( type == QLatin1String("cast5-cbc") )
@@ -6946,6 +6951,7 @@ public:
return new opensslCipherContext( EVP_cast5_cfb(), 0, this, type);
else if ( type == QLatin1String("cast5-ofb") )
return new opensslCipherContext( EVP_cast5_ofb(), 0, this, type);
+#endif
else if ( type == QLatin1String("pkey") )
return new MyPKeyContext( this );
else if ( type == QLatin1String("dlgroup") )
2 changes: 1 addition & 1 deletion ports/qca/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: qca
Version: 2.2.1-1
Version: 2.3.1
Description: Qt Cryptographic Architecture (QCA).
Homepage: https://cgit.kde.org/qca.git/
Build-Depends: qt5-base[core]
29 changes: 16 additions & 13 deletions ports/qca/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
# Output directories according to vcpkg
# Updated certstore. See certstore.pem in the output dirs
#

include(vcpkg_common_functions)

vcpkg_check_linkage(ONLY_DYNAMIC_LIBRARY)

vcpkg_find_acquire_program(PERL)
get_filename_component(PERL_EXE_PATH ${PERL} DIRECTORY)
vcpkg_add_to_path(${PERL_EXE_PATH})
Expand All @@ -20,13 +15,21 @@ endif()
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO KDE/qca
REF v2.2.1
SHA512 6b10f9bbf9ebf136655d1c6464f3849c8581b3cd5ef07b0697ddd5f32611dce301af5148e8e6fe91e763301e68994957a62a278334ee7a78559101f411f27d49
REF v2.3.1
SHA512 e04a44fb395e24fd009bb6b005282880bef84ca492b5e15903f9ce3e5e3f93beae3a386a1a381507ed5b0c6550e64c6bf434328f9d965fa7f7d638c3e5d5948b
PATCHES
0001-fix-path-for-vcpkg.patch
0002-fix-build-error.patch
0001-fix-path-for-vcpkg.patch
0002-fix-build-error.patch
)

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.
Expand Down Expand Up @@ -56,10 +59,11 @@ vcpkg_configure_cmake(
-DBUILD_TOOLS=OFF
-DQCA_SUFFIX=OFF
-DQCA_FEATURE_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/share/qca/mkspecs/features
-DOSX_FRAMEWORK=OFF
OPTIONS_DEBUG
-DQCA_PLUGINS_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/debug/bin/Qca
-DQCA_PLUGINS_INSTALL_DIR=${QCA_FEATURE_INSTALL_DIR_DEBUG}
OPTIONS_RELEASE
-DQCA_PLUGINS_INSTALL_DIR=${CURRENT_PACKAGES_DIR}/bin/Qca
-DQCA_PLUGINS_INSTALL_DIR=${QCA_FEATURE_INSTALL_DIR_RELEASE}
)

vcpkg_install_cmake()
Expand Down Expand Up @@ -94,5 +98,4 @@ file(REMOVE_RECURSE
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)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
3 changes: 0 additions & 3 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1356,9 +1356,6 @@ python2:x64-uwp=fail
python3:arm64-windows=fail
python3:arm-uwp=fail
python3:x64-uwp=fail
qca:x64-linux=fail
qca:x64-osx=fail
qca:x64-windows-static=fail
qhull:x64-uwp=fail
qhull:arm-uwp=fail
qpid-proton:arm-uwp=fail
Expand Down