From 94b63bd8f266529c0574f92911b1680e8b7ee836 Mon Sep 17 00:00:00 2001 From: Victor Romero Date: Mon, 7 Nov 2022 15:34:34 -0800 Subject: [PATCH] [apr-util] Add crypto feature and don't require OpenSSL if not needed (#27644) * [apr-util] add crypto feature * [apr-util] Use CMake variables to control OpenSSL * [apr-util] remove disable find package --- ports/apr-util/portfile.cmake | 20 ++++++++++++++++++-- ports/apr-util/vcpkg.json | 13 ++++++++++--- versions/a-/apr-util.json | 5 +++++ versions/baseline.json | 2 +- 4 files changed, 34 insertions(+), 6 deletions(-) diff --git a/ports/apr-util/portfile.cmake b/ports/apr-util/portfile.cmake index 66ef998bfa..31e2e596f5 100644 --- a/ports/apr-util/portfile.cmake +++ b/ports/apr-util/portfile.cmake @@ -4,6 +4,12 @@ vcpkg_download_distfile(ARCHIVE SHA512 40eff8a37c0634f7fdddd6ca5e596b38de15fd10767a34c30bbe49c632816e8f3e1e230678034f578dd5816a94f246fb5dfdf48d644829af13bf28de3225205d ) +vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS +FEATURES + crypto APU_HAVE_CRYPTO + crypto CMAKE_REQUIRE_FIND_PACKAGE_OpenSSL +) + if(VCPKG_TARGET_IS_WINDOWS) vcpkg_extract_source_archive( SOURCE_PATH @@ -16,6 +22,8 @@ if(VCPKG_TARGET_IS_WINDOWS) vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${FEATURE_OPTIONS} OPTIONS_DEBUG -DDISABLE_INSTALL_HEADERS=ON ) @@ -54,6 +62,14 @@ else() ARCHIVE "${ARCHIVE}" ) + if ("crypto" IN_LIST FEATURES) + set(CRYPTO_OPTIONS + "--with-crypto=yes" + "--with-openssl=${CURRENT_INSTALLED_DIR}") + else() + set(CRYPTO_OPTIONS "--with-crypto=no") + endif() + # To cross-compile you will need a triplet file that locates the tool chain and sets --host and --cache parameters of "./configure". # The ${VCPKG_PLATFORM_TOOLSET}.cache file must have been generated on the targeted host using "./configure -C". # For example, to target aarch64-linux-gnu, triplets/aarch64-linux-gnu.cmake should contain (beyond the standard content): @@ -71,9 +87,9 @@ else() SOURCE_PATH "${SOURCE_PATH}" OPTIONS "--prefix=${CURRENT_INSTALLED_DIR}" + ${CRYPTO_OPTIONS} "--with-apr=${CURRENT_INSTALLED_DIR}/tools/apr" - "--with-openssl=${CURRENT_INSTALLED_DIR}" - "-with-expat=${CURRENT_INSTALLED_DIR}" + "--with-expat=${CURRENT_INSTALLED_DIR}" "${CONFIGURE_PARAMETER_1}" "${CONFIGURE_PARAMETER_2}" "${CONFIGURE_PARAMETER_3}" diff --git a/ports/apr-util/vcpkg.json b/ports/apr-util/vcpkg.json index 4c4c9bbf02..5ae07edeb3 100644 --- a/ports/apr-util/vcpkg.json +++ b/ports/apr-util/vcpkg.json @@ -1,18 +1,25 @@ { "name": "apr-util", "version": "1.6.1", - "port-version": 9, + "port-version": 10, "description": "Apache Portable Runtime (APR) project mission is to create and maintain software libraries that provide a predictable and consistent interface to underlying platform-specific implementation", "homepage": "https://apr.apache.org/", "license": "Apache-2.0", "dependencies": [ "apr", "expat", - "openssl", { "name": "vcpkg-cmake", "host": true, "platform": "windows" } - ] + ], + "features": { + "crypto": { + "description": "Crypto support", + "dependencies": [ + "openssl" + ] + } + } } diff --git a/versions/a-/apr-util.json b/versions/a-/apr-util.json index 62ec27274b..c143aa2b17 100644 --- a/versions/a-/apr-util.json +++ b/versions/a-/apr-util.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "41451c5e1e1fa8344f6c2d1baf6c0f14b656c433", + "version": "1.6.1", + "port-version": 10 + }, { "git-tree": "b6d7bb58f16bd75a40a434742d0c0a12b89645d4", "version": "1.6.1", diff --git a/versions/baseline.json b/versions/baseline.json index 6764d8e272..fcb2c4360e 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -130,7 +130,7 @@ }, "apr-util": { "baseline": "1.6.1", - "port-version": 9 + "port-version": 10 }, "apsi": { "baseline": "0.8.2",