Skip to content

Commit

Permalink
[curl] General LDAP support, test port (microsoft#37152)
Browse files Browse the repository at this point in the history
  • Loading branch information
dg0yt authored Mar 13, 2024
1 parent ad8f678 commit d5551b8
Show file tree
Hide file tree
Showing 12 changed files with 109 additions and 29 deletions.
15 changes: 0 additions & 15 deletions ports/cpr/001-cpr-config.patch

This file was deleted.

11 changes: 7 additions & 4 deletions ports/cpr/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ vcpkg_from_github(
SHA512 5e2fe69d5b4dfaa67f636098c8da904b43a22b21cc78bc52446e572ea47f492ce1de0f47fdc2cf34207729ccf007449278f218d8cdeef21f0b98356bca2e5e49
HEAD_REF master
PATCHES
001-cpr-config.patch
disable_werror.patch
)

Expand All @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion ports/cpr/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
13 changes: 13 additions & 0 deletions ports/curl/cmake-project-include.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand All @@ -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()
8 changes: 4 additions & 4 deletions ports/curl/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down
23 changes: 20 additions & 3 deletions ports/curl/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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": [
Expand Down Expand Up @@ -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"
]
}
]
Expand Down
11 changes: 11 additions & 0 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions scripts/test_ports/vcpkg-ci-curl/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
40 changes: 40 additions & 0 deletions scripts/test_ports/vcpkg-ci-curl/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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"
}
]
}
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1950,7 +1950,7 @@
},
"cpr": {
"baseline": "1.10.5",
"port-version": 1
"port-version": 2
},
"cpu-features": {
"baseline": "0.9.0",
Expand Down Expand Up @@ -2062,7 +2062,7 @@
},
"curl": {
"baseline": "8.6.0",
"port-version": 0
"port-version": 1
},
"curlpp": {
"baseline": "2018-06-15",
Expand Down
5 changes: 5 additions & 0 deletions versions/c-/cpr.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "25dbacaabb8b12e7032cbad5e03434c983732f2a",
"version-semver": "1.10.5",
"port-version": 2
},
{
"git-tree": "83379af62bd0d170537dd4ee3abba017d4a54659",
"version-semver": "1.10.5",
Expand Down
5 changes: 5 additions & 0 deletions versions/c-/curl.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "1e5908adb574672dfc7a65baa8523ae184f5c0b7",
"version": "8.6.0",
"port-version": 1
},
{
"git-tree": "dba7665cff5bd6f1a31ad0aa864fd83049eac93e",
"version": "8.6.0",
Expand Down

0 comments on commit d5551b8

Please sign in to comment.