2017-08-11 03:43:50 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO curl/curl
|
2021-09-24 08:51:23 +08:00
|
|
|
REF c7aef0a945f9b6fb6d3f91716a21dfe2f4ea635f #curl-7_79_1
|
|
|
|
SHA512 105e945e0acb47950d756382c7e45abbf0d0b12526eb0170af23e68653c1b7e3be27d547d537c4f36d099ebcb04870e8cd571d2baec996373b2032f8451b63e0
|
2017-08-11 03:43:50 +08:00
|
|
|
HEAD_REF master
|
2016-12-07 16:04:49 +08:00
|
|
|
PATCHES
|
2018-12-01 08:37:54 +08:00
|
|
|
0002_fix_uwp.patch
|
2019-06-27 02:49:39 +08:00
|
|
|
0005_remove_imp_suffix.patch
|
2019-10-26 05:28:11 +08:00
|
|
|
0006_fix_tool_depends.patch
|
2020-01-07 07:09:13 +08:00
|
|
|
0007_disable_tool_export_curl_target.patch
|
2020-08-13 01:23:44 +08:00
|
|
|
0011_fix_static_build.patch
|
2020-12-23 15:19:50 +08:00
|
|
|
0012-fix-dependency-idn2.patch
|
2021-07-01 22:22:56 +08:00
|
|
|
0020-fix-pc-file.patch
|
2021-08-12 10:38:08 +08:00
|
|
|
0021-normaliz.patch # for mingw on case-sensitive file system
|
|
|
|
0022-deduplicate-libs.patch
|
2016-12-07 16:04:49 +08:00
|
|
|
)
|
|
|
|
|
2018-02-28 04:15:37 +08:00
|
|
|
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" CURL_STATICLIB)
|
|
|
|
|
2020-09-05 12:18:37 +08:00
|
|
|
# schannel will enable sspi, but sspi do not support uwp
|
2021-08-12 10:38:08 +08:00
|
|
|
foreach(feature IN ITEMS "schannel" "sspi" "tool" "winldap")
|
2020-11-13 04:33:02 +08:00
|
|
|
if(feature IN_LIST FEATURES AND VCPKG_TARGET_IS_UWP)
|
|
|
|
message(FATAL_ERROR "Feature ${feature} is not supported on UWP.")
|
|
|
|
endif()
|
|
|
|
endforeach()
|
2020-02-05 06:40:19 +08:00
|
|
|
|
|
|
|
if("sectransp" IN_LIST FEATURES AND NOT VCPKG_TARGET_IS_OSX)
|
|
|
|
message(FATAL_ERROR "sectransp is not supported on non-Apple platforms")
|
|
|
|
endif()
|
|
|
|
|
2021-08-12 10:38:08 +08:00
|
|
|
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()
|
|
|
|
|
2020-02-05 06:40:19 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
2021-08-12 10:38:08 +08:00
|
|
|
# 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
|
|
|
|
openssl CMAKE_USE_OPENSSL
|
|
|
|
mbedtls CMAKE_USE_MBEDTLS
|
|
|
|
ssh CMAKE_USE_LIBSSH2
|
|
|
|
tool BUILD_CURL_EXE
|
|
|
|
c-ares ENABLE_ARES
|
|
|
|
sspi CURL_WINDOWS_SSPI
|
|
|
|
brotli CURL_BROTLI
|
|
|
|
schannel CMAKE_USE_SCHANNEL
|
|
|
|
sectransp CMAKE_USE_SECTRANSP
|
|
|
|
idn2 USE_LIBIDN2
|
|
|
|
winidn USE_WIN32_IDN
|
|
|
|
winldap USE_WIN32_LDAP
|
2020-02-05 06:40:19 +08:00
|
|
|
INVERTED_FEATURES
|
2021-08-12 10:38:08 +08:00
|
|
|
non-http HTTP_ONLY
|
|
|
|
winldap CURL_DISABLE_LDAP # Only WinLDAP support ATM
|
2020-02-05 06:40:19 +08:00
|
|
|
)
|
2018-01-24 04:11:15 +08:00
|
|
|
|
2021-08-12 10:38:08 +08:00
|
|
|
set(OPTIONS_RELEASE "")
|
|
|
|
set(OPTIONS_DEBUG "")
|
|
|
|
if("idn2" IN_LIST FEATURES)
|
|
|
|
x_vcpkg_pkgconfig_get_modules(PREFIX libidn2 MODULES libidn2 LIBS)
|
|
|
|
list(APPEND OPTIONS_RELEASE "-DLIBIDN2_LIBRARIES=${libidn2_LIBS_RELEASE}")
|
|
|
|
list(APPEND OPTIONS_DEBUG "-DLIBIDN2_LIBRARIES=${libidn2_LIBS_DEBUG}")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(SECTRANSP_OPTIONS "")
|
2019-05-27 07:53:41 +08:00
|
|
|
if("sectransp" IN_LIST FEATURES)
|
2020-02-05 06:40:19 +08:00
|
|
|
set(SECTRANSP_OPTIONS -DCURL_CA_PATH=none)
|
2019-07-08 14:11:01 +08:00
|
|
|
endif()
|
|
|
|
|
2018-02-28 04:15:37 +08:00
|
|
|
# UWP targets
|
2021-08-12 10:38:08 +08:00
|
|
|
set(UWP_OPTIONS "")
|
2020-02-05 06:40:19 +08:00
|
|
|
if(VCPKG_TARGET_IS_UWP)
|
2017-08-11 03:43:50 +08:00
|
|
|
set(UWP_OPTIONS
|
|
|
|
-DCURL_DISABLE_TELNET=ON
|
|
|
|
-DENABLE_IPV6=OFF
|
|
|
|
-DENABLE_UNIX_SOCKETS=OFF
|
2017-01-12 02:59:45 +08:00
|
|
|
)
|
|
|
|
endif()
|
2016-09-19 11:50:08 +08:00
|
|
|
|
2021-08-12 10:38:08 +08:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
OPTIONS
|
|
|
|
${FEATURE_OPTIONS}
|
2017-08-11 03:43:50 +08:00
|
|
|
${UWP_OPTIONS}
|
2019-05-27 07:53:41 +08:00
|
|
|
${SECTRANSP_OPTIONS}
|
2017-08-11 03:43:50 +08:00
|
|
|
-DBUILD_TESTING=OFF
|
|
|
|
-DENABLE_MANUAL=OFF
|
|
|
|
-DCURL_STATICLIB=${CURL_STATICLIB}
|
2019-05-27 07:53:41 +08:00
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_Perl=ON
|
2017-08-11 03:43:50 +08:00
|
|
|
-DENABLE_DEBUG=ON
|
2020-09-05 12:18:37 +08:00
|
|
|
-DCURL_CA_FALLBACK=ON
|
2021-08-12 10:38:08 +08:00
|
|
|
OPTIONS_RELEASE
|
|
|
|
${OPTIONS_RELEASE}
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
${OPTIONS_DEBUG}
|
2017-08-11 03:43:50 +08:00
|
|
|
)
|
2021-08-12 10:38:08 +08:00
|
|
|
vcpkg_cmake_install()
|
2020-02-05 06:40:19 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2019-04-09 14:53:10 +08:00
|
|
|
|
2020-02-05 06:40:19 +08:00
|
|
|
if ("tool" IN_LIST FEATURES)
|
2020-08-08 07:15:20 +08:00
|
|
|
vcpkg_copy_tools(TOOL_NAMES curl AUTO_CLEAN)
|
2018-02-28 04:15:37 +08:00
|
|
|
endif()
|
|
|
|
|
2021-08-12 10:38:08 +08:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/CURL)
|
2019-06-27 02:49:39 +08:00
|
|
|
|
2021-08-12 10:38:08 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2019-05-13 23:57:55 +08:00
|
|
|
|
2020-11-13 04:33:02 +08:00
|
|
|
#Fix install path
|
2021-08-12 10:38:08 +08:00
|
|
|
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" "-lcurl-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")
|
2021-05-14 05:00:32 +08:00
|
|
|
endif()
|
2021-08-12 10:38:08 +08:00
|
|
|
|
|
|
|
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")
|
2017-08-11 03:43:50 +08:00
|
|
|
endif()
|
|
|
|
|
2019-06-27 02:49:39 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
2021-08-12 10:38:08 +08:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/curl/curl.h"
|
2020-07-07 04:23:44 +08:00
|
|
|
"#ifdef CURL_STATICLIB"
|
|
|
|
"#if 1"
|
|
|
|
)
|
2020-11-21 04:18:17 +08:00
|
|
|
endif()
|
|
|
|
|
2021-05-14 05:00:32 +08:00
|
|
|
vcpkg_fixup_pkgconfig()
|
2021-08-12 10:38:08 +08:00
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libcurl.pc")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libcurl.pc" " -lcurl" " -lcurl-d")
|
|
|
|
endif()
|
2021-05-14 05:00:32 +08:00
|
|
|
|
2021-05-29 01:00:20 +08:00
|
|
|
file(INSTALL "${CURRENT_PORT_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2021-08-12 10:38:08 +08:00
|
|
|
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|