[curl] Update to 7.71.0 (#12141)

* [curl] Update to 7.71.0

* Update to 7.71.1
This commit is contained in:
NancyLi1013 2020-07-07 04:23:44 +08:00 committed by GitHub
parent ac4e90220a
commit f12d986e6a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 103 additions and 191 deletions

View File

@ -1,13 +0,0 @@
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)

View File

@ -1,79 +1,15 @@
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)
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 62b7b33..9b0e2e1 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -107,7 +107,9 @@ endif()
target_link_libraries(${LIB_NAME} ${CURL_LIBS})
# 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)
+ add_definitions(-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 @@
***************************************************************************/
add_definitions(-D_USRDLL)
endif()
#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/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

View File

@ -1,13 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 490cc19ef8..23fe34f614 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -330,7 +330,7 @@ if(CMAKE_USE_WINSSL)
set(SSL_ENABLED ON)
set(USE_SCHANNEL ON) # Windows native SSL/TLS support
set(USE_WINDOWS_SSPI ON) # CMAKE_USE_WINSSL implies CURL_WINDOWS_SSPI
- list(APPEND CURL_LIBS "crypt32")
+ list(APPEND CURL_LIBS "crypt32" "advapi32")
endif()
if(CURL_WINDOWS_SSPI)
set(USE_WINDOWS_SSPI ON)

View File

@ -1,14 +1,14 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 490cc19..51c0a92 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -388,6 +388,9 @@ if(USE_NGHTTP2)
find_package(NGHTTP2 REQUIRED)
include_directories(${NGHTTP2_INCLUDE_DIRS})
list(APPEND CURL_LIBS ${NGHTTP2_LIBRARIES})
+ if(NOT BUILD_SHARED_LIBS)
+ add_definitions(-DNGHTTP2_STATICLIB)
+ endif()
endif()
if(NOT CURL_DISABLE_LDAP)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5a13333..2dd274c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -431,6 +431,9 @@ if(USE_NGHTTP2)
find_package(NGHTTP2 REQUIRED)
include_directories(${NGHTTP2_INCLUDE_DIRS})
list(APPEND CURL_LIBS ${NGHTTP2_LIBRARIES})
+ if(NOT BUILD_SHARED_LIBS)
+ add_definitions(-DNGHTTP2_STATICLIB)
+ endif()
endif()
function(CheckQuicSupportInOpenSSL)

View File

@ -1,10 +1,10 @@
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index eca9a8a..6f72955 100644
index 1d71e14..62b7b33 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -97,7 +97,7 @@ endif()
set_target_properties(${LIB_NAME} PROPERTIES PREFIX "")
set_target_properties(${LIB_NAME} PROPERTIES IMPORT_PREFIX "")
@@ -128,7 +128,7 @@ if(CURL_HAS_LTO)
INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE)
endif()
-if(WIN32)
+if(WIN32 AND 0)

View File

@ -1,22 +1,22 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 63e2b94..b376cd1 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -40,6 +40,8 @@ if(MSVC)
list(APPEND CURL_FILES curl.rc)
endif()
+find_package(ZLIB REQUIRED)
+
# CURL_FILES comes from Makefile.inc
add_executable(
${EXE_NAME}
@@ -59,7 +61,7 @@ include_directories(
)
#Build curl executable
-target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS})
+target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS} ZLIB::ZLIB)
################################################################################
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 26e3cfe..74d00dd 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -61,6 +61,8 @@ if(MSVC)
list(APPEND CURL_FILES curl.rc)
endif()
+find_package(ZLIB REQUIRED)
+
# CURL_FILES comes from Makefile.inc
add_executable(
${EXE_NAME}
@@ -91,7 +93,7 @@ include_directories(
)
#Build curl executable
-target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS})
+target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS} ZLIB::ZLIB)
################################################################################

View File

@ -1,18 +1,18 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b376cd1..baffe7e 100644
index 74d00dd..5838805 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -71,8 +71,8 @@ target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS} ZLIB::ZLIB)
@@ -103,8 +103,8 @@ target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS} ZLIB::ZLIB)
#INCLUDE(ModuleInstall OPTIONAL)
-install(TARGETS ${EXE_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
-export(TARGETS ${EXE_NAME}
- APPEND FILE ${PROJECT_BINARY_DIR}/curl-target.cmake
- NAMESPACE CURL::
- NAMESPACE ${PROJECT_NAME}::
-)
+install(TARGETS ${EXE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
+#export(TARGETS ${EXE_NAME}
+# APPEND FILE ${PROJECT_BINARY_DIR}/curl-target.cmake
+# NAMESPACE CURL::
+# NAMESPACE ${PROJECT_NAME}::
+#)

View File

@ -1,13 +1,13 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0e567e7..697dfea 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -71,7 +71,7 @@ target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS} ZLIB::ZLIB)
#INCLUDE(ModuleInstall OPTIONAL)
-install(TARGETS ${EXE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
+install(TARGETS ${EXE_NAME} DESTINATION tools)
#export(TARGETS ${EXE_NAME}
# APPEND FILE ${PROJECT_BINARY_DIR}/curl-target.cmake
# NAMESPACE CURL::
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5838805..d2ca468 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -103,7 +103,7 @@ target_link_libraries(${EXE_NAME} libcurl ${CURL_LIBS} ZLIB::ZLIB)
#INCLUDE(ModuleInstall OPTIONAL)
-install(TARGETS ${EXE_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
+install(TARGETS ${EXE_NAME} DESTINATION tools)
#export(TARGETS ${EXE_NAME}
# APPEND FILE ${PROJECT_BINARY_DIR}/curl-target.cmake
# NAMESPACE ${PROJECT_NAME}::

View File

@ -1,12 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 42e490a..ec9e4d1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -348,6 +348,7 @@ if(CMAKE_USE_SECTRANSP)
list(APPEND CURL_LIBS "${COREFOUNDATION_FRAMEWORK}" "${SECURITY_FRAMEWORK}")
endif()
+set(USE_OPENSSL OFF)
if(CMAKE_USE_OPENSSL)
find_package(OpenSSL REQUIRED)
set(SSL_ENABLED ON)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5a13333..5a7ece0 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -361,6 +361,7 @@ if(CMAKE_USE_SECTRANSP)
list(APPEND CURL_LIBS "${COREFOUNDATION_FRAMEWORK}" "${SECURITY_FRAMEWORK}")
endif()
+set(USE_OPENSSL OFF)
if(CMAKE_USE_OPENSSL)
find_package(OpenSSL REQUIRED)
set(SSL_ENABLED ON)

View File

@ -1,12 +1,12 @@
diff --git a/CMake/OtherTests.cmake b/CMake/OtherTests.cmake
index c1c9aa3..378a5bd 100644
--- a/CMake/OtherTests.cmake
+++ b/CMake/OtherTests.cmake
@@ -185,6 +185,7 @@ if(HAVE_SIGNAL_H)
set(CMAKE_REQUIRED_FLAGS "-DHAVE_SIGNAL_H")
set(CMAKE_EXTRA_INCLUDE_FILES "signal.h")
endif()
+unset(CMAKE_TRY_COMPILE_TARGET_TYPE)
check_type_size("sig_atomic_t" SIZEOF_SIG_ATOMIC_T)
if(HAVE_SIZEOF_SIG_ATOMIC_T)
check_c_source_compiles("
diff --git a/CMake/OtherTests.cmake b/CMake/OtherTests.cmake
index 7cec6da..c836fc9 100644
--- a/CMake/OtherTests.cmake
+++ b/CMake/OtherTests.cmake
@@ -212,6 +212,7 @@ if(HAVE_SIGNAL_H)
set(CMAKE_REQUIRED_FLAGS "-DHAVE_SIGNAL_H")
set(CMAKE_EXTRA_INCLUDE_FILES "signal.h")
endif()
+unset(CMAKE_TRY_COMPILE_TARGET_TYPE)
check_type_size("sig_atomic_t" SIZEOF_SIG_ATOMIC_T)
if(HAVE_SIZEOF_SIG_ATOMIC_T)
check_c_source_compiles("

View File

@ -1,5 +1,5 @@
Source: curl
Version: 7.68.0-3
Version: 7.71.1
Build-Depends: zlib
Homepage: https://github.com/curl/curl
Description: A library for transferring data with URLs

View File

@ -1,13 +1,11 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO curl/curl
REF curl-7_68_0
SHA512 d75ed39b121a5a04d5a4ba89779967a49e196a93325747b51399adf1afb5f5c13355d6dbe798b259d19245c83bb55f0b621b24b25d8f3ddb1914df30067b8737
REF 5a1fc8d33808d7b22f57bdf9403cda7ff07b0670 #curl-7_71_1
SHA512 a58d2f23c4fb82610b8d68181fd29a4007983f88950b3eb3362170f3187d86116628151c5e09c713f047aca77cad7b9900bb58e368bbddca31599b4fde0dfa22
HEAD_REF master
PATCHES
0001_cmake.patch
0002_fix_uwp.patch
0003_fix_libraries.patch
0004_nghttp2_staticlib.patch
0005_remove_imp_suffix.patch
0006_fix_tool_depends.patch
@ -98,13 +96,17 @@ else()
file(WRITE ${CURRENT_PACKAGES_DIR}/share/${PORT}/curl-config "${CURL_CONFIG}")
endif()
file(READ ${CURRENT_PACKAGES_DIR}/include/curl/curl.h CURL_H)
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
string(REPLACE "#ifdef CURL_STATICLIB" "#if 1" CURL_H "${CURL_H}")
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/curl/curl.h
"#ifdef CURL_STATICLIB"
"#if 1"
)
else()
string(REPLACE "#ifdef CURL_STATICLIB" "#if 0" CURL_H "${CURL_H}")
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/curl/curl.h
"#ifdef CURL_STATICLIB"
"#if 0"
)
endif()
file(WRITE ${CURRENT_PACKAGES_DIR}/include/curl/curl.h "${CURL_H}")
file(INSTALL ${CURRENT_PORT_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)