From 08bb6e106ec554a830bae36772546f2c1ffd3ccb Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Wed, 19 Jan 2022 18:15:16 +0100 Subject: [PATCH] [curl] Update to 7.81.0 (#22445) * Update to 7.81.0 * Revise curl wrapper, fix `COMPONENTS` * Update versions * Add fix for multi-ssl config * [skip actions] CI feature test * Refactor lib export fixup Handle Debug/Release/IMPORTED_*... * Fix libssh2 lookup * Fix libidn2.pc for windows * Fix libidn2 import * Fix mbedtls import * Simplify options * [skip actions] CI feature test * Revert CI feature test configuration * Update versions * Limit import lib fixup to WIN32 * Update versions --- ports/curl/0002_fix_uwp.patch | 23 +++--- ports/curl/0005_remove_imp_suffix.patch | 18 ++-- ports/curl/0006_fix_tool_depends.patch | 22 ----- ...0007_disable_tool_export_curl_target.patch | 18 ---- ports/curl/0011_fix_static_build.patch | 13 --- ports/curl/0012-fix-dependency-idn2.patch | 2 +- ports/curl/0020-fix-pc-file.patch | 48 +---------- ports/curl/0022-deduplicate-libs.patch | 13 --- ports/curl/0023-fix-static-libs-export.patch | 14 ---- ports/curl/cmake-project-include.cmake | 82 +++++++++++++++++++ ports/curl/curl-7.81.0-ssl.patch | 33 ++++++++ ports/curl/export-components.patch | 23 ++++++ ports/curl/mbedtls-ws2_32.patch | 14 ++++ ports/curl/portfile.cmake | 38 ++++----- ports/curl/vcpkg-cmake-wrapper.cmake | 31 ++++--- ports/curl/vcpkg.json | 8 +- ports/libidn2/CMakeLists.txt | 9 +- ports/libidn2/portfile.cmake | 2 +- ports/libidn2/vcpkg.json | 6 +- versions/baseline.json | 4 +- versions/c-/curl.json | 5 ++ versions/l-/libidn2.json | 5 ++ 22 files changed, 236 insertions(+), 195 deletions(-) delete mode 100644 ports/curl/0006_fix_tool_depends.patch delete mode 100644 ports/curl/0007_disable_tool_export_curl_target.patch delete mode 100644 ports/curl/0011_fix_static_build.patch delete mode 100644 ports/curl/0023-fix-static-libs-export.patch create mode 100644 ports/curl/cmake-project-include.cmake create mode 100644 ports/curl/curl-7.81.0-ssl.patch create mode 100644 ports/curl/export-components.patch create mode 100644 ports/curl/mbedtls-ws2_32.patch diff --git a/ports/curl/0002_fix_uwp.patch b/ports/curl/0002_fix_uwp.patch index c1572624a3..e31cb9fbf6 100644 --- a/ports/curl/0002_fix_uwp.patch +++ b/ports/curl/0002_fix_uwp.patch @@ -2,15 +2,14 @@ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 62b7b33..8a4bd71 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt -@@ -107,6 +107,10 @@ endif() - - target_link_libraries(${LIB_NAME} ${CURL_LIBS}) - -+if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") -+ add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS) -+endif() -+ - if(WIN32) - add_definitions(-D_USRDLL) - endif() - +@@ -115,6 +115,10 @@ if(CURL_HAS_LTO) + INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE) + endif() + ++if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") ++ set_property(TARGET ${LIB_NAME} APPEND PROPERTY COMPILE_DEFINITIONS "_WINSOCK_DEPRECATED_NO_WARNINGS") ++endif() ++ + if(WIN32) + if(BUILD_SHARED_LIBS) + set_property(TARGET ${LIB_NAME} APPEND PROPERTY COMPILE_DEFINITIONS "_USRDLL") diff --git a/ports/curl/0005_remove_imp_suffix.patch b/ports/curl/0005_remove_imp_suffix.patch index 83ec105133..e52da2585b 100644 --- a/ports/curl/0005_remove_imp_suffix.patch +++ b/ports/curl/0005_remove_imp_suffix.patch @@ -2,13 +2,11 @@ diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 1d71e14..62b7b33 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt -@@ -128,7 +128,7 @@ if(CURL_HAS_LTO) - INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE) - endif() - --if(WIN32) -+if(WIN32 AND 0) - if(BUILD_SHARED_LIBS) - if(MSVC) - # Add "_imp" as a suffix before the extension to avoid conflicting with - # the statically linked "libcurl.lib" +@@ -125,7 +125,6 @@ if(WIN32) + if(MSVC) + # Add "_imp" as a suffix before the extension to avoid conflicting with + # the statically linked "libcurl.lib" +- set_target_properties(${LIB_NAME} PROPERTIES IMPORT_SUFFIX "_imp.lib") + endif() + endif() + endif() diff --git a/ports/curl/0006_fix_tool_depends.patch b/ports/curl/0006_fix_tool_depends.patch deleted file mode 100644 index a918b08e2d..0000000000 --- a/ports/curl/0006_fix_tool_depends.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 26e3cfe..74d00dd 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -61,6 +61,8 @@ if(MSVC) - list(APPEND CURL_FILES curl.rc) - endif() - -+find_package(ZLIB REQUIRED) -+ - # CURL_FILES comes from Makefile.inc - add_executable( - ${EXE_NAME} -@@ -91,7 +93,7 @@ include_directories( - ) - - #Build curl executable --target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS}) -+target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS} ZLIB::ZLIB) - - ################################################################################ - diff --git a/ports/curl/0007_disable_tool_export_curl_target.patch b/ports/curl/0007_disable_tool_export_curl_target.patch deleted file mode 100644 index 689104a938..0000000000 --- a/ports/curl/0007_disable_tool_export_curl_target.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 74d00dd..5838805 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -103,8 +103,8 @@ target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS} ZLIB::ZLIB) - - #INCLUDE(ModuleInstall OPTIONAL) - --install(TARGETS ${EXE_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) --export(TARGETS ${EXE_NAME} -- APPEND FILE ${PROJECT_BINARY_DIR}/curl-target.cmake -- NAMESPACE ${PROJECT_NAME}:: --) -+install(TARGETS ${EXE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) -+#export(TARGETS ${EXE_NAME} -+# APPEND FILE ${PROJECT_BINARY_DIR}/curl-target.cmake -+# NAMESPACE ${PROJECT_NAME}:: -+#) diff --git a/ports/curl/0011_fix_static_build.patch b/ports/curl/0011_fix_static_build.patch deleted file mode 100644 index a50fa287f5..0000000000 --- a/ports/curl/0011_fix_static_build.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt -index 8a4bd71..1927fb0 100644 ---- a/lib/CMakeLists.txt -+++ b/lib/CMakeLists.txt -@@ -111,7 +111,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - add_definitions(-D_WINSOCK_DEPRECATED_NO_WARNINGS) - endif() - --if(WIN32) -+if(WIN32 AND BUILD_SHARED_LIBS) - add_definitions(-D_USRDLL) - endif() - diff --git a/ports/curl/0012-fix-dependency-idn2.patch b/ports/curl/0012-fix-dependency-idn2.patch index 9388f91a0b..e1d59bf5da 100644 --- a/ports/curl/0012-fix-dependency-idn2.patch +++ b/ports/curl/0012-fix-dependency-idn2.patch @@ -7,7 +7,7 @@ index 9f6de81..6702845 100644 set(HAVE_LIBIDN2 OFF) if(USE_LIBIDN2) + set(HAVE_LIBIDN2 TRUE) -+ list(APPEND CURL_LIBS ${LIBIDN2_LIBRARIES}) ++ list(INSERT CURL_LIBS 0 ${LIBIDN2_LINK_LIBRARIES}) +elseif(0) check_library_exists_concat("idn2" idn2_lookup_ul HAVE_LIBIDN2) endif() diff --git a/ports/curl/0020-fix-pc-file.patch b/ports/curl/0020-fix-pc-file.patch index 73e042ca23..21eab0933b 100644 --- a/ports/curl/0020-fix-pc-file.patch +++ b/ports/curl/0020-fix-pc-file.patch @@ -2,58 +2,14 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b2e428..ea430f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -1462,7 +1462,26 @@ set(includedir "\${prefix}/include") +@@ -1505,7 +1505,9 @@ set(includedir "\${prefix}/include") set(LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS}") set(LIBCURL_LIBS "") set(libdir "${CMAKE_INSTALL_PREFIX}/lib") -foreach(_lib ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} ${CURL_LIBS}) -+function(flatten input output) -+ set(output_libs "${${output}}") -+ set(input_libs "${${input}}") -+ while(input_libs) -+ list(POP_BACK input_libs lib) -+ if(NOT "${lib}" IN_LIST output_libs) -+ if(TARGET "${lib}") -+ get_target_property(link_libs "${lib}" INTERFACE_LINK_LIBRARIES) -+ if(link_libs) -+ flatten(link_libs output_libs) -+ endif() -+ endif() -+ list(PREPEND output_libs "${lib}") -+ endif() -+ endwhile() -+ set("${output}" "${output_libs}" PARENT_SCOPE) -+endfunction() +set(CURL_LIBS_FLAT "") -+flatten(CURL_LIBS CURL_LIBS_FLAT) ++vcpkg_curl_flatten(CURL_LIBS CURL_LIBS_FLAT) +foreach(_lib ${CURL_LIBS_FLAT}) if(TARGET "${_lib}") set(_libname "${_lib}") get_target_property(_imported "${_libname}" IMPORTED) -@@ -1503,12 +1523,26 @@ foreach(_lib ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} ${CURL_LIBS}) - # Assume the user won't need this information in the .pc file. - continue() - endif() -+ set(_lib NOTFOUND) -+ if(DEFINED CMAKE_BUILD_TYPE) -+ string(TOUPPER "${CMAKE_BUILD_TYPE}" config) -+ get_target_property(_lib "${_libname}" IMPORTED_LOCATION_${config}) -+ endif() -+ if(NOT _lib) - get_target_property(_lib "${_libname}" LOCATION) -+ endif() - if(NOT _lib) - message(WARNING "Bad lib in library list: ${_libname}") - continue() - endif() - endif() -+ if(_lib MATCHES "^(.*)/([^/]*)[.]framework$") -+ if(CMAKE_MATCH_1 IN_LIST CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES) -+ set(_lib "-framework ${CMAKE_MATCH_2}") -+ else() -+ set(_lib "-framework ${_lib}") -+ endif() -+ endif() - if(_lib MATCHES ".*/.*" OR _lib MATCHES "^-") - set(LIBCURL_LIBS "${LIBCURL_LIBS} ${_lib}") - else() diff --git a/ports/curl/0022-deduplicate-libs.patch b/ports/curl/0022-deduplicate-libs.patch index bd027d4cb4..16cc0498a3 100644 --- a/ports/curl/0022-deduplicate-libs.patch +++ b/ports/curl/0022-deduplicate-libs.patch @@ -10,16 +10,3 @@ index 09d82f1..f0d99e6 100644 endif() # "a" (Linux) or "lib" (Windows) string(REPLACE "." "" libext "${CMAKE_STATIC_LIBRARY_SUFFIX}") -diff --git a/curl-config.in b/curl-config.in -index 8b4a29a..e756ae8 100644 ---- a/curl-config.in -+++ b/curl-config.in -@@ -172,7 +172,7 @@ while test $# -gt 0; do - - --static-libs) - if test "X@ENABLE_STATIC@" != "Xno" ; then -- echo @libdir@/libcurl.@libext@ @LDFLAGS@ @LIBCURL_LIBS@ -+ echo @libdir@/libcurl.@libext@ @LDFLAGS@ @LIBCURL_NO_SHARED@ - else - echo "curl was built with static libraries disabled" >&2 - exit 1 diff --git a/ports/curl/0023-fix-static-libs-export.patch b/ports/curl/0023-fix-static-libs-export.patch deleted file mode 100644 index de12b38b5f..0000000000 --- a/ports/curl/0023-fix-static-libs-export.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 158d7a5..ae7b388 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1534,6 +1534,9 @@ foreach(_lib ${CURL_LIBS_FLAT}) - set(_lib "-framework ${_lib}") - endif() - endif() -+ if(_lib MATCHES ".*/${CMAKE_STATIC_LIBRARY_PREFIX}([^/]*)${CMAKE_STATIC_LIBRARY_SUFFIX}") -+ set(_lib -l${CMAKE_MATCH_1}) -+ endif() - if(_lib MATCHES ".*/.*" OR _lib MATCHES "^-") - set(LIBCURL_LIBS "${LIBCURL_LIBS} ${_lib}") - else() diff --git a/ports/curl/cmake-project-include.cmake b/ports/curl/cmake-project-include.cmake new file mode 100644 index 0000000000..27254864c2 --- /dev/null +++ b/ports/curl/cmake-project-include.cmake @@ -0,0 +1,82 @@ +# Process the libs and targets in the variable named by `input` +# into a flat list of libs in the variable named by `output`. +# Simplify -framework elements. +# Use -l where possible. +# Avoid duplicates. +function(vcpkg_curl_flatten input output) + set(output_libs "${${output}}") + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + string(REGEX REPLACE ";optimized;[^;]*|;debug" "" input_libs "VCPKG;${${input}}") + else() + string(REGEX REPLACE ";debug;[^;]*|;optimized" "" input_libs "VCPKG;${${input}}") + endif() + list(REMOVE_AT input_libs 0) + while(input_libs) + list(POP_BACK input_libs lib) + if(TARGET "${lib}") + set(import_lib "") + set(import_location "") + get_target_property(type "${lib}" TYPE) + if(NOT type STREQUAL "INTERFACE_LIBRARY") + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + get_target_property(link_libs "${lib}" IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG) + get_target_property(import_lib "${lib}" IMPORTED_IMPLIB_DEBUG) + get_target_property(import_location "${lib}" IMPORTED_LOCATION_DEBUG) + else() + get_target_property(link_libs "${lib}" IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE) + get_target_property(import_lib "${lib}" IMPORTED_IMPLIB_RELEASE) + get_target_property(import_location "${lib}" IMPORTED_LOCATION_RELEASE) + endif() + if(link_libs) + vcpkg_curl_flatten(link_libs output_libs) + endif() + get_target_property(link_libs "${lib}" IMPORTED_LINK_INTERFACE_LIBRARIES) + if(link_libs) + vcpkg_curl_flatten(link_libs output_libs) + endif() + if(NOT import_lib) + get_target_property(import_lib "${lib}" IMPORTED_IMPLIB) + endif() + if(NOT import_location) + get_target_property(import_location "${lib}" IMPORTED_LOCATION) + endif() + endif() + get_target_property(link_libs "${lib}" INTERFACE_LINK_LIBRARIES) + if(link_libs) + vcpkg_curl_flatten(link_libs output_libs) + endif() + if(import_lib) + set(lib "${import_lib}") + elseif(import_location) + set(lib "${import_location}") + endif() + endif() + if(lib MATCHES "^(.*)/([^/]*)[.]framework$") + if(CMAKE_MATCH_1 IN_LIST CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES) + set(lib "-framework ${CMAKE_MATCH_2}") + else() + set(lib "-framework ${lib}") + endif() + elseif(WIN32 AND lib MATCHES ".*/${CMAKE_IMPORT_LIBRARY_PREFIX}([^/]*)${CMAKE_IMPORT_LIBRARY_SUFFIX}") + set(lib -l${CMAKE_MATCH_1}) + elseif(lib MATCHES ".*/${CMAKE_STATIC_LIBRARY_PREFIX}([^/]*)${CMAKE_STATIC_LIBRARY_SUFFIX}") + set(lib -l${CMAKE_MATCH_1}) + endif() + if(NOT "${lib}" IN_LIST output_libs) + list(PREPEND output_libs "${lib}") + endif() + endwhile() + set("${output}" "${output_libs}" PARENT_SCOPE) +endfunction() + +if(CURL_USE_LIBSSH2) + find_package(Libssh2 CONFIG REQUIRED) + set(LIBSSH2_FOUND TRUE) + get_target_property(LIBSSH2_INCLUDE_DIR Libssh2::libssh2 INTERFACE_INCLUDE_DIRECTORIES) + set(LIBSSH2_LIBRARY Libssh2::libssh2) +endif() + +if(USE_LIBIDN2) + find_package(PkgConfig REQUIRED) + pkg_check_modules(LIBIDN2 REQUIRED libidn2) +endif() diff --git a/ports/curl/curl-7.81.0-ssl.patch b/ports/curl/curl-7.81.0-ssl.patch new file mode 100644 index 0000000000..8be987b7f5 --- /dev/null +++ b/ports/curl/curl-7.81.0-ssl.patch @@ -0,0 +1,33 @@ +diff --git a/lib/vtls/openssl.h b/lib/vtls/openssl.h +index 28058453c0b3..a7c193b37e46 100644 +--- a/lib/vtls/openssl.h ++++ b/lib/vtls/openssl.h +@@ -7,7 +7,7 @@ + * | (__| |_| | _ <| |___ + * \___|\___/|_| \_\_____| + * +- * Copyright (C) 1998 - 2021, Daniel Stenberg, , et al. ++ * Copyright (C) 1998 - 2022, Daniel Stenberg, , et al. + * + * This software is licensed as described in the file COPYING, which + * you should have received as part of this distribution. The terms +@@ -30,11 +30,17 @@ + * and ngtcp2.c + */ + +-#include + #include "urldata.h" + ++/* ++ * In an affort to avoid using 'X509 *' here, we instead use the struct ++ * x509_st version of the type so that we can forward-declare it here without ++ * having to include . Including that header causes name ++ * conflicts when libcurl is built with both Schannel and OpenSSL support. ++ */ ++struct x509_st; + CURLcode Curl_ossl_verifyhost(struct Curl_easy *data, struct connectdata *conn, +- X509 *server_cert); ++ struct x509_st *server_cert); + extern const struct Curl_ssl Curl_ssl_openssl; + + #endif /* USE_OPENSSL */ diff --git a/ports/curl/export-components.patch b/ports/curl/export-components.patch new file mode 100644 index 0000000000..1a727e5dea --- /dev/null +++ b/ports/curl/export-components.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 874a237..3974956 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1617,8 +1617,17 @@ if(CURL_ENABLE_EXPORT_TARGET) + ) + endif() + ++set(components_file "${CMAKE_CURRENT_BINARY_DIR}/CURLConfigComponents.cmake") ++file(CONFIGURE OUTPUT "${components_file}" CONTENT [[ ++foreach(z_vcpkg_curl_component IN ITEMS @SUPPORT_FEATURES@ @SUPPORT_PROTOCOLS@) ++ if(z_vcpkg_curl_component MATCHES "^[-_a-zA-Z0-9]*$") ++ set(CURL_${z_vcpkg_curl_component}_FOUND TRUE) ++ endif() ++endforeach() ++]] @ONLY) ++ + install( +- FILES ${version_config} ${project_config} ++ FILES ${version_config} ${project_config} ${components_file} + DESTINATION ${CURL_INSTALL_CMAKE_DIR} + ) + diff --git a/ports/curl/mbedtls-ws2_32.patch b/ports/curl/mbedtls-ws2_32.patch new file mode 100644 index 0000000000..37e4f18c94 --- /dev/null +++ b/ports/curl/mbedtls-ws2_32.patch @@ -0,0 +1,14 @@ +diff --git a/CMake/FindMbedTLS.cmake b/CMake/FindMbedTLS.cmake +index 7bdb197..c8c5a73 100644 +--- a/CMake/FindMbedTLS.cmake ++++ b/CMake/FindMbedTLS.cmake +@@ -26,6 +26,9 @@ find_library(MBEDX509_LIBRARY mbedx509) + find_library(MBEDCRYPTO_LIBRARY mbedcrypto) + + set(MBEDTLS_LIBRARIES "${MBEDTLS_LIBRARY}" "${MBEDX509_LIBRARY}" "${MBEDCRYPTO_LIBRARY}") ++if(WIN32) ++ list(APPEND MBEDTLS_LIBRARIES ws2_32) ++endif() + + include(FindPackageHandleStandardArgs) + find_package_handle_standard_args(MbedTLS DEFAULT_MSG diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index ce8b757054..c0344c51ab 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -1,20 +1,19 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO curl/curl - REF 9e560d11aad028de74addc0d1edfefa5667884f4 #curl-7_80_0 - SHA512 f920f151e31f26de8d9a0f8f22aebe98435b0165c52bc169a1204f84f38671dea1eaa2833feceb8495e619b8b9becac0c8ad335ec6fe0c2c59e458bf9014c6c2 + REF curl-7_81_0 + SHA512 2aa2200c50bc0f6f70e402078ab0d2e8248f261f1f584ab619388c4a537593321765dcd20706ba420ebc7d1558f7170aa6b6edc8c13f2315770c5e2919b6f3d9 HEAD_REF master PATCHES 0002_fix_uwp.patch 0005_remove_imp_suffix.patch - 0006_fix_tool_depends.patch - 0007_disable_tool_export_curl_target.patch - 0011_fix_static_build.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 - 0023-fix-static-libs-export.patch + mbedtls-ws2_32.patch + export-components.patch + curl-7.81.0-ssl.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" CURL_STATICLIB) @@ -40,15 +39,15 @@ 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 - openssl CMAKE_USE_OPENSSL - mbedtls CMAKE_USE_MBEDTLS - ssh CMAKE_USE_LIBSSH2 + 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 CMAKE_USE_SCHANNEL - sectransp CMAKE_USE_SECTRANSP + schannel CURL_USE_SCHANNEL + sectransp CURL_USE_SECTRANSP idn2 USE_LIBIDN2 winidn USE_WIN32_IDN winldap USE_WIN32_LDAP @@ -57,23 +56,21 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS winldap CURL_DISABLE_LDAP # Only WinLDAP support ATM ) +set(OPTIONS "") 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}") + vcpkg_find_acquire_program(PKGCONFIG) + list(APPEND OPTIONS "-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}") endif() -set(SECTRANSP_OPTIONS "") if("sectransp" IN_LIST FEATURES) - set(SECTRANSP_OPTIONS -DCURL_CA_PATH=none) + list(APPEND OPTIONS -DCURL_CA_PATH=none) endif() # UWP targets -set(UWP_OPTIONS "") if(VCPKG_TARGET_IS_UWP) - set(UWP_OPTIONS + list(APPEND OPTIONS -DCURL_DISABLE_TELNET=ON -DENABLE_IPV6=OFF -DENABLE_UNIX_SOCKETS=OFF @@ -83,9 +80,9 @@ endif() vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS + "-DCMAKE_PROJECT_INCLUDE=${CMAKE_CURRENT_LIST_DIR}/cmake-project-include.cmake" ${FEATURE_OPTIONS} - ${UWP_OPTIONS} - ${SECTRANSP_OPTIONS} + ${OPTIONS} -DBUILD_TESTING=OFF -DENABLE_MANUAL=OFF -DCURL_STATICLIB=${CURL_STATICLIB} @@ -133,6 +130,7 @@ if(EXISTS "${CURRENT_PACKAGES_DIR}/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") diff --git a/ports/curl/vcpkg-cmake-wrapper.cmake b/ports/curl/vcpkg-cmake-wrapper.cmake index 955d9353ac..526cb515c2 100644 --- a/ports/curl/vcpkg-cmake-wrapper.cmake +++ b/ports/curl/vcpkg-cmake-wrapper.cmake @@ -1,14 +1,16 @@ -list(REMOVE_ITEM ARGS "NO_MODULE") -list(REMOVE_ITEM ARGS "CONFIG") -list(REMOVE_ITEM ARGS "MODULE") - +cmake_policy(PUSH) cmake_policy(SET CMP0012 NEW) +cmake_policy(SET CMP0054 NEW) +cmake_policy(SET CMP0057 NEW) +if(NOT CMAKE_VERSION VERSION_LESS 3.14 AND COMPONENTS IN_LIST ARGS) + include("${CMAKE_CURRENT_LIST_DIR}/CURLConfigComponents.cmake") +endif() + +list(REMOVE_ITEM ARGS "NO_MODULE" "CONFIG" "MODULE") _find_package(${ARGS} CONFIG) -if(TARGET CURL::libcurl) - set(CURL_FOUND TRUE) - +if(CURL_FOUND) get_target_property(_curl_include_dirs CURL::libcurl INTERFACE_INCLUDE_DIRECTORIES) get_target_property(_curl_link_libraries CURL::libcurl INTERFACE_LINK_LIBRARIES) @@ -23,7 +25,11 @@ if(TARGET CURL::libcurl) endif() if(NOT _curl_link_libraries) - set(_curl_link_libraries) + set(_curl_link_libraries "") + endif() + + if("Libssh2::libssh2" IN_LIST _curl_link_libraries) + find_package(Libssh2 CONFIG QUIET) endif() set(CURL_INCLUDE_DIRS "${_curl_include_dirs}") @@ -37,8 +43,9 @@ if(TARGET CURL::libcurl) set(CURL_LIBRARIES ${CURL_LIBRARY} ${_curl_link_libraries}) set(CURL_VERSION_STRING "${CURL_VERSION}") - set(_curl_include_dirs) - set(_curl_link_libraries) - set(_curl_location_debug) - set(_curl_location_release) + unset(_curl_include_dirs) + unset(_curl_link_libraries) + unset(_curl_location_debug) + unset(_curl_location_release) endif() +cmake_policy(POP) diff --git a/ports/curl/vcpkg.json b/ports/curl/vcpkg.json index 63879df0f7..b0ae1b87cc 100644 --- a/ports/curl/vcpkg.json +++ b/ports/curl/vcpkg.json @@ -1,6 +1,6 @@ { "name": "curl", - "version": "7.80.0", + "version": "7.81.0", "description": "A library for transferring data with URLs", "homepage": "https://github.com/curl/curl", "dependencies": [ @@ -68,11 +68,7 @@ "idn2": { "description": "idn2 support (libidn2)", "dependencies": [ - "libidn2", - { - "name": "vcpkg-pkgconfig-get-modules", - "host": true - } + "libidn2" ] }, "mbedtls": { diff --git a/ports/libidn2/CMakeLists.txt b/ports/libidn2/CMakeLists.txt index f8e0908f41..f7616962cc 100644 --- a/ports/libidn2/CMakeLists.txt +++ b/ports/libidn2/CMakeLists.txt @@ -111,7 +111,12 @@ set(prefix "\${pcfiledir}/../..") set(exec_prefix "\${prefix}") set(includedir "\${prefix}/include") set(libdir "\${prefix}/lib") -set(LTLIBICONV "") +set(LTLIBICONV "-liconv -lcharset") set(LTLIBUNISTRING "") -configure_file("libidn2.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libidn2.pc") +configure_file("libidn2.pc.in" "${CMAKE_CURRENT_BINARY_DIR}/libidn2.pc" @ONLY) +if(WIN32 AND NOT MINGW) + file(READ "${CMAKE_CURRENT_BINARY_DIR}/libidn2.pc" pc_data) + string(REPLACE " -lidn" " -llibidn" pc_data "${pc_data}") + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/libidn2.pc" "${pc_data}") +endif() install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libidn2.pc" DESTINATION "lib/pkgconfig") diff --git a/ports/libidn2/portfile.cmake b/ports/libidn2/portfile.cmake index f9ffcae787..9f34d68e52 100644 --- a/ports/libidn2/portfile.cmake +++ b/ports/libidn2/portfile.cmake @@ -23,7 +23,7 @@ if (VCPKG_TARGET_IS_WINDOWS) function(simple_copy_template_header FILE_PATH BASE_NAME) if(NOT EXISTS "${FILE_PATH}/${BASE_NAME}.h" AND EXISTS "${FILE_PATH}/${BASE_NAME}.in.h") - configure_file("${FILE_PATH}/${BASE_NAME}.in.h" "${FILE_PATH}/${BASE_NAME}.h") + configure_file("${FILE_PATH}/${BASE_NAME}.in.h" "${FILE_PATH}/${BASE_NAME}.h" @ONLY) endif() endfunction() diff --git a/ports/libidn2/vcpkg.json b/ports/libidn2/vcpkg.json index 9c00c1b155..0009e12943 100644 --- a/ports/libidn2/vcpkg.json +++ b/ports/libidn2/vcpkg.json @@ -1,19 +1,19 @@ { "name": "libidn2", "version": "2.3.0", - "port-version": 4, + "port-version": 5, "description": "GNU Libidn is an implementation of the Stringprep, Punycode and IDNA 2003 specifications. Libidn's purpose is to encode and decode internationalized domain names.", "homepage": "https://www.gnu.org/software/libidn/", "dependencies": [ "libiconv", { "name": "libunistring", - "platform": "!(windows | mingw)" + "platform": "!windows" }, { "name": "vcpkg-cmake", "host": true, - "platform": "windows | mingw" + "platform": "windows" } ] } diff --git a/versions/baseline.json b/versions/baseline.json index 010de5a168..4495766015 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1701,7 +1701,7 @@ "port-version": 7 }, "curl": { - "baseline": "7.80.0", + "baseline": "7.81.0", "port-version": 0 }, "curlpp": { @@ -3574,7 +3574,7 @@ }, "libidn2": { "baseline": "2.3.0", - "port-version": 4 + "port-version": 5 }, "libigl": { "baseline": "2.3.0", diff --git a/versions/c-/curl.json b/versions/c-/curl.json index a73767ce63..4bada56f71 100644 --- a/versions/c-/curl.json +++ b/versions/c-/curl.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "30162d8bfeb7628fb397969fc95e379705a52509", + "version": "7.81.0", + "port-version": 0 + }, { "git-tree": "8e13da05c975cb6f5bed6cf3b8054a817a00b45d", "version": "7.80.0", diff --git a/versions/l-/libidn2.json b/versions/l-/libidn2.json index 47fb7c9c67..c795bbc12a 100644 --- a/versions/l-/libidn2.json +++ b/versions/l-/libidn2.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "b1eb568bf3bdf3fdb6e04b69f62f0347f2dff2ed", + "version": "2.3.0", + "port-version": 5 + }, { "git-tree": "a73dca27190e239f6ff09db7124b885a23d732e4", "version": "2.3.0",