diff --git a/ports/cpr/002_cpr_fixcase.patch b/ports/cpr/002_cpr_fixcase.patch new file mode 100644 index 000000000..4dbc97119 --- /dev/null +++ b/ports/cpr/002_cpr_fixcase.patch @@ -0,0 +1,13 @@ +diff --git a/cpr/error.cpp b/cpr/error.cpp +index 713cb10..4143f93 100644 +--- a/cpr/error.cpp ++++ b/cpr/error.cpp +@@ -38,8 +38,6 @@ ErrorCode Error::getErrorCodeForCurlError(std::int32_t curl_code) { + return ErrorCode::SSL_LOCAL_CERTIFICATE_ERROR; + case CURLE_SSL_CIPHER: + return ErrorCode::GENERIC_SSL_ERROR; +- case CURLE_SSL_CACERT: +- return ErrorCode::SSL_CACERT_ERROR; + case CURLE_USE_SSL_FAILED: + return ErrorCode::GENERIC_SSL_ERROR; + case CURLE_SSL_ENGINE_INITFAILED: diff --git a/ports/cpr/CONTROL b/ports/cpr/CONTROL index 2bf591cc2..89cc6b847 100644 --- a/ports/cpr/CONTROL +++ b/ports/cpr/CONTROL @@ -1,4 +1,4 @@ Source: cpr -Version: 1.3.0-6 +Version: 1.3.0-7 Description: C++ Requests is a simple wrapper around libcurl inspired by the excellent Python Requests project. Build-Depends: curl[core] diff --git a/ports/cpr/portfile.cmake b/ports/cpr/portfile.cmake index f6ea8e9af..9e2c40a0d 100644 --- a/ports/cpr/portfile.cmake +++ b/ports/cpr/portfile.cmake @@ -10,6 +10,7 @@ vcpkg_from_github( HEAD_REF master PATCHES 001-cpr-config.patch + 002_cpr_fixcase.patch ) vcpkg_configure_cmake( diff --git a/ports/curl/0001_cmake.patch b/ports/curl/0001_cmake.patch index 7796af413..33ede7b90 100644 --- a/ports/curl/0001_cmake.patch +++ b/ports/curl/0001_cmake.patch @@ -1,28 +1,13 @@ -diff --git a/CMake/FindLibSSH2.cmake b/CMake/FindLibSSH2.cmake -index 84822dba7..0d6219425 100644 ---- a/CMake/FindLibSSH2.cmake -+++ b/CMake/FindLibSSH2.cmake -@@ -12,7 +12,7 @@ endif() - find_path(LIBSSH2_INCLUDE_DIR libssh2.h - ) - --find_library(LIBSSH2_LIBRARY NAMES ssh2 -+find_library(LIBSSH2_LIBRARY NAMES ssh2 libssh2 - ) - - if(LIBSSH2_INCLUDE_DIR) -diff --git a/CMakeLists.txt b/CMakeLists.txt -index e6dbb73f1..1e2ff138e 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1144,7 +1144,9 @@ function(TRANSFORM_MAKEFILE_INC INPUT_FILE OUTPUT_FILE) - - endfunction() - --if(WIN32 AND NOT CYGWIN) -+if(MSVC) -+ set(CURL_INSTALL_CMAKE_DIR share/curl) -+elseif(WIN32 AND NOT CYGWIN) - set(CURL_INSTALL_CMAKE_DIR CMake) - else() - set(CURL_INSTALL_CMAKE_DIR lib/cmake/curl) +diff --git a/CMake/FindLibSSH2.cmake b/CMake/FindLibSSH2.cmake +index 84822db..0d62194 100644 +--- a/CMake/FindLibSSH2.cmake ++++ b/CMake/FindLibSSH2.cmake +@@ -12,7 +12,7 @@ endif() + find_path(LIBSSH2_INCLUDE_DIR libssh2.h + ) + +-find_library(LIBSSH2_LIBRARY NAMES ssh2 ++find_library(LIBSSH2_LIBRARY NAMES ssh2 libssh2 + ) + + if(LIBSSH2_INCLUDE_DIR) diff --git a/ports/curl/0002_fix_uwp.patch b/ports/curl/0002_fix_uwp.patch index 111ca98e8..565903ad2 100644 --- a/ports/curl/0002_fix_uwp.patch +++ b/ports/curl/0002_fix_uwp.patch @@ -1,92 +1,92 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 7b73b98..72f6171 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -882,7 +882,9 @@ check_symbol_exists(setsockopt "${CURL_INCLUDES}" HAVE_SETSOCKOPT) - check_function_exists(mach_absolute_time HAVE_MACH_ABSOLUTE_TIME) - - # symbol exists in win32, but function does not. --if(WIN32) -+if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") -+ add_definitions(-D_WIN32_WINNT=0x0A00 -DHAVE_STRUCT_POLLFD -D_WINSOCK_DEPRECATED_NO_WARNINGS) -+elseif(WIN32) - if(ENABLE_INET_PTON) - check_function_exists(inet_pton HAVE_INET_PTON) - # _WIN32_WINNT_VISTA (0x0600) -diff --git a/lib/curl_gethostname.c b/lib/curl_gethostname.c -index 8337c72..41867b2 100644 ---- a/lib/curl_gethostname.c -+++ b/lib/curl_gethostname.c -@@ -21,6 +21,7 @@ - ***************************************************************************/ - - #include "curl_setup.h" -+#include "curl/curl.h" - - #include "curl_gethostname.h" - -@@ -64,9 +65,10 @@ int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen) - #ifdef DEBUGBUILD - - /* Override host name when environment variable CURL_GETHOSTNAME is set */ -- const char *force_hostname = getenv("CURL_GETHOSTNAME"); -+ char *force_hostname = curl_getenv("CURL_GETHOSTNAME"); - if(force_hostname) { - strncpy(name, force_hostname, namelen); -+ free(force_hostname); - err = 0; - } - else { -diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c -index e896276..268f0ea 100644 ---- a/lib/curl_ntlm_core.c -+++ b/lib/curl_ntlm_core.c -@@ -743,9 +743,12 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash, - - /* Calculate the timestamp */ - #ifdef DEBUGBUILD -- char *force_timestamp = getenv("CURL_FORCETIME"); -- if(force_timestamp) -+ char *force_timestamp = curl_getenv("CURL_FORCETIME"); -+ if (force_timestamp) -+ { - tw = CURL_OFF_T_C(11644473600) * 10000000; -+ free(force_timestamp); -+ } - else - #endif - tw = ((curl_off_t)time(NULL) + CURL_OFF_T_C(11644473600)) * 10000000; -diff --git a/lib/ftp.c b/lib/ftp.c -index 8042edf..3442df7 100644 ---- a/lib/ftp.c -+++ b/lib/ftp.c -@@ -4260,7 +4260,7 @@ CURLcode ftp_parse_url_path(struct connectdata *conn) - /* prevpath is "raw" so we convert the input path before we compare the - strings */ - size_t dlen; -- char *path; -+ char *path = NULL; - CURLcode result = - Curl_urldecode(conn->data, data->state.path, 0, &path, &dlen, TRUE); - if(result) { -diff --git a/lib/rand.c b/lib/rand.c -index 2670af9..0d18d37 100644 ---- a/lib/rand.c -+++ b/lib/rand.c -@@ -44,7 +44,7 @@ static CURLcode randit(struct Curl_easy *data, unsigned int *rnd) - static bool seeded = FALSE; - - #ifdef CURLDEBUG -- char *force_entropy = getenv("CURL_ENTROPY"); -+ char *force_entropy = curl_getenv("CURL_ENTROPY"); - if(force_entropy) { - if(!seeded) { - unsigned int seed = 0; -@@ -58,6 +58,7 @@ static CURLcode randit(struct Curl_easy *data, unsigned int *rnd) - else - randseed++; - *rnd = randseed; -+ free(force_entropy); - return CURLE_OK; - } - #endif +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 38b7b7d..5b3d33e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -897,7 +897,9 @@ check_symbol_exists(setsockopt "${CURL_INCLUDES}" HAVE_SETSOCKOPT) + check_function_exists(mach_absolute_time HAVE_MACH_ABSOLUTE_TIME) + + # symbol exists in win32, but function does not. +-if(WIN32) ++if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") ++ add_definitions(-D_WIN32_WINNT=0x0A00 -DHAVE_STRUCT_POLLFD -D_WINSOCK_DEPRECATED_NO_WARNINGS) ++elseif(WIN32) + if(ENABLE_INET_PTON) + check_function_exists(inet_pton HAVE_INET_PTON) + # _WIN32_WINNT_VISTA (0x0600) +diff --git a/lib/curl_gethostname.c b/lib/curl_gethostname.c +index 8337c72..41867b2 100644 +--- a/lib/curl_gethostname.c ++++ b/lib/curl_gethostname.c +@@ -21,6 +21,7 @@ + ***************************************************************************/ + + #include "curl_setup.h" ++#include "curl/curl.h" + + #include "curl_gethostname.h" + +@@ -64,9 +65,10 @@ int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen) + #ifdef DEBUGBUILD + + /* Override host name when environment variable CURL_GETHOSTNAME is set */ +- const char *force_hostname = getenv("CURL_GETHOSTNAME"); ++ char *force_hostname = curl_getenv("CURL_GETHOSTNAME"); + if(force_hostname) { + strncpy(name, force_hostname, namelen); ++ free(force_hostname); + err = 0; + } + else { +diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c +index e7060eb..9cd76f7 100644 +--- a/lib/curl_ntlm_core.c ++++ b/lib/curl_ntlm_core.c +@@ -726,10 +726,11 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash, + + /* Calculate the timestamp */ + #ifdef DEBUGBUILD +- char *force_timestamp = getenv("CURL_FORCETIME"); +- if(force_timestamp) ++ char *force_timestamp = curl_getenv("CURL_FORCETIME"); ++ if(force_timestamp) { + tw = CURL_OFF_T_C(11644473600) * 10000000; +- else ++ free(force_timestamp); ++ } + #endif + tw = ((curl_off_t)time(NULL) + CURL_OFF_T_C(11644473600)) * 10000000; + +diff --git a/lib/ftp.c b/lib/ftp.c +index 825aaaa..3b96670 100644 +--- a/lib/ftp.c ++++ b/lib/ftp.c +@@ -4262,7 +4262,7 @@ CURLcode ftp_parse_url_path(struct connectdata *conn) + /* prevpath is "raw" so we convert the input path before we compare the + strings */ + size_t dlen; +- char *path; ++ char *path = NULL; + CURLcode result = + Curl_urldecode(conn->data, ftp->path, 0, &path, &dlen, TRUE); + if(result) { +diff --git a/lib/rand.c b/lib/rand.c +index 6ee45fe..b2d712d 100644 +--- a/lib/rand.c ++++ b/lib/rand.c +@@ -44,7 +44,7 @@ static CURLcode randit(struct Curl_easy *data, unsigned int *rnd) + static bool seeded = FALSE; + + #ifdef CURLDEBUG +- char *force_entropy = getenv("CURL_ENTROPY"); ++ char *force_entropy = curl_getenv("CURL_ENTROPY"); + if(force_entropy) { + if(!seeded) { + unsigned int seed = 0; +@@ -58,6 +58,7 @@ static CURLcode randit(struct Curl_easy *data, unsigned int *rnd) + else + randseed++; + *rnd = randseed; ++ free(force_entropy); + return CURLE_OK; + } + #endif diff --git a/ports/curl/CONTROL b/ports/curl/CONTROL index 9d5dde10e..226ce5b1a 100644 --- a/ports/curl/CONTROL +++ b/ports/curl/CONTROL @@ -1,5 +1,5 @@ Source: curl -Version: 7.61.1-7 +Version: 7.65.0 Build-Depends: zlib Description: A library for transferring data with URLs Default-Features: ssl @@ -15,7 +15,7 @@ Build-Depends: nghttp2, curl[ssl] Description: HTTP2 support Feature: ssl -Build-Depends: curl[openssl] (!windows&!osx), curl[winssl] (windows), curl[darwinssl] (osx) +Build-Depends: curl[openssl] (!windows&!osx), curl[winssl] (windows), curl[sectransp] (osx) Description: Default SSL backend Feature: ssh @@ -34,5 +34,5 @@ Feature: mbedtls Build-Depends: mbedtls Description: SSL support (mbedTLS) -Feature: darwinssl -Description: SSL support (darwinssl) +Feature: sectransp +Description: SSL support (sectransp) diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake index 745e2d241..2a75c696f 100644 --- a/ports/curl/portfile.cmake +++ b/ports/curl/portfile.cmake @@ -3,8 +3,8 @@ include(vcpkg_common_functions) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO curl/curl - REF curl-7_61_1 - SHA512 09fa3c87f8d516eabe3241247a5094c32ee0481961cf85bf78ecb13acdf23bb2ec82f113d2660271d22742c79e76d73fb122730fa28e34c7f5477c05a4a6534c + REF curl-7_65_0 + SHA512 436b6b42654c1db2b3f69df410a7f28401a50faf18e74f328a93585c147541e697664b0e9e7df03239fd76c797c1bb4f435f4c668a6b0ad28bdd67e17f786491 HEAD_REF master PATCHES 0001_cmake.patch @@ -40,14 +40,14 @@ if("mbedtls" IN_LIST FEATURES) set(USE_MBEDTLS ON) endif() -set(USE_DARWINSSL OFF) -set(DARWINSSL_OPTIONS) -if("darwinssl" IN_LIST FEATURES) - if(VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin") - message(FATAL_ERROR "darwinssl is not supported on non-Apple platforms") +set(USE_SECTRANSP OFF) +set(SECTRANSP_OPTIONS) +if("sectransp" IN_LIST FEATURES) + if(NOT VCPKG_CMAKE_SYSTEM_NAME OR (VCPKG_CMAKE_SYSTEM_NAME AND NOT VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Darwin")) + message(FATAL_ERROR "sectransp is not supported on non-Apple platforms") endif() - set(USE_DARWINSSL ON) - set(DARWINSSL_OPTIONS + set(USE_SECTRANSP ON) + set(SECTRANSP_OPTIONS -DCURL_CA_PATH=none ) endif() @@ -83,16 +83,12 @@ if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") ) endif() -vcpkg_find_acquire_program(PERL) -get_filename_component(PERL_PATH ${PERL} DIRECTORY) -vcpkg_add_to_path(${PERL_PATH}) - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS ${UWP_OPTIONS} - ${DARWINSSL_OPTIONS} + ${SECTRANSP_OPTIONS} ${HTTP2_OPTIONS} -DBUILD_TESTING=OFF -DBUILD_CURL_EXE=${BUILD_CURL_EXE} @@ -101,9 +97,10 @@ vcpkg_configure_cmake( -DCMAKE_USE_OPENSSL=${USE_OPENSSL} -DCMAKE_USE_WINSSL=${USE_WINSSL} -DCMAKE_USE_MBEDTLS=${USE_MBEDTLS} - -DCMAKE_USE_DARWINSSL=${USE_DARWINSSL} + -DCMAKE_USE_SECTRANSP=${USE_SECTRANSP} -DCMAKE_USE_LIBSSH2=${USE_LIBSSH2} -DHTTP_ONLY=${USE_HTTP_ONLY} + -DCMAKE_DISABLE_FIND_PACKAGE_Perl=ON OPTIONS_RELEASE -DBUILD_CURL_EXE=${BUILD_CURL_EXE} OPTIONS_DEBUG @@ -113,10 +110,12 @@ vcpkg_configure_cmake( vcpkg_install_cmake() -if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake/curl) - vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/curl) +if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/cmake/CURL) + vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/CURL) elseif(EXISTS ${CURRENT_PACKAGES_DIR}/share/curl) vcpkg_fixup_cmake_targets(CONFIG_PATH share/curl) +else() + message(FATAL_ERROR "Could not locate the curl config files") endif() file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/curl RENAME copyright)