Skip to content

Commit

Permalink
Upgraded to curl/8.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
negrutiu committed Aug 2, 2024
1 parent 176c062 commit 1723b66
Show file tree
Hide file tree
Showing 10 changed files with 84 additions and 118 deletions.
7 changes: 5 additions & 2 deletions vcpkg/overlay_ports/curl/0022-deduplicate-libs.patch
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0ceaf5b..ec714a5 100644
index bb6ccf1..a0df85f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1682,6 +1682,7 @@ if(NOT CURL_DISABLE_INSTALL)
@@ -1913,8 +1913,10 @@ if(NOT CURL_DISABLE_INSTALL)
set(CPPFLAG_CURL_STATICLIB "")
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")
Expand Down
10 changes: 7 additions & 3 deletions vcpkg/overlay_ports/curl/cmake-project-include.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ endif()
# Use -l where possible.
# Avoid duplicates.
function(vcpkg_curl_flatten input output)
foreach(var IN ITEMS IMPORT_LIBRARY_SUFFIX STATIC_LIBRARY_SUFFIX SHARED_LIBRARY_SUFFIX)
string(REPLACE "." "[.]" "${var}" "${CMAKE_${var}}")
endforeach()

set(output_libs "${${output}}")
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
string(REGEX REPLACE ";optimized;[^;]*|;debug" "" input_libs "VCPKG;${${input}}")
Expand Down Expand Up @@ -67,11 +71,11 @@ function(vcpkg_curl_flatten input output)
else()
set(lib "-framework ${lib}")
endif()
elseif(WIN32 AND lib MATCHES ".*/${CMAKE_IMPORT_LIBRARY_PREFIX}([^/]*)${CMAKE_IMPORT_LIBRARY_SUFFIX}")
elseif(WIN32 AND lib MATCHES ".*/${CMAKE_IMPORT_LIBRARY_PREFIX}([^/]*)${IMPORT_LIBRARY_SUFFIX}\$")
set(lib -l${CMAKE_MATCH_1})
elseif(lib MATCHES ".*/${CMAKE_STATIC_LIBRARY_PREFIX}([^/]*)${CMAKE_STATIC_LIBRARY_SUFFIX}")
elseif(lib MATCHES ".*/${CMAKE_STATIC_LIBRARY_PREFIX}([^/]*)${STATIC_LIBRARY_SUFFIX}\$")
set(lib -l${CMAKE_MATCH_1})
elseif(lib MATCHES ".*/${CMAKE_SHARED_LIBRARY_PREFIX}([^/]*)${CMAKE_SHARED_LIBRARY_SUFFIX}")
elseif(lib MATCHES ".*/${CMAKE_SHARED_LIBRARY_PREFIX}([^/]*)${SHARED_LIBRARY_SUFFIX}\$")
set(lib -l${CMAKE_MATCH_1})
endif()
if(NOT "${lib}" IN_LIST output_libs)
Expand Down
68 changes: 17 additions & 51 deletions vcpkg/overlay_ports/curl/dependencies.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in
index 9adb96e0a..9bf69004d 100644
index 2ce8625..a0c039c 100644
--- a/CMake/curl-config.cmake.in
+++ b/CMake/curl-config.cmake.in
@@ -31,6 +31,19 @@ if(@USE_ZLIB@)
Expand All @@ -23,29 +23,20 @@ index 9adb96e0a..9bf69004d 100644
check_required_components("@PROJECT_NAME@")

diff --git a/CMakeLists.txt b/CMakeLists.txt
index c3525d3fc..1927464e8 100644
index f9a775a..415206c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -164,7 +164,8 @@ set(CURL_LIBS "")
@@ -163,7 +163,8 @@ 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})
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libcares")
endif()

@@ -461,7 +462,7 @@ if(use_core_foundation_and_core_services)
message(FATAL_ERROR "CoreServices framework not found")
endif()

- list(APPEND CURL_LIBS "-framework CoreFoundation -framework CoreServices")
+ list(APPEND CURL_LIBS "-framework CoreFoundation" "-framework CoreServices")
endif()

if(CURL_USE_OPENSSL)
@@ -577,10 +578,11 @@ endif()
@@ -591,7 +592,9 @@ endif()
option(CURL_BROTLI "Set to ON to enable building curl with brotli support." OFF)
set(HAVE_BROTLI OFF)
if(CURL_BROTLI)
Expand All @@ -55,11 +46,8 @@ index c3525d3fc..1927464e8 100644
+ 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 <v3.15 CMake.
list(APPEND CURL_LIBS ${BROTLI_LIBRARIES})
include_directories(${BROTLI_INCLUDE_DIRS})
list(APPEND CMAKE_REQUIRED_INCLUDES ${BROTLI_INCLUDE_DIRS})
@@ -590,7 +592,9 @@ endif()
@@ -604,7 +607,9 @@ endif()
option(CURL_ZSTD "Set to ON to enable building curl with zstd support." OFF)
set(HAVE_ZSTD OFF)
if(CURL_ZSTD)
Expand All @@ -70,7 +58,7 @@ index c3525d3fc..1927464e8 100644
if(Zstd_FOUND AND NOT Zstd_VERSION VERSION_LESS "1.0.0")
set(HAVE_ZSTD ON)
list(APPEND CURL_LIBS ${Zstd_LIBRARIES})
@@ -883,8 +887,13 @@ endif()
@@ -913,8 +918,12 @@ endif()
# Check for idn2
option(USE_LIBIDN2 "Use libidn2 for IDN support" ON)
if(USE_LIBIDN2)
Expand All @@ -79,13 +67,12 @@ index c3525d3fc..1927464e8 100644
+ pkg_check_modules(LIBIDN2 REQUIRED libidn2)
+ set(HAVE_LIBIDN2 TRUE)
if(HAVE_LIBIDN2)
+ list(APPEND CURL_LIBS ${LIBIDN2_LINK_LIBRARIES})
+ set(HAVE_IDN2_H TRUE)
+ elseif(0)
set(CURL_LIBS "idn2;${CURL_LIBS}")
set(LIBIDN2_LINK_LIBRARIES "idn2")
check_include_file_concat("idn2.h" HAVE_IDN2_H)
endif()
@@ -920,11 +929,18 @@ mark_as_advanced(CURL_USE_LIBPSL)
@@ -963,12 +972,19 @@ mark_as_advanced(CURL_USE_LIBPSL)
set(USE_LIBPSL OFF)

if(CURL_USE_LIBPSL)
Expand All @@ -94,8 +81,6 @@ index c3525d3fc..1927464e8 100644
+ pkg_check_modules(LIBPSL REQUIRED libpsl)
if(LIBPSL_FOUND)
- list(APPEND CURL_LIBS ${LIBPSL_LIBRARY})
- list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBPSL_INCLUDE_DIR}")
- include_directories("${LIBPSL_INCLUDE_DIR}")
+ # 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)
Expand All @@ -105,10 +90,13 @@ index c3525d3fc..1927464e8 100644
+ endif()
+ endforeach()
+ list(APPEND CURL_LIBS ${LIBPSL_LINK_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()
@@ -935,7 +951,13 @@ mark_as_advanced(CURL_USE_LIBSSH2)
@@ -979,7 +995,13 @@ mark_as_advanced(CURL_USE_LIBSSH2)
set(USE_LIBSSH2 OFF)

if(CURL_USE_LIBSSH2)
Expand All @@ -122,9 +110,9 @@ index c3525d3fc..1927464e8 100644
+ get_target_property(LIBSSH2_INCLUDE_DIR "${LIBSSH2_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES)
if(LIBSSH2_FOUND)
list(APPEND CURL_LIBS ${LIBSSH2_LIBRARY})
list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBSSH2_INCLUDE_DIR}")
@@ -957,11 +979,24 @@ if(NOT USE_LIBSSH2 AND CURL_USE_LIBSSH)
endif()
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)
Expand All @@ -149,33 +137,11 @@ index c3525d3fc..1927464e8 100644

set(HAVE_GSSAPI ${GSS_FOUND})
if(GSS_FOUND)
@@ -973,6 +1008,7 @@ if(CURL_USE_GSSAPI)
@@ -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 "")
@@ -1618,6 +1654,7 @@ if(NOT CURL_DISABLE_INSTALL)
_add_if("UnixSockets" USE_UNIX_SOCKETS)
_add_if("libz" HAVE_LIBZ)
_add_if("brotli" HAVE_BROTLI)
+ _add_if("gsasl" USE_GSASL)
_add_if("zstd" HAVE_ZSTD)
_add_if("AsynchDNS" USE_ARES OR USE_THREADS_POSIX OR USE_THREADS_WIN32)
_add_if("IDN" HAVE_LIBIDN2 OR USE_WIN32_IDN OR USE_APPLE_IDN)
diff --git a/lib/curl_config.h.cmake b/lib/curl_config.h.cmake
index 3a46c6490..7ce3facb6 100644
--- a/lib/curl_config.h.cmake
+++ b/lib/curl_config.h.cmake
@@ -713,6 +713,9 @@ ${SIZEOF_TIME_T_CODE}
/* if librtmp/rtmpdump is in use */
#cmakedefine USE_LIBRTMP 1

+/* if GSASL is in use */
+#cmakedefine USE_GSASL 1
+
/* Define to 1 if you don't want the OpenSSL configuration to be loaded
automatically */
#cmakedefine CURL_DISABLE_OPENSSL_AUTO_LOAD_CONFIG 1
14 changes: 6 additions & 8 deletions vcpkg/overlay_ports/curl/export-components.patch
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index ec714a5..478527e 100644
index 3820c2d..f9a775a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1754,9 +1754,18 @@ if(NOT CURL_DISABLE_INSTALL)
DESTINATION ${CURL_INSTALL_CMAKE_DIR}
@@ -1952,7 +1952,17 @@ if(NOT CURL_DISABLE_INSTALL)
)
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@)
Expand All @@ -15,10 +14,9 @@ index ec714a5..478527e 100644
+ endif()
+ endforeach()
+ ]] @ONLY)

install(
- FILES ${version_config} ${project_config}
+ FILES ${version_config} ${project_config} ${components_file}
+
install(FILES ${version_config} ${project_config}
+ ${components_file}
DESTINATION ${CURL_INSTALL_CMAKE_DIR}
)

37 changes: 0 additions & 37 deletions vcpkg/overlay_ports/curl/fix-mbedtls.patch

This file was deleted.

20 changes: 20 additions & 0 deletions vcpkg/overlay_ports/curl/gnutls.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 580cc4357..735a9e234 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -540,11 +540,12 @@ if(CURL_USE_WOLFSSL)
endif()

if(CURL_USE_GNUTLS)
- find_package(GnuTLS REQUIRED)
- find_package(nettle REQUIRED)
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(GNUTLS "gnutls")
+ pkg_check_modules(NETTLE "nettle")
set(SSL_ENABLED ON)
set(USE_GNUTLS ON)
- list(APPEND CURL_LIBS ${GNUTLS_LIBRARIES} ${NETTLE_LIBRARIES})
+ list(APPEND CURL_LIBS ${GNUTLS_LINK_LIBRARIES} ${NETTLE_LINK_LIBRARIES})
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "gnutls" "nettle")
include_directories(${GNUTLS_INCLUDE_DIRS} ${NETTLE_INCLUDE_DIRS})

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
@@ -1310,3 +1310,3 @@
check_symbol_exists(pipe "${CURL_INCLUDES}" HAVE_PIPE)
@@ -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)
13 changes: 2 additions & 11 deletions vcpkg/overlay_ports/curl/nscurl/curl_wspiapi.diff
Original file line number Diff line number Diff line change
@@ -1,26 +1,19 @@
diff --git a/include/curl/curl.h b/include/curl/curl.h
index b2377b789..4ba564624 100644
--- a/include/curl/curl.h
+++ b/include/curl/curl.h
@@ -71,7 +71,11 @@
/* The check above prevents the winsock2 inclusion if winsock.h already was
included, since they can't co-exist without problems */
@@ -81,3 +81,7 @@
#include <winsock2.h>
+#if _WIN32_WINNT >= 0x0501
#include <ws2tcpip.h>
+#else
+#include <wspiapi.h>
+#endif
#endif
#endif

diff --git a/lib/setup-win32.h b/lib/setup-win32.h
index d7e2e6be1..144b12be0 100644
--- a/lib/setup-win32.h
+++ b/lib/setup-win32.h
@@ -89,7 +89,11 @@
# define NOGDI
# endif
@@ -91,3 +91,7 @@
# include <winsock2.h>
-# include <ws2tcpip.h>
+# if _WIN32_WINNT >= 0x0501
Expand All @@ -29,5 +22,3 @@ index d7e2e6be1..144b12be0 100644
+# include <wspiapi.h>
+# endif
# include <windows.h>
# include <winerror.h>
# include <tchar.h>
13 changes: 11 additions & 2 deletions vcpkg/overlay_ports/curl/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO curl/curl
REF "${curl_version}"
SHA512 e66cbf9bd3ae7b9b031475210b80b883b6a133042fbbc7cf2413f399d1b38aa54ab7322626abd3c6f1af56e0d540221f618aa903bd6b463ac8324f2c4e92dfa8
SHA512 f5c425c3fbd7bfda13137e8e9bc969ed7dc94c5bfcf0681a2358ab7d3b5d10402781a93385255a80c402c9824aeb97d70213b412f2d208dee4abdba5bbed2ca4
HEAD_REF master
PATCHES
0005_remove_imp_suffix.patch
Expand All @@ -13,7 +13,7 @@ vcpkg_from_github(
export-components.patch
dependencies.patch
cmake-config.patch
fix-mbedtls.patch # From https://github.com/curl/curl/commit/0c4b4c1e93c8e869af230090f32346fdfd548f21
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 @@ -57,12 +57,21 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
psl CURL_USE_LIBPSL
gssapi CURL_USE_GSSAPI
gsasl CURL_USE_GSASL
gnutls CURL_USE_GNUTLS
INVERTED_FEATURES
ldap CURL_DISABLE_LDAP
ldap CURL_DISABLE_LDAPS
non-http HTTP_ONLY
)

# Add warning on build failuer when using wolfssl and openssl features togther.
if("openssl" IN_LIST FEATURES AND "wolfssl" IN_LIST FEATURES)
message(WARNING "Adding OpenSSL and WolfSSL simultaneously will result in a build failure. \
Please remove one of these features from your build process.\
If you are using OpenSSL version 1.1, you may disregard this warning."
)
endif()

set(OPTIONS "")

# nscurl: no schannel
Expand Down
16 changes: 14 additions & 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.8.0",
"port-version": 4,
"version": "8.9.1",
"description": "A library for transferring data with URLs",
"homepage": "https://curl.se/",
"license": "curl AND ISC AND BSD-3-Clause",
Expand Down Expand Up @@ -33,6 +32,19 @@
"c-ares"
]
},
"gnutls": {
"description": "SSL support (gnutls)",
"dependencies": [
{
"name": "libgnutls",
"platform": "!windows | mingw"
},
{
"name": "shiftmedia-libgnutls",
"platform": "windows & !mingw"
}
]
},
"gsasl": {
"description": "GSASL support (libgsasl)",
"dependencies": [
Expand Down

0 comments on commit 1723b66

Please sign in to comment.