aboutsummaryrefslogtreecommitdiff
path: root/ports/curl
diff options
context:
space:
mode:
Diffstat (limited to 'ports/curl')
-rw-r--r--ports/curl/0005_remove_imp_suffix.patch13
-rw-r--r--ports/curl/0006_fix_tool_depends.patch22
-rw-r--r--ports/curl/CONTROL12
-rw-r--r--ports/curl/portfile.cmake55
-rw-r--r--ports/curl/usage5
-rw-r--r--ports/curl/vcpkg-cmake-wrapper.cmake42
6 files changed, 135 insertions, 14 deletions
diff --git a/ports/curl/0005_remove_imp_suffix.patch b/ports/curl/0005_remove_imp_suffix.patch
new file mode 100644
index 000000000..356af2d52
--- /dev/null
+++ b/ports/curl/0005_remove_imp_suffix.patch
@@ -0,0 +1,13 @@
+diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
+index eca9a8a..6f72955 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 "")
+
+-if(WIN32)
++if(WIN32 AND 0)
+ if(BUILD_SHARED_LIBS)
+ # Add "_imp" as a suffix before the extension to avoid conflicting with the statically linked "libcurl.lib"
+ set_target_properties(${LIB_NAME} PROPERTIES IMPORT_SUFFIX "_imp.lib")
diff --git a/ports/curl/0006_fix_tool_depends.patch b/ports/curl/0006_fix_tool_depends.patch
new file mode 100644
index 000000000..67fd62d92
--- /dev/null
+++ b/ports/curl/0006_fix_tool_depends.patch
@@ -0,0 +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/ports/curl/CONTROL b/ports/curl/CONTROL
index 1c607bce3..1022e223b 100644
--- a/ports/curl/CONTROL
+++ b/ports/curl/CONTROL
@@ -1,5 +1,5 @@
Source: curl
-Version: 7.65.0-1
+Version: 7.66.0-1
Build-Depends: zlib
Homepage: https://github.com/curl/curl
Description: A library for transferring data with URLs
@@ -37,3 +37,13 @@ Description: SSL support (mbedTLS)
Feature: sectransp
Description: SSL support (sectransp)
+
+Feature: c-ares
+Build-Depends: c-ares
+Description: c-ares support
+
+Feature:sspi
+Description: SSPI support
+
+Feature: brotli
+Description: brotli support (brotli) \ No newline at end of file
diff --git a/ports/curl/portfile.cmake b/ports/curl/portfile.cmake
index 294c7a758..2b6514886 100644
--- a/ports/curl/portfile.cmake
+++ b/ports/curl/portfile.cmake
@@ -3,14 +3,16 @@ include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO curl/curl
- REF curl-7_65_0
- SHA512 436b6b42654c1db2b3f69df410a7f28401a50faf18e74f328a93585c147541e697664b0e9e7df03239fd76c797c1bb4f435f4c668a6b0ad28bdd67e17f786491
+ REF curl-7_66_0
+ SHA512 0b02b6117ab69e848219fa59b25e4254934d841fbc3e2a70ccfdcb417ab7fc46a10dd703a25fbe8a2a98a59cbc73ad6b9298f5668a7345f7910010b958de4d21
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
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" CURL_STATICLIB)
@@ -72,6 +74,24 @@ if("tool" IN_LIST FEATURES)
set(BUILD_CURL_EXE ON)
endif()
+# c-ares
+set(USE_ARES OFF)
+if("c-ares" IN_LIST FEATURES)
+ set(USE_ARES ON)
+endif()
+
+# SSPI
+set(USE_WINDOWS_SSPI OFF)
+if("sspi" IN_LIST FEATURES)
+ set(USE_WINDOWS_SSPI ON)
+endif()
+
+# brotli
+set(HAVE_BROTLI OFF)
+if("brotli" IN_LIST FEATURES)
+ set(HAVE_BROTLI ON)
+endif()
+
# UWP targets
set(UWP_OPTIONS)
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
@@ -100,6 +120,9 @@ vcpkg_configure_cmake(
-DCMAKE_USE_SECTRANSP=${USE_SECTRANSP}
-DCMAKE_USE_LIBSSH2=${USE_LIBSSH2}
-DHTTP_ONLY=${USE_HTTP_ONLY}
+ -DENABLE_ARES=${USE_ARES}
+ -DCURL_WINDOWS_SSPI=${USE_WINDOWS_SSPI}
+ -DCURL_BROTLI=${HAVE_BROTLI}
-DCMAKE_DISABLE_FIND_PACKAGE_Perl=ON
OPTIONS_RELEASE
-DBUILD_CURL_EXE=${BUILD_CURL_EXE}
@@ -113,7 +136,7 @@ vcpkg_install_cmake()
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)
+ vcpkg_fixup_cmake_targets()
else()
message(FATAL_ERROR "Could not locate the curl config files")
endif()
@@ -140,25 +163,41 @@ if(EXISTS "${CURRENT_PACKAGES_DIR}/bin/curl${EXECUTABLE_SUFFIX}")
endif()
endif()
+if(EXISTS ${CURRENT_PACKAGES_DIR}/lib/libcurl_imp.lib OR EXISTS ${CURRENT_PACKAGES_DIR}/debug/lib/libcurl-d_imp.lib)
+ # Because vcpkg only ever installs one or the other, there is no need to have the libraries be different names.
+ # Using the same name improves compatibility, because downstream projects can always rely on "libcurl.lib"
+ message(FATAL_ERROR "Curl's import library name should be consistent with the static library name.")
+endif()
+
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/pkgconfig ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)
-if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
else()
file(REMOVE ${CURRENT_PACKAGES_DIR}/bin/curl-config ${CURRENT_PACKAGES_DIR}/debug/bin/curl-config)
+
+ file(GLOB FILES LIST_DIRECTORIES TRUE ${CURRENT_PACKAGES_DIR}/bin/*)
+ if (FILES STREQUAL "")
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
+ endif()
+
+ file(GLOB FILES LIST_DIRECTORIES TRUE ${CURRENT_PACKAGES_DIR}/debug/bin/*)
+ if (FILES STREQUAL "")
+ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
+ endif()
endif()
file(READ ${CURRENT_PACKAGES_DIR}/include/curl/curl.h CURL_H)
-if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
string(REPLACE "#ifdef CURL_STATICLIB" "#if 1" CURL_H "${CURL_H}")
else()
string(REPLACE "#ifdef CURL_STATICLIB" "#if 0" CURL_H "${CURL_H}")
endif()
file(WRITE ${CURRENT_PACKAGES_DIR}/include/curl/curl.h "${CURL_H}")
-vcpkg_copy_pdbs()
+file(INSTALL ${CURRENT_PORT_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/curl)
-file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
+vcpkg_copy_pdbs()
-vcpkg_test_cmake(PACKAGE_NAME CURL MODULE)
+vcpkg_test_cmake(PACKAGE_NAME CURL)
diff --git a/ports/curl/usage b/ports/curl/usage
deleted file mode 100644
index d43e7112e..000000000
--- a/ports/curl/usage
+++ /dev/null
@@ -1,5 +0,0 @@
-The package curl is compatible with built-in CMake targets:
-
- find_package(CURL REQUIRED)
- target_link_libraries(main PRIVATE ${CURL_LIBRARIES})
- target_include_directories(main PRIVATE ${CURL_INCLUDE_DIRS})
diff --git a/ports/curl/vcpkg-cmake-wrapper.cmake b/ports/curl/vcpkg-cmake-wrapper.cmake
new file mode 100644
index 000000000..c7fbdba91
--- /dev/null
+++ b/ports/curl/vcpkg-cmake-wrapper.cmake
@@ -0,0 +1,42 @@
+list(REMOVE_ITEM ARGS "NO_MODULE")
+list(REMOVE_ITEM ARGS "CONFIG")
+list(REMOVE_ITEM ARGS "MODULE")
+
+_find_package(${ARGS} CONFIG)
+
+if(TARGET CURL::libcurl)
+ set(CURL_FOUND TRUE)
+
+ get_target_property(_curl_include_dirs CURL::libcurl INTERFACE_INCLUDE_DIRECTORIES)
+ get_target_property(_curl_link_libraries CURL::libcurl INTERFACE_LINK_LIBRARIES)
+
+ if (CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+ get_target_property(_curl_location_debug CURL::libcurl IMPORTED_IMPLIB_DEBUG)
+ get_target_property(_curl_location_release CURL::libcurl IMPORTED_IMPLIB_RELEASE)
+ endif()
+
+ if(NOT _curl_location_debug AND NOT _curl_location_release)
+ get_target_property(_curl_location_debug CURL::libcurl IMPORTED_LOCATION_DEBUG)
+ get_target_property(_curl_location_release CURL::libcurl IMPORTED_LOCATION_RELEASE)
+ endif()
+
+ if(NOT _curl_link_libraries)
+ set(_curl_link_libraries)
+ endif()
+
+ set(CURL_INCLUDE_DIRS "${_curl_include_dirs}")
+ set(CURL_LIBRARY_DEBUG "${_curl_location_debug}")
+ set(CURL_LIBRARY_RELEASE "${_curl_location_release}")
+
+ #For builds which rely on CURL_LIBRAR(Y/IES)
+ include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)
+ select_library_configurations(CURL)
+
+ set(CURL_LIBRARIES ${CURL_LIBRARY} ${_curl_link_libraries})
+ set(CURL_VERSION_STRING "${CURL_VERSION}")
+
+ set(_curl_include_dirs)
+ set(_curl_link_libraries)
+ set(_curl_location_debug)
+ set(_curl_location_release)
+endif()