From d5551b8e6eeac3d1f43ee6064ad12a1a188e4ed8 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 13 Mar 2024 23:48:53 +0100 Subject: [PATCH] [curl] General LDAP support, test port (#37152) --- ports/cpr/001-cpr-config.patch | 15 ------- ports/cpr/portfile.cmake | 11 +++-- ports/cpr/vcpkg.json | 2 +- ports/curl/cmake-project-include.cmake | 13 ++++++ ports/curl/portfile.cmake | 8 ++-- ports/curl/vcpkg.json | 23 +++++++++-- scripts/ci.baseline.txt | 11 +++++ .../test_ports/vcpkg-ci-curl/portfile.cmake | 1 + scripts/test_ports/vcpkg-ci-curl/vcpkg.json | 40 +++++++++++++++++++ versions/baseline.json | 4 +- versions/c-/cpr.json | 5 +++ versions/c-/curl.json | 5 +++ 12 files changed, 109 insertions(+), 29 deletions(-) delete mode 100644 ports/cpr/001-cpr-config.patch create mode 100644 scripts/test_ports/vcpkg-ci-curl/portfile.cmake create mode 100644 scripts/test_ports/vcpkg-ci-curl/vcpkg.json diff --git a/ports/cpr/001-cpr-config.patch b/ports/cpr/001-cpr-config.patch deleted file mode 100644 index 116321b0b2..0000000000 --- a/ports/cpr/001-cpr-config.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/cpr/CMakeLists.txt b/cpr/CMakeLists.txt -index 52787f5..aa3687d 100644 ---- a/cpr/CMakeLists.txt -+++ b/cpr/CMakeLists.txt -@@ -46,6 +46,10 @@ set_target_properties(cpr - VERSION ${${PROJECT_NAME}_VERSION} - SOVERSION ${${PROJECT_NAME}_VERSION_MAJOR}) - -+if (NOT DISABLE_INSTALL_HEADERS) -+ install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../include/cpr DESTINATION include) -+endif() -+ - # Import GNU common install directory variables - include(GNUInstallDirs) - diff --git a/ports/cpr/portfile.cmake b/ports/cpr/portfile.cmake index 1ccdc3f5cd..eca6d45f12 100644 --- a/ports/cpr/portfile.cmake +++ b/ports/cpr/portfile.cmake @@ -7,7 +7,6 @@ vcpkg_from_github( SHA512 5e2fe69d5b4dfaa67f636098c8da904b43a22b21cc78bc52446e572ea47f492ce1de0f47fdc2cf34207729ccf007449278f218d8cdeef21f0b98356bca2e5e49 HEAD_REF master PATCHES - 001-cpr-config.patch disable_werror.patch ) @@ -20,10 +19,14 @@ vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS -DCPR_BUILD_TESTS=OFF - -DCPR_FORCE_USE_SYSTEM_CURL=ON + -DCPR_USE_SYSTEM_CURL=ON ${FEATURE_OPTIONS} - OPTIONS_DEBUG - -DDISABLE_INSTALL_HEADERS=ON + # skip test for unused sanitizer flags + -DTHREAD_SANITIZER_AVAILABLE=OFF + -DADDRESS_SANITIZER_AVAILABLE=OFF + -DLEAK_SANITIZER_AVAILABLE=OFF + -DUNDEFINED_BEHAVIOUR_SANITIZER_AVAILABLE=OFF + -DALL_SANITIZERS_AVAILABLE=OFF ) vcpkg_cmake_install() diff --git a/ports/cpr/vcpkg.json b/ports/cpr/vcpkg.json index 3cdf6d02f6..6a7400895f 100644 --- a/ports/cpr/vcpkg.json +++ b/ports/cpr/vcpkg.json @@ -1,7 +1,7 @@ { "name": "cpr", "version-semver": "1.10.5", - "port-version": 1, + "port-version": 2, "description": "C++ Requests is a simple wrapper around libcurl inspired by the excellent Python Requests project.", "homepage": "https://github.com/libcpr/cpr", "license": "MIT", diff --git a/ports/curl/cmake-project-include.cmake b/ports/curl/cmake-project-include.cmake index 093a09df28..1089146da8 100644 --- a/ports/curl/cmake-project-include.cmake +++ b/ports/curl/cmake-project-include.cmake @@ -67,6 +67,8 @@ function(vcpkg_curl_flatten input output) set(lib -l${CMAKE_MATCH_1}) elseif(lib MATCHES ".*/${CMAKE_STATIC_LIBRARY_PREFIX}([^/]*)${CMAKE_STATIC_LIBRARY_SUFFIX}") set(lib -l${CMAKE_MATCH_1}) + elseif(lib MATCHES ".*/${CMAKE_SHARED_LIBRARY_PREFIX}([^/]*)${CMAKE_SHARED_LIBRARY_SUFFIX}") + set(lib -l${CMAKE_MATCH_1}) endif() if(NOT "${lib}" IN_LIST output_libs) list(PREPEND output_libs "${lib}") @@ -79,3 +81,14 @@ if(USE_LIBIDN2) find_package(PkgConfig REQUIRED) pkg_check_modules(LIBIDN2 REQUIRED libidn2) endif() + +if(NOT CURL_DISABLE_LDAP AND NOT WIN32) + find_package(PkgConfig REQUIRED) + pkg_check_modules(LDAP REQUIRED ldap) + set(HAVE_LIBLDAP 1) + set(CMAKE_LDAP_INCLUDE_DIR "${LDAP_INCLUDE_DIRS}") + set(CMAKE_LDAP_LIB "${LDAP_LINK_LIBRARIES}" CACHE STRING "") + pkg_check_modules(LBER REQUIRED lber) + set(HAVE_LIBLBER 1) + set(CMAKE_LBER_LIB "${LBER_LINK_LIBRARIES}" CACHE STRING "") +endif() diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index ef0e56ba99..fe3cd4beb5 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -33,16 +33,16 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS sectransp CURL_USE_SECTRANSP idn2 USE_LIBIDN2 winidn USE_WIN32_IDN - winldap USE_WIN32_LDAP websockets ENABLE_WEBSOCKETS zstd CURL_ZSTD INVERTED_FEATURES + ldap CURL_DISABLE_LDAP + ldap CURL_DISABLE_LDAPS non-http HTTP_ONLY - winldap CURL_DISABLE_LDAP # Only WinLDAP support ATM ) set(OPTIONS "") -if("idn2" IN_LIST FEATURES) +if("idn2" IN_LIST FEATURES OR ("ldap" IN_LIST FEATURES AND NOT VCPKG_TARGET_IS_WINDOWS)) vcpkg_find_acquire_program(PKGCONFIG) list(APPEND OPTIONS "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}") endif() @@ -71,7 +71,7 @@ vcpkg_cmake_configure( ${FEATURE_OPTIONS} ${OPTIONS} -DBUILD_TESTING=OFF - -DENABLE_MANUAL=OFF + -DENABLE_CURL_MANUAL=OFF -DCURL_CA_FALLBACK=ON -DCURL_USE_LIBPSL=OFF -DCMAKE_DISABLE_FIND_PACKAGE_Perl=ON diff --git a/ports/curl/vcpkg.json b/ports/curl/vcpkg.json index 88acd18738..00d693476c 100644 --- a/ports/curl/vcpkg.json +++ b/ports/curl/vcpkg.json @@ -1,6 +1,7 @@ { "name": "curl", "version": "8.6.0", + "port-version": 1, "description": "A library for transferring data with URLs", "homepage": "https://curl.se/", "license": "curl AND ISC AND BSD-3-Clause", @@ -72,6 +73,23 @@ "libidn2" ] }, + "ldap": { + "description": "LDAP support", + "supports": "!uwp", + "dependencies": [ + { + "name": "curl", + "default-features": false, + "features": [ + "non-http" + ] + }, + { + "name": "openldap", + "platform": "!windows" + } + ] + }, "mbedtls": { "description": "SSL support (mbedTLS)", "dependencies": [ @@ -169,14 +187,13 @@ "supports": "windows" }, "winldap": { - "description": "LDAP support (WinLDAP). This feature does not include LDAPS support.", - "supports": "windows & !uwp", + "description": "Obsolete. Use feature 'ldap' instead.", "dependencies": [ { "name": "curl", "default-features": false, "features": [ - "non-http" + "ldap" ] } ] diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index e5b84d3bba..e9cf77a963 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1260,6 +1260,17 @@ vcpkg-ci-boost:x64-windows-static-md=pass vcpkg-ci-boost:x64-windows-static=pass vcpkg-ci-boost:x64-windows=pass vcpkg-ci-boost:x86-windows=pass +vcpkg-ci-curl:arm-neon-android=pass +vcpkg-ci-curl:arm64-android=pass +vcpkg-ci-curl:x64-android=pass +vcpkg-ci-curl:x64-linux=pass +vcpkg-ci-curl:arm64-osx=pass +vcpkg-ci-curl:x64-osx=pass +vcpkg-ci-curl:arm64-windows=pass +vcpkg-ci-curl:x64-windows-static-md=pass +vcpkg-ci-curl:x64-windows-static=pass +vcpkg-ci-curl:x64-windows=pass +vcpkg-ci-curl:x86-windows=pass vcpkg-ci-ffmpeg:arm64-uwp=pass vcpkg-ci-ffmpeg:arm64-windows=pass vcpkg-ci-ffmpeg:x64-linux=pass diff --git a/scripts/test_ports/vcpkg-ci-curl/portfile.cmake b/scripts/test_ports/vcpkg-ci-curl/portfile.cmake new file mode 100644 index 0000000000..065116c276 --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-curl/portfile.cmake @@ -0,0 +1 @@ +set(VCPKG_POLICY_EMPTY_PACKAGE enabled) diff --git a/scripts/test_ports/vcpkg-ci-curl/vcpkg.json b/scripts/test_ports/vcpkg-ci-curl/vcpkg.json new file mode 100644 index 0000000000..87315e1dba --- /dev/null +++ b/scripts/test_ports/vcpkg-ci-curl/vcpkg.json @@ -0,0 +1,40 @@ +{ + "name": "vcpkg-ci-curl", + "version-date": "2024-03-05", + "description": "Port to force features of certain ports within CI", + "homepage": "https://github.com/microsoft/vcpkg", + "license": "MIT", + "dependencies": [ + { + "name": "curl", + "features": [ + "http2", + "zstd" + ] + }, + { + "$comment": "Known to break aws-sdk-cpp.", + "name": "curl", + "features": [ + "brotli" + ], + "platform": "!osx" + }, + { + "$comment": "Known to be fixed by libidn2 update.", + "name": "curl", + "features": [ + "idn" + ], + "platform": "!android" + }, + { + "name": "curl", + "features": [ + "ldap", + "tool" + ], + "platform": "!android & !uwp" + } + ] +} diff --git a/versions/baseline.json b/versions/baseline.json index c1c3610f08..c9e4f1c9eb 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1950,7 +1950,7 @@ }, "cpr": { "baseline": "1.10.5", - "port-version": 1 + "port-version": 2 }, "cpu-features": { "baseline": "0.9.0", @@ -2062,7 +2062,7 @@ }, "curl": { "baseline": "8.6.0", - "port-version": 0 + "port-version": 1 }, "curlpp": { "baseline": "2018-06-15", diff --git a/versions/c-/cpr.json b/versions/c-/cpr.json index 79a0fd5c98..cbe6fb3b1a 100644 --- a/versions/c-/cpr.json +++ b/versions/c-/cpr.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "25dbacaabb8b12e7032cbad5e03434c983732f2a", + "version-semver": "1.10.5", + "port-version": 2 + }, { "git-tree": "83379af62bd0d170537dd4ee3abba017d4a54659", "version-semver": "1.10.5", diff --git a/versions/c-/curl.json b/versions/c-/curl.json index 7565cfc630..fa17b055bd 100644 --- a/versions/c-/curl.json +++ b/versions/c-/curl.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "1e5908adb574672dfc7a65baa8523ae184f5c0b7", + "version": "8.6.0", + "port-version": 1 + }, { "git-tree": "dba7665cff5bd6f1a31ad0aa864fd83049eac93e", "version": "8.6.0",