Skip to content

Commit

Permalink
Upgraded to curl/8.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
negrutiu committed Sep 18, 2024
1 parent 978524e commit f491ce1
Show file tree
Hide file tree
Showing 9 changed files with 110 additions and 138 deletions.
8 changes: 4 additions & 4 deletions vcpkg/overlay_ports/curl/0020-fix-pc-file.patch
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a2128e..e9c9c92 100644
index 7242d68..da69699 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1662,7 +1662,9 @@ if(NOT CURL_DISABLE_INSTALL)
@@ -1918,7 +1918,9 @@ if(NOT CURL_DISABLE_INSTALL)
endif()
endforeach()

- foreach(_lib ${CMAKE_C_IMPLICIT_LINK_LIBRARIES} ${CURL_LIBS})
- foreach(_lib IN LISTS CMAKE_C_IMPLICIT_LINK_LIBRARIES CURL_LIBS)
+ set(CURL_LIBS_FLAT "")
+ vcpkg_curl_flatten(CURL_LIBS CURL_LIBS_FLAT)
+ foreach(_lib ${CURL_LIBS_FLAT})
+ foreach(_lib IN LISTS CURL_LIBS_FLAT)
if(TARGET "${_lib}")
set(_libname "${_lib}")
get_target_property(_imported "${_libname}" IMPORTED)
18 changes: 9 additions & 9 deletions vcpkg/overlay_ports/curl/0022-deduplicate-libs.patch
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bb6ccf1..a0df85f 100644
index da69699..3a9b844 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1913,8 +1913,10 @@ if(NOT CURL_DISABLE_INSTALL)
set(CPPFLAG_CURL_STATICLIB "")
@@ -2042,8 +2042,10 @@ if(NOT CURL_DISABLE_INSTALL)
set(LIBCURL_PC_CFLAGS "")
else()
set(ENABLE_SHARED "no")
+ set(LIBCURL_PC_REQUIRES_PRIVATE "") # flattened into LIBCURL_LIBS
set(LIBCURL_PC_REQUIRES "${LIBCURL_PC_REQUIRES_PRIVATE}")
set(LIBCURL_NO_SHARED "${LIBCURL_LIBS}")
+ set(LIBCURL_LIBS "")
set(CPPFLAG_CURL_STATICLIB "-DCURL_STATICLIB")
set(ENABLE_SHARED "no")
+ set(LIBCURL_PC_REQUIRES_PRIVATE "") # flattened into LIBCURL_PC_LIBS
set(LIBCURL_PC_REQUIRES "${LIBCURL_PC_REQUIRES_PRIVATE}")
set(LIBCURL_PC_LIBS "${LIBCURL_PC_LIBS_PRIVATE}")
+ set(LIBCURL_PC_LIBS_PRIVATE "") # in LIBCURL_PC_LIBS
set(LIBCURL_PC_CFLAGS "${LIBCURL_PC_CFLAGS_PRIVATE}")
endif()
if(BUILD_STATIC_LIBS)
152 changes: 78 additions & 74 deletions vcpkg/overlay_ports/curl/dependencies.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in
index 2ce8625..a0c039c 100644
index 7dc1f99..e83617e 100644
--- a/CMake/curl-config.cmake.in
+++ b/CMake/curl-config.cmake.in
@@ -31,6 +31,19 @@ if(@USE_ZLIB@)
@@ -39,6 +39,19 @@ if(@USE_ZLIB@)
find_dependency(ZLIB @ZLIB_VERSION_MAJOR@)
endif()

Expand All @@ -23,21 +23,45 @@ index 2ce8625..a0c039c 100644
check_required_components("@PROJECT_NAME@")

diff --git a/CMakeLists.txt b/CMakeLists.txt
index f9a775a..415206c 100644
index dbb0bf4..f1a18d1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -163,7 +163,8 @@ set(LIBCURL_PC_REQUIRES_PRIVATE "")
@@ -234,7 +234,9 @@ set(LIBCURL_PC_REQUIRES_PRIVATE "")

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})
- find_package(Cares REQUIRED)
+ find_package(CARES NAMES c-ares REQUIRED)
+ set(CARES_INCLUDE_DIRS "")
+ set(CARES_LIBRARIES c-ares::cares)
list(APPEND CURL_LIBS ${CARES_LIBRARIES})
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libcares")
add_definitions("-DCARES_NO_DEPRECATED") # Ignore c-ares deprecation warnings
@@ -611,17 +613,11 @@ if(CURL_USE_WOLFSSL)
endif()
@@ -591,7 +592,9 @@ endif()
option(CURL_BROTLI "Set to ON to enable building curl with brotli support." OFF)

if(CURL_USE_GNUTLS)
- if(CURL_USE_PKGCONFIG)
- find_package(PkgConfig QUIET)
- pkg_check_modules(GNUTLS "gnutls")
- if(GNUTLS_FOUND)
- set(GNUTLS_LIBRARIES ${GNUTLS_LINK_LIBRARIES})
- endif()
- endif()
- if(NOT GNUTLS_FOUND)
- find_package(GnuTLS REQUIRED)
- endif()
- find_package(Nettle REQUIRED)
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(GNUTLS REQUIRED gnutls)
+ set(GNUTLS_LIBRARIES "${GNUTLS_LINK_LIBRARIES}")
+ pkg_check_modules(NETTLE REQUIRED nettle)
+ set(NETTLE_LIBRARIES "${NETTLE_LINK_LIBRARIES}")
set(_ssl_enabled ON)
set(USE_GNUTLS ON)
list(APPEND CURL_LIBS ${GNUTLS_LIBRARIES} ${NETTLE_LIBRARIES})
@@ -685,7 +681,9 @@ endif()
option(CURL_BROTLI "Use brotli" OFF)
set(HAVE_BROTLI OFF)
if(CURL_BROTLI)
- find_package(Brotli REQUIRED)
Expand All @@ -47,101 +71,81 @@ index f9a775a..415206c 100644
if(BROTLI_FOUND)
set(HAVE_BROTLI ON)
list(APPEND CURL_LIBS ${BROTLI_LIBRARIES})
@@ -604,7 +607,9 @@ endif()
option(CURL_ZSTD "Set to ON to enable building curl with zstd support." OFF)
@@ -698,7 +696,9 @@ endif()
option(CURL_ZSTD "Use zstd" OFF)
set(HAVE_ZSTD OFF)
if(CURL_ZSTD)
- find_package(Zstd REQUIRED)
+ find_package(Zstd NAMES zstd REQUIRED)
+ set(Zstd_INCLUDE_DIRS "")
+ set(Zstd_LIBRARIES zstd::libzstd)
if(Zstd_FOUND AND NOT Zstd_VERSION VERSION_LESS "1.0.0")
+ find_package(ZSTD NAMES zstd REQUIRED)
+ set(ZSTD_INCLUDE_DIRS "")
+ set(ZSTD_LIBRARIES zstd::libzstd)
if(ZSTD_FOUND AND NOT ZSTD_VERSION VERSION_LESS 1.0.0)
set(HAVE_ZSTD ON)
list(APPEND CURL_LIBS ${Zstd_LIBRARIES})
@@ -913,8 +918,12 @@ endif()
# Check for idn2
option(USE_LIBIDN2 "Use libidn2 for IDN support" ON)
if(USE_LIBIDN2)
- check_library_exists("idn2" "idn2_lookup_ul" "" HAVE_LIBIDN2)
list(APPEND CURL_LIBS ${ZSTD_LIBRARIES})
@@ -1033,7 +1033,9 @@ option(USE_LIBIDN2 "Use libidn2 for IDN support" ON)
set(HAVE_IDN2_H OFF)
set(HAVE_LIBIDN2 OFF)
if(USE_LIBIDN2 AND NOT USE_APPLE_IDN AND NOT USE_WIN32_IDN)
- find_package(Libidn2)
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(LIBIDN2 REQUIRED libidn2)
+ set(HAVE_LIBIDN2 TRUE)
if(HAVE_LIBIDN2)
+ set(HAVE_IDN2_H TRUE)
+ elseif(0)
set(LIBIDN2_LINK_LIBRARIES "idn2")
check_include_file_concat("idn2.h" HAVE_IDN2_H)
endif()
@@ -963,12 +972,19 @@ mark_as_advanced(CURL_USE_LIBPSL)
+ set(LIBIDN2_LIBRARIES "${LIBIDN2_LINK_LIBRARIES}")
if(LIBIDN2_FOUND)
set(CURL_LIBS "${LIBIDN2_LIBRARIES};${CURL_LIBS}")
list(APPEND CURL_LIBDIRS ${LIBIDN2_LIBRARY_DIRS})
@@ -1054,7 +1056,17 @@ mark_as_advanced(CURL_USE_LIBPSL)
set(USE_LIBPSL OFF)

if(CURL_USE_LIBPSL)
- find_package(LibPSL)
- find_package(Libpsl) # TODO: add REQUIRED to match autotools
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(LIBPSL REQUIRED libpsl)
+ # Remove standard win32 libs pulled in transitively from icu
+ string(REPLACE " " "|" win32_standard_libraries "/(${CMAKE_C_STANDARD_LIBRARIES})[.]lib\$")
+ foreach(lib IN LISTS LIBPSL_LINK_LIBRARIES)
+ string(TOLOWER "${lib}" lib_lower)
+ if(lib_lower MATCHES win32_standard_libraries)
+ list(REMOVE_ITEM LIBPSL_LINK_LIBRARIES "${lib}")
+ endif()
+ endforeach()
+ set(LIBPSL_LIBRARIES "${LIBPSL_LINK_LIBRARIES}")
if(LIBPSL_FOUND)
- list(APPEND CURL_LIBS ${LIBPSL_LIBRARY})
+ # Remove standard win32 libs pulled in transitively from icu
+ string(REPLACE " " "|" win32_standard_libraries "/(${CMAKE_C_STANDARD_LIBRARIES})[.]lib\$")
+ foreach(lib IN LISTS LIBPSL_LINK_LIBRARIES)
+ string(TOLOWER "${lib}" lib_lower)
+ if(lib_lower MATCHES win32_standard_libraries)
+ list(REMOVE_ITEM LIBPSL_LINK_LIBRARIES "${lib}")
+ endif()
+ endforeach()
+ list(APPEND CURL_LIBS ${LIBPSL_LINK_LIBRARIES})
list(APPEND CURL_LIBS ${LIBPSL_LIBRARIES})
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libpsl")
- list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBPSL_INCLUDE_DIR}")
- include_directories("${LIBPSL_INCLUDE_DIR}")
set(USE_LIBPSL ON)
endif()
endif()
@@ -979,7 +995,13 @@ mark_as_advanced(CURL_USE_LIBSSH2)
@@ -1072,7 +1084,13 @@ mark_as_advanced(CURL_USE_LIBSSH2)
set(USE_LIBSSH2 OFF)

if(CURL_USE_LIBSSH2)
- find_package(LibSSH2)
- find_package(Libssh2)
+ find_package(LIBSSH2 NAMES Libssh2 REQUIRED)
+ if(TARGET Libssh2::libssh2_shared)
+ set(LIBSSH2_LIBRARY Libssh2::libssh2_shared)
+ set(LIBSSH2_LIBRARIES Libssh2::libssh2_shared)
+ else()
+ set(LIBSSH2_LIBRARY Libssh2::libssh2_static)
+ set(LIBSSH2_LIBRARIES Libssh2::libssh2_static)
+ endif()
+ get_target_property(LIBSSH2_INCLUDE_DIR "${LIBSSH2_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES)
+ get_target_property(LIBSSH2_INCLUDE_DIRS "${LIBSSH2_LIBRARIES}" INTERFACE_INCLUDE_DIRECTORIES)
if(LIBSSH2_FOUND)
list(APPEND CURL_LIBS ${LIBSSH2_LIBRARY})
list(APPEND CURL_LIBS ${LIBSSH2_LIBRARIES})
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libssh2")
@@ -1012,11 +1034,24 @@ if(CURL_USE_GSASL)
set(USE_GSASL ON)
endif()

+option(CURL_USE_GSASL "Use GSASL implementation" OFF)
+mark_as_advanced(CURL_USE_GSASL)
+if(CURL_USE_GSASL)
@@ -1121,7 +1139,8 @@ endif()
option(CURL_USE_GSASL "Use libgsasl" OFF)
mark_as_advanced(CURL_USE_GSASL)
if(CURL_USE_GSASL)
- find_package(Libgsasl REQUIRED)
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(GSASL REQUIRED libgsasl)
+ list(APPEND CURL_LIBS ${GSASL_LINK_LIBRARIES})
+ set(USE_GSASL ON)
+endif()
+
option(CURL_USE_GSSAPI "Use GSSAPI implementation (right now only Heimdal is supported with CMake build)" OFF)
if(LIBGSASL_FOUND)
list(APPEND CURL_LIBS ${LIBGSASL_LIBRARIES})
list(APPEND CURL_LIBDIRS ${LIBGSASL_LIBRARY_DIRS})
@@ -1139,7 +1158,10 @@ option(CURL_USE_GSSAPI "Use GSSAPI implementation" OFF)
mark_as_advanced(CURL_USE_GSSAPI)

if(CURL_USE_GSSAPI)
- find_package(GSS)
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(GSS REQUIRED krb5-gssapi)
+ list(APPEND CURL_LIBS ${GSS_LINK_LIBRARIES})
+ list(APPEND CURL_LIBS resolv) # Fixme: move to krb5 pc files
+ pkg_get_variable(GSS_FLAVOUR krb5-gssapi vendor)
+ list(APPEND GSS_LINK_LIBRARIES resolv) # Fixme: move to krb5 pc files

set(HAVE_GSSAPI ${GSS_FOUND})
if(GSS_FOUND)
@@ -1028,6 +1063,7 @@ if(CURL_USE_GSSAPI)
check_include_file_concat("gssapi/gssapi_generic.h" HAVE_GSSAPI_GSSAPI_GENERIC_H)
check_include_file_concat("gssapi/gssapi_krb5.h" HAVE_GSSAPI_GSSAPI_KRB5_H)

+ elseif(0)
if(NOT GSS_FLAVOUR STREQUAL "Heimdal")
# MIT
set(_INCLUDE_LIST "")
12 changes: 6 additions & 6 deletions vcpkg/overlay_ports/curl/export-components.patch
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3820c2d..f9a775a 100644
index 3a9b844..cd7263d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1952,7 +1952,17 @@ if(NOT CURL_DISABLE_INSTALL)
)
@@ -2044,7 +2044,17 @@ if(NOT CURL_DISABLE_INSTALL)
DESTINATION ${CURL_INSTALL_CMAKE_DIR})
endif()

+ set(components_file "${CMAKE_CURRENT_BINARY_DIR}/CURLConfigComponents.cmake")
Expand All @@ -15,8 +15,8 @@ index 3820c2d..f9a775a 100644
+ endforeach()
+ ]] @ONLY)
+
install(FILES ${version_config} ${project_config}
install(FILES ${_version_config} ${_project_config}
+ ${components_file}
DESTINATION ${CURL_INSTALL_CMAKE_DIR}
)
DESTINATION ${CURL_INSTALL_CMAKE_DIR})

# Workaround for MSVS10 to avoid the Dialog Hell
20 changes: 0 additions & 20 deletions vcpkg/overlay_ports/curl/gnutls.patch

This file was deleted.

10 changes: 5 additions & 5 deletions vcpkg/overlay_ports/curl/nscurl/curl_ftruncate_CMakeLists.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1395,3 +1395,3 @@
check_symbol_exists(eventfd "${CURL_INCLUDES};sys/eventfd.h" HAVE_EVENTFD)
-check_symbol_exists(ftruncate "${CURL_INCLUDES}" HAVE_FTRUNCATE)
+# check_symbol_exists(ftruncate "${CURL_INCLUDES}" HAVE_FTRUNCATE) # nscurl: The mingw-x64 implementation of ftruncate() calls FindFirstVolume/FindNextVolume/GetFileSizeEx, unavailable in NT4
check_symbol_exists(_fseeki64 "${CURL_INCLUDES};stdio.h" HAVE__FSEEKI64)
@@ -1534,3 +1534,3 @@
check_symbol_exists("eventfd" "${CURL_INCLUDES};sys/eventfd.h" HAVE_EVENTFD)
-check_symbol_exists("ftruncate" "${CURL_INCLUDES}" HAVE_FTRUNCATE)
+#check_symbol_exists(ftruncate "${CURL_INCLUDES}" HAVE_FTRUNCATE) # nscurl: The mingw-x64 implementation of ftruncate() calls FindFirstVolume/FindNextVolume/GetFileSizeEx, unavailable in NT4
check_symbol_exists("_fseeki64" "${CURL_INCLUDES};stdio.h" HAVE__FSEEKI64)
19 changes: 4 additions & 15 deletions vcpkg/overlay_ports/curl/nscurl/curl_xprequirement.diff
Original file line number Diff line number Diff line change
@@ -1,19 +1,8 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a54c2fff9..06477f794 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1089,10 +1089,10 @@ if(WIN32)
unset(HAVE_WIN32_WINNT CACHE)

if(HAVE_WIN32_WINNT)
- if(HAVE_WIN32_WINNT STRLESS "0x0501")
- # Windows XP is required for freeaddrinfo, getaddrinfo
@@ -1399,3 +1399,3 @@
# Windows XP is required for freeaddrinfo, getaddrinfo
- message(FATAL_ERROR "Building for Windows XP or newer is required.")
- endif()
+ # if(HAVE_WIN32_WINNT STRLESS "0x0501")
+ # # Windows XP is required for freeaddrinfo, getaddrinfo
+ # message(FATAL_ERROR "Building for Windows XP or newer is required.")
+ # endif()

# pre-fill detection results based on target OS version
if(MINGW OR MSVC)
+ # message(FATAL_ERROR "Building for Windows XP or newer is required.") # nscurl: This statement is incorrect. We can use *addrinfo on platforms older than XP
endif()
6 changes: 3 additions & 3 deletions vcpkg/overlay_ports/curl/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ string(REPLACE "." "_" curl_version "curl-${VERSION}")
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO curl/curl
REF "${curl_version}"
SHA512 f5c425c3fbd7bfda13137e8e9bc969ed7dc94c5bfcf0681a2358ab7d3b5d10402781a93385255a80c402c9824aeb97d70213b412f2d208dee4abdba5bbed2ca4
REF ${curl_version}
SHA512 76fa90942baf892c9ae1e3990f4539f90706d69d5134aef0ff14025d9a7c086cb549f72315a2c5c45682dbabb06c530b7b24f64fd824936c2aca6ba137a367f1
HEAD_REF master
PATCHES
0005_remove_imp_suffix.patch
Expand All @@ -13,7 +13,6 @@ vcpkg_from_github(
export-components.patch
dependencies.patch
cmake-config.patch
gnutls.patch
nscurl/curl_ftruncate_CMakeLists.patch # nscurl: mingw-x64 implementation of ftruncate() calls FindFirstVolume/FindNextVolume/GetFileSizeEx, unavailable in NT4
nscurl/curl_ftruncate_config-win32.patch
nscurl/curl_ftruncate_WindowsCache.patch
Expand Down Expand Up @@ -108,6 +107,7 @@ vcpkg_cmake_configure(
-DBUILD_TESTING=OFF
-DENABLE_CURL_MANUAL=OFF
-DCURL_CA_FALLBACK=ON
-DCURL_USE_PKGCONFIG=OFF
-DCMAKE_DISABLE_FIND_PACKAGE_Perl=ON
OPTIONS_DEBUG
-DENABLE_DEBUG=ON
Expand Down
3 changes: 1 addition & 2 deletions vcpkg/overlay_ports/curl/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"name": "curl",
"version": "8.9.1",
"port-version": 1,
"version": "8.10.0",
"description": "A library for transferring data with URLs",
"homepage": "https://curl.se/",
"license": "curl AND ISC AND BSD-3-Clause",
Expand Down

0 comments on commit f491ce1

Please sign in to comment.