mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-18 17:20:37 +08:00
a79bb7b608
* Fix SSL on iOS Enables secure transport SSL backend on iOS. When CURL_CA_BUNDLE is set (defaults to /etc/ssl/cert.pem) curl sets it as CA for every request, but on iOS this file is missing and curl's `sectransp` SSL implementation can't deal with it, failing the request completely. This change makes CURL_CA_BUNDLE to be unset, much like CURL_CA_PATH so that `sectransp` uses system CA store. * Update versions/c-/curl.json Co-authored-by: Frank <65999885+FrankXie05@users.noreply.github.com> Co-authored-by: Frank <65999885+FrankXie05@users.noreply.github.com>
140 lines
5.5 KiB
CMake
140 lines
5.5 KiB
CMake
vcpkg_from_github(
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
REPO curl/curl
|
|
REF curl-7_84_0
|
|
SHA512 2a000c052c14ee9e6bed243e92699517889554bc0dc03e9f28d398ecf14b405c336f1303e6ed15ed30e88d5d00fefecdc189e83def3f0a5431f63e3be1c55c35
|
|
HEAD_REF master
|
|
PATCHES
|
|
0002_fix_uwp.patch
|
|
0005_remove_imp_suffix.patch
|
|
0012-fix-dependency-idn2.patch
|
|
0020-fix-pc-file.patch
|
|
0021-normaliz.patch # for mingw on case-sensitive file system
|
|
0022-deduplicate-libs.patch
|
|
mbedtls-ws2_32.patch
|
|
export-components.patch
|
|
)
|
|
|
|
# schannel will enable sspi, but sspi do not support uwp
|
|
foreach(feature IN ITEMS "schannel" "sspi" "tool" "winldap")
|
|
if(feature IN_LIST FEATURES AND VCPKG_TARGET_IS_UWP)
|
|
message(FATAL_ERROR "Feature ${feature} is not supported on UWP.")
|
|
endif()
|
|
endforeach()
|
|
|
|
if("sectransp" IN_LIST FEATURES AND NOT (VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_IOS))
|
|
message(FATAL_ERROR "sectransp is not supported on non-Apple platforms")
|
|
endif()
|
|
|
|
foreach(feature IN ITEMS "winldap" "winidn")
|
|
if(feature IN_LIST FEATURES AND NOT VCPKG_TARGET_IS_WINDOWS)
|
|
message(FATAL_ERROR "Feature ${feature} is not supported on non-Windows platforms.")
|
|
endif()
|
|
endforeach()
|
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
FEATURES
|
|
# Support HTTP2 TLS Download https://curl.haxx.se/ca/cacert.pem rename to curl-ca-bundle.crt, copy it to libcurl.dll location.
|
|
http2 USE_NGHTTP2
|
|
wolfssl CURL_USE_WOLFSSL
|
|
openssl CURL_USE_OPENSSL
|
|
mbedtls CURL_USE_MBEDTLS
|
|
ssh CURL_USE_LIBSSH2
|
|
tool BUILD_CURL_EXE
|
|
c-ares ENABLE_ARES
|
|
sspi CURL_WINDOWS_SSPI
|
|
brotli CURL_BROTLI
|
|
schannel CURL_USE_SCHANNEL
|
|
sectransp CURL_USE_SECTRANSP
|
|
idn2 USE_LIBIDN2
|
|
winidn USE_WIN32_IDN
|
|
winldap USE_WIN32_LDAP
|
|
INVERTED_FEATURES
|
|
non-http HTTP_ONLY
|
|
winldap CURL_DISABLE_LDAP # Only WinLDAP support ATM
|
|
)
|
|
|
|
set(OPTIONS "")
|
|
if("idn2" IN_LIST FEATURES)
|
|
vcpkg_find_acquire_program(PKGCONFIG)
|
|
list(APPEND OPTIONS "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}")
|
|
endif()
|
|
|
|
if("sectransp" IN_LIST FEATURES)
|
|
list(APPEND OPTIONS -DCURL_CA_PATH=none -DCURL_CA_BUNDLE=none)
|
|
endif()
|
|
|
|
# UWP targets
|
|
if(VCPKG_TARGET_IS_UWP)
|
|
list(APPEND OPTIONS
|
|
-DCURL_DISABLE_TELNET=ON
|
|
-DENABLE_IPV6=OFF
|
|
-DENABLE_UNIX_SOCKETS=OFF
|
|
)
|
|
endif()
|
|
|
|
vcpkg_cmake_configure(
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
OPTIONS
|
|
"-DCMAKE_PROJECT_INCLUDE=${CMAKE_CURRENT_LIST_DIR}/cmake-project-include.cmake"
|
|
${FEATURE_OPTIONS}
|
|
${OPTIONS}
|
|
-DBUILD_TESTING=OFF
|
|
-DENABLE_MANUAL=OFF
|
|
-DCURL_CA_FALLBACK=ON
|
|
-DCURL_USE_LIBPSL=OFF
|
|
OPTIONS_DEBUG
|
|
-DENABLE_DEBUG=ON
|
|
)
|
|
vcpkg_cmake_install()
|
|
vcpkg_copy_pdbs()
|
|
|
|
if ("tool" IN_LIST FEATURES)
|
|
vcpkg_copy_tools(TOOL_NAMES curl AUTO_CLEAN)
|
|
endif()
|
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/CURL)
|
|
|
|
vcpkg_fixup_pkgconfig()
|
|
set(namespec "curl")
|
|
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
|
set(namespec "libcurl")
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libcurl.pc" " -lcurl" " -l${namespec}")
|
|
endif()
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE)
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libcurl.pc" " -lcurl" " -l${namespec}-d")
|
|
endif()
|
|
|
|
#Fix install path
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/bin/curl-config" "${CURRENT_PACKAGES_DIR}" "\${prefix}")
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/bin/curl-config" "${CURRENT_INSTALLED_DIR}" "\${prefix}")
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/bin/curl-config" "\nprefix=\${prefix}" [=[prefix=$(CDPATH= cd -- "$(dirname -- "$0")"/../../.. && pwd -P)]=])
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin")
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/bin/curl-config" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin/curl-config")
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/bin/curl-config")
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "${CURRENT_PACKAGES_DIR}" "\${prefix}")
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "${CURRENT_INSTALLED_DIR}" "\${prefix}")
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "\nprefix=\${prefix}/debug" [=[prefix=$(CDPATH= cd -- "$(dirname -- "$0")"/../../../.. && pwd -P)]=])
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "-lcurl" "-l${namespec}-d")
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "curl." "curl-d.")
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin")
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin/curl-config")
|
|
endif()
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR NOT VCPKG_TARGET_IS_WINDOWS)
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin")
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin")
|
|
endif()
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/curl/curl.h"
|
|
"#ifdef CURL_STATICLIB"
|
|
"#if 1"
|
|
)
|
|
endif()
|
|
|
|
file(INSTALL "${CURRENT_PORT_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
|
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|