diff --git a/ports/curl/0023-fix-find-cares.patch b/ports/curl/0023-fix-find-cares.patch deleted file mode 100644 index 4aa11acfa1c6e7..00000000000000 --- a/ports/curl/0023-fix-find-cares.patch +++ /dev/null @@ -1,29 +0,0 @@ -diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in -index 496a92d0e..564415ef6 100644 ---- a/CMake/curl-config.cmake.in -+++ b/CMake/curl-config.cmake.in -@@ -30,6 +30,9 @@ endif() - if(@USE_ZLIB@) - find_dependency(ZLIB @ZLIB_VERSION_MAJOR@) - endif() -+if(@USE_ARES@) -+ find_dependency(c-ares) -+endif() - - include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake") - check_required_components("@PROJECT_NAME@") -diff --git a/CMakeLists.txt b/CMakeLists.txt -index b43520751..dbf62751f 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -169,8 +169,8 @@ set(CURL_LIBS "") - - if(ENABLE_ARES) - set(USE_ARES 1) -- find_package(CARES REQUIRED) -- list(APPEND CURL_LIBS ${CARES_LIBRARY}) -+ find_package(c-ares CONFIG REQUIRED) -+ list(APPEND CURL_LIBS c-ares::cares) - endif() - - include(CurlSymbolHiding) diff --git a/ports/curl/cmake-project-include.cmake b/ports/curl/cmake-project-include.cmake index 27254864c20ce2..c43df547fc8f5d 100644 --- a/ports/curl/cmake-project-include.cmake +++ b/ports/curl/cmake-project-include.cmake @@ -13,6 +13,7 @@ function(vcpkg_curl_flatten input output) list(REMOVE_AT input_libs 0) while(input_libs) list(POP_BACK input_libs lib) + string(REGEX REPLACE "^.\$" "\\1" lib "${lib}") if(TARGET "${lib}") set(import_lib "") set(import_location "") @@ -69,13 +70,6 @@ function(vcpkg_curl_flatten input output) 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) diff --git a/ports/curl/dependencies.patch b/ports/curl/dependencies.patch new file mode 100644 index 00000000000000..8999a367e8bbaf --- /dev/null +++ b/ports/curl/dependencies.patch @@ -0,0 +1,60 @@ +diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in +index dbe4ed2..267108e 100644 +--- a/CMake/curl-config.cmake.in ++++ b/CMake/curl-config.cmake.in +@@ -30,6 +30,15 @@ endif() + if(@USE_ZLIB@) + find_dependency(ZLIB @ZLIB_VERSION_MAJOR@) + endif() ++if("@USE_ARES@") ++ find_dependency(c-ares CONFIG) ++endif() ++if("@USE_LIBSSH2@") ++ find_dependency(Libssh2 CONFIG) ++endif() ++if("@HAVE_BROTLI@") ++ find_dependency(unofficial-brotli CONFIG) ++endif() + + include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake") + check_required_components("@PROJECT_NAME@") +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 42c9ae4..8c42d91 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -149,7 +149,8 @@ set(CURL_LIBS "") + + if(ENABLE_ARES) + set(USE_ARES 1) +- find_package(CARES REQUIRED) ++ find_package(CARES NAMES c-ares CONFIG REQUIRED) ++ set(CARES_LIBRARY c-ares::cares) + list(APPEND CURL_LIBS ${CARES_LIBRARY}) + endif() + +@@ -522,7 +523,9 @@ endif() + option(CURL_BROTLI "Set to ON to enable building curl with brotli support." OFF) + set(HAVE_BROTLI OFF) + if(CURL_BROTLI) +- find_package(Brotli QUIET) ++ find_package(BROTLI NAMES unofficial-brotli REQUIRED) ++ set(BROTLI_INCLUDE_DIRS "") ++ set(BROTLI_LIBRARIES "unofficial::brotli::brotlidec") + if(BROTLI_FOUND) + set(HAVE_BROTLI ON) + set(CURL_LIBS "${BROTLI_LIBRARIES};${CURL_LIBS}") # For 'ld' linker. Emulate `list(PREPEND ...)` to stay compatible with )?" "${OPENSSL_LIBRARIES}" _curl_link_libraries "${_curl_link_libraries}") endif() - if(_curl_link_libraries MATCHES "Libssh2::libssh2") + if(_curl_link_libraries MATCHES "Libssh2::libssh2_(shared|static)") # TODO: move find_dependency(Libssh2 CONFIG) into CURL config + set(_libssh2_target "${CMAKE_MATCH_0}") find_package(Libssh2 CONFIG QUIET) - get_target_property(_libssh2_LIBRARY_DEBUG Libssh2::libssh2 IMPORTED_IMPLIB_DEBUG) - get_target_property(_libssh2_LIBRARY_RELEASE Libssh2::libssh2 IMPORTED_IMPLIB_RELEASE) + get_target_property(_libssh2_LIBRARY_DEBUG "${_libssh2_target}" IMPORTED_IMPLIB_DEBUG) + get_target_property(_libssh2_LIBRARY_RELEASE "${_libssh2_target}" IMPORTED_IMPLIB_RELEASE) if(NOT IMPORTED_IMPLIB_DEBUG AND NOT IMPORTED_IMPLIB_RELEASE) - get_target_property(_libssh2_LIBRARY_DEBUG Libssh2::libssh2 IMPORTED_LOCATION_DEBUG) - get_target_property(_libssh2_LIBRARY_RELEASE Libssh2::libssh2 IMPORTED_LOCATION_RELEASE) + get_target_property(_libssh2_LIBRARY_DEBUG "${_libssh2_target}" IMPORTED_LOCATION_DEBUG) + get_target_property(_libssh2_LIBRARY_RELEASE "${_libssh2_target}" IMPORTED_LOCATION_RELEASE) endif() select_library_configurations(_libssh2) - string(REGEX REPLACE "([\$]<[^;]*)?Libssh2::libssh2([^;]*>)?" "${_libssh2_LIBRARIES}" _curl_link_libraries "${_curl_link_libraries}") + string(REGEX REPLACE "([\$]<[^;]*)?${_libssh2_target}([^;]*>)?" "${_libssh2_LIBRARIES}" _curl_link_libraries "${_curl_link_libraries}") unset(_libssh2_LIBRARIES) unset(_libssh2_LIBRARY_DEBUG) unset(_libssh2_LIBRARY_RELEASE) + unset(_libssh2_target) endif() if(_curl_link_libraries MATCHES "::") message(WARNING "CURL_LIBRARIES list at least one target. This will not work for use cases where targets are not resolved.") diff --git a/ports/curl/vcpkg.json b/ports/curl/vcpkg.json index 0a08a1a9d21c37..78f11d53d8b53e 100644 --- a/ports/curl/vcpkg.json +++ b/ports/curl/vcpkg.json @@ -1,6 +1,7 @@ { "name": "curl", "version": "8.1.2", + "port-version": 1, "description": "A library for transferring data with URLs", "homepage": "https://curl.se/", "license": null, diff --git a/versions/baseline.json b/versions/baseline.json index c9bbb3ea12a7ce..81fbec8b9fcd65 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -1954,7 +1954,7 @@ }, "curl": { "baseline": "8.1.2", - "port-version": 0 + "port-version": 1 }, "curlpp": { "baseline": "2018-06-15", diff --git a/versions/c-/curl.json b/versions/c-/curl.json index 3f36e6a8a9c03b..ba17a0c9fb0c32 100644 --- a/versions/c-/curl.json +++ b/versions/c-/curl.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "7d8ee40552d5b1c103d52b2b28d9577cb45e2593", + "version": "8.1.2", + "port-version": 1 + }, { "git-tree": "b70ded19f70e4b198d8c3f844324c7884d3faa7d", "version": "8.1.2",