Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions ports/cpr/002_cpr_fixcase.patch
Original file line number Diff line number Diff line change
@@ -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:
2 changes: 1 addition & 1 deletion ports/cpr/CONTROL
Original file line number Diff line number Diff line change
@@ -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]
1 change: 1 addition & 0 deletions ports/cpr/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
001-cpr-config.patch
002_cpr_fixcase.patch
)

vcpkg_configure_cmake(
Expand Down
41 changes: 13 additions & 28 deletions ports/curl/0001_cmake.patch
Original file line number Diff line number Diff line change
@@ -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)
182 changes: 90 additions & 92 deletions ports/curl/0002_fix_uwp.patch
Original file line number Diff line number Diff line change
@@ -1,92 +1,90 @@
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 edb1cec..e7b4c68 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -894,7 +894,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..55e3738 100644
--- a/lib/curl_ntlm_core.c
+++ b/lib/curl_ntlm_core.c
@@ -726,10 +726,10 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash,

/* Calculate the timestamp */
#ifdef DEBUGBUILD
- char *force_timestamp = getenv("CURL_FORCETIME");
+ char *force_timestamp = curl_getenv("CURL_FORCETIME");
if(force_timestamp)
tw = CURL_OFF_T_C(11644473600) * 10000000;
- else
Comment thread
PhoebeHui marked this conversation as resolved.
+ 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
2 changes: 1 addition & 1 deletion ports/curl/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: curl
Version: 7.61.1-7
Version: 7.64.1
Build-Depends: zlib
Description: A library for transferring data with URLs
Default-Features: ssl
Expand Down
12 changes: 6 additions & 6 deletions ports/curl/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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_64_1
SHA512 bfaed8c65e82cb27a68e259516c8395cf10a67b62bb7e9d44803bde450f6017116fb3da8db716a172e140324831a63b4046a355810d86ba6577ebda3883a3625
HEAD_REF master
PATCHES
0001_cmake.patch
Expand Down Expand Up @@ -113,8 +113,8 @@ 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)
endif()
Comment thread
PhoebeHui marked this conversation as resolved.
Expand All @@ -135,9 +135,9 @@ if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/curl${EXECUTABLE_SUFFIX}")
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/curl)

if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
file(READ "${CURRENT_PACKAGES_DIR}/share/curl/curl-target-release.cmake" RELEASE_MODULE)
file(READ "${CURRENT_PACKAGES_DIR}/share/curl/CURLTargets-release.cmake" RELEASE_MODULE)
string(REPLACE "\${_IMPORT_PREFIX}/bin/curl${EXECUTABLE_SUFFIX}" "\${_IMPORT_PREFIX}/tools/curl/curl${EXECUTABLE_SUFFIX}" RELEASE_MODULE "${RELEASE_MODULE}")
file(WRITE "${CURRENT_PACKAGES_DIR}/share/curl/curl-target-release.cmake" "${RELEASE_MODULE}")
file(WRITE "${CURRENT_PACKAGES_DIR}/share/curl/CURLTargets-release.cmake" "${RELEASE_MODULE}")
endif()
endif()

Expand Down