mirror of https://github.com/microsoft/vcpkg.git
[vcpkg-ci-curl,curl,c-ares,libssh2,librtmp] Elaborate test, fix ports (#43463)
This commit is contained in:
parent
3de032f834
commit
0ed3bfe969
|
|
@ -1,3 +1,9 @@
|
|||
vcpkg_download_distfile(PKGCONFIG_EXPORT_PATCH
|
||||
URLS https://github.com/c-ares/c-ares/commit/d41db1b7916fadea987e5bb05fd4aafaf0d1d6ea.patch?full_index=1
|
||||
SHA512 a7f96fa0d10f44d0f5981cdeef741fb57228f61bb18a79d581c4f1a8df6ae54771b0fb9f7985a8429dc31c5c3506aa436e8240fdcd4c8503da98a4c7bdce4347
|
||||
FILENAME c-ares-pkgconfig-export-d41db1b7916fadea987e5bb05fd4aafaf0d1d6ea.patch
|
||||
)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO c-ares/c-ares
|
||||
|
|
@ -6,6 +12,7 @@ vcpkg_from_github(
|
|||
HEAD_REF main
|
||||
PATCHES
|
||||
avoid-docs.patch
|
||||
"${PKGCONFIG_EXPORT_PATCH}"
|
||||
)
|
||||
|
||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC)
|
||||
|
|
@ -22,9 +29,7 @@ vcpkg_cmake_configure(
|
|||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/c-ares)
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
|
|
@ -35,9 +40,6 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|||
)
|
||||
endif()
|
||||
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR NOT VCPKG_TARGET_IS_WINDOWS)
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") # Empty folders
|
||||
endif()
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
|
|
|
|||
|
|
@ -2,3 +2,8 @@ c-ares provides CMake targets:
|
|||
|
||||
find_package(c-ares CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE c-ares::cares)
|
||||
|
||||
c-ares provides pkg-config modules:
|
||||
|
||||
# asynchronous DNS lookup library
|
||||
libcares
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"name": "c-ares",
|
||||
"version-semver": "1.34.4",
|
||||
"port-version": 1,
|
||||
"description": "A C library for asynchronous DNS requests",
|
||||
"homepage": "https://github.com/c-ares/c-ares",
|
||||
"license": "MIT-CMU",
|
||||
|
|
|
|||
|
|
@ -1,15 +0,0 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 0cba6f6..851efaf 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -2129,7 +2129,9 @@ if(NOT CURL_DISABLE_INSTALL)
|
||||
set(_implicit_libs ${CMAKE_C_IMPLICIT_LINK_LIBRARIES})
|
||||
endif()
|
||||
|
||||
- foreach(_lib IN LISTS _implicit_libs _custom_libs CURL_LIBS)
|
||||
+ set(CURL_LIBS_FLAT "")
|
||||
+ vcpkg_curl_flatten(CURL_LIBS CURL_LIBS_FLAT)
|
||||
+ foreach(_lib IN LISTS CURL_LIBS_FLAT)
|
||||
if(TARGET "${_lib}")
|
||||
set(_libname "${_lib}")
|
||||
get_target_property(_imported "${_libname}" IMPORTED)
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index da69699..3a9b844 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -2042,8 +2042,10 @@ if(NOT CURL_DISABLE_INSTALL)
|
||||
set(LIBCURL_PC_CFLAGS "")
|
||||
else()
|
||||
set(ENABLE_SHARED "no")
|
||||
+ set(LIBCURL_PC_REQUIRES_PRIVATE "") # flattened into LIBCURL_PC_LIBS
|
||||
set(LIBCURL_PC_REQUIRES "${LIBCURL_PC_REQUIRES_PRIVATE}")
|
||||
set(LIBCURL_PC_LIBS "${LIBCURL_PC_LIBS_PRIVATE}")
|
||||
+ set(LIBCURL_PC_LIBS_PRIVATE "") # in LIBCURL_PC_LIBS
|
||||
set(LIBCURL_PC_CFLAGS "${LIBCURL_PC_CFLAGS_PRIVATE}")
|
||||
endif()
|
||||
if(BUILD_STATIC_LIBS)
|
||||
|
|
@ -6,92 +6,3 @@ endif()
|
|||
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
add_compile_definitions(_WINSOCK_DEPRECATED_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
# Process the libs and targets in the variable named by `input`
|
||||
# into a flat list of libs in the variable named by `output`.
|
||||
# Simplify -framework elements.
|
||||
# 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}}")
|
||||
else()
|
||||
string(REGEX REPLACE ";debug;[^;]*|;optimized" "" input_libs "VCPKG;${${input}}")
|
||||
endif()
|
||||
list(REMOVE_AT input_libs 0)
|
||||
while(input_libs)
|
||||
list(POP_BACK input_libs lib)
|
||||
string(REGEX REPLACE "^.<LINK_ONLY:(.*)>\$" "\\1" lib "${lib}")
|
||||
if(TARGET "${lib}")
|
||||
set(import_lib "")
|
||||
set(import_location "")
|
||||
get_target_property(type "${lib}" TYPE)
|
||||
if(NOT type STREQUAL "INTERFACE_LIBRARY")
|
||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
get_target_property(link_libs "${lib}" IMPORTED_LINK_INTERFACE_LIBRARIES_DEBUG)
|
||||
get_target_property(import_lib "${lib}" IMPORTED_IMPLIB_DEBUG)
|
||||
get_target_property(import_location "${lib}" IMPORTED_LOCATION_DEBUG)
|
||||
else()
|
||||
get_target_property(link_libs "${lib}" IMPORTED_LINK_INTERFACE_LIBRARIES_RELEASE)
|
||||
get_target_property(import_lib "${lib}" IMPORTED_IMPLIB_RELEASE)
|
||||
get_target_property(import_location "${lib}" IMPORTED_LOCATION_RELEASE)
|
||||
endif()
|
||||
if(link_libs)
|
||||
vcpkg_curl_flatten(link_libs output_libs)
|
||||
endif()
|
||||
get_target_property(link_libs "${lib}" IMPORTED_LINK_INTERFACE_LIBRARIES)
|
||||
if(link_libs)
|
||||
vcpkg_curl_flatten(link_libs output_libs)
|
||||
endif()
|
||||
if(NOT import_lib)
|
||||
get_target_property(import_lib "${lib}" IMPORTED_IMPLIB)
|
||||
endif()
|
||||
if(NOT import_location)
|
||||
get_target_property(import_location "${lib}" IMPORTED_LOCATION)
|
||||
endif()
|
||||
endif()
|
||||
get_target_property(link_libs "${lib}" INTERFACE_LINK_LIBRARIES)
|
||||
if(link_libs)
|
||||
vcpkg_curl_flatten(link_libs output_libs)
|
||||
endif()
|
||||
if(import_lib)
|
||||
set(lib "${import_lib}")
|
||||
elseif(import_location)
|
||||
set(lib "${import_location}")
|
||||
endif()
|
||||
endif()
|
||||
if(lib MATCHES "^(.*)/([^/]*)[.]framework$")
|
||||
if(CMAKE_MATCH_1 IN_LIST CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES)
|
||||
set(lib "-framework ${CMAKE_MATCH_2}")
|
||||
else()
|
||||
set(lib "-framework ${lib}")
|
||||
endif()
|
||||
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}([^/]*)${STATIC_LIBRARY_SUFFIX}\$")
|
||||
set(lib -l${CMAKE_MATCH_1})
|
||||
elseif(lib MATCHES ".*/${CMAKE_SHARED_LIBRARY_PREFIX}([^/]*)${SHARED_LIBRARY_SUFFIX}\$")
|
||||
set(lib -l${CMAKE_MATCH_1})
|
||||
endif()
|
||||
if(NOT "${lib}" IN_LIST output_libs)
|
||||
list(PREPEND output_libs "${lib}")
|
||||
endif()
|
||||
endwhile()
|
||||
set("${output}" "${output_libs}" PARENT_SCOPE)
|
||||
endfunction()
|
||||
|
||||
if(NOT CURL_DISABLE_LDAP AND NOT WIN32)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(LDAP REQUIRED ldap)
|
||||
set(HAVE_LIBLDAP 1)
|
||||
set(LDAP_INCLUDE_DIR "${LDAP_INCLUDE_DIRS}")
|
||||
set(LDAP_LIBRARY "${LDAP_LINK_LIBRARIES}" CACHE STRING "")
|
||||
pkg_check_modules(LBER REQUIRED lber)
|
||||
set(HAVE_LIBLBER 1)
|
||||
set(LDAP_LBER_LIBRARY "${LBER_LINK_LIBRARIES}" CACHE STRING "")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1,147 +1,152 @@
|
|||
diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in
|
||||
index aa9eb51..c290064 100644
|
||||
--- a/CMake/curl-config.cmake.in
|
||||
+++ b/CMake/curl-config.cmake.in
|
||||
@@ -38,6 +38,19 @@ if("@HAVE_LIBZ@")
|
||||
find_dependency(ZLIB "@ZLIB_VERSION_MAJOR@")
|
||||
endif()
|
||||
|
||||
+if("@USE_ARES@")
|
||||
+ find_dependency(c-ares CONFIG)
|
||||
+endif()
|
||||
+if("@USE_LIBSSH2@")
|
||||
+ find_dependency(libssh2 CONFIG)
|
||||
+endif()
|
||||
+if("@HAVE_BROTLI@")
|
||||
+ find_dependency(unofficial-brotli CONFIG)
|
||||
+endif()
|
||||
+if("@HAVE_ZSTD@")
|
||||
+ find_dependency(zstd CONFIG)
|
||||
+endif()
|
||||
+
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
||||
check_required_components("@PROJECT_NAME@")
|
||||
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index db3a5ee..a6604e9 100644
|
||||
index 0cba6f626..8398477da 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -267,7 +267,9 @@ set(LIBCURL_PC_REQUIRES_PRIVATE "")
|
||||
|
||||
if(ENABLE_ARES)
|
||||
set(USE_ARES 1)
|
||||
- find_package(Cares REQUIRED)
|
||||
+ find_package(CARES NAMES c-ares REQUIRED)
|
||||
+ set(CARES_INCLUDE_DIRS "")
|
||||
+ set(CARES_LIBRARIES c-ares::cares)
|
||||
list(APPEND CURL_LIBS ${CARES_LIBRARIES})
|
||||
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libcares")
|
||||
add_definitions("-DCARES_NO_DEPRECATED") # Ignore c-ares deprecation warnings
|
||||
@@ -685,17 +687,11 @@ if(CURL_USE_WOLFSSL)
|
||||
endif()
|
||||
|
||||
if(CURL_USE_GNUTLS)
|
||||
- if(CURL_USE_PKGCONFIG)
|
||||
- find_package(PkgConfig QUIET)
|
||||
- pkg_check_modules(GNUTLS "gnutls")
|
||||
- if(GNUTLS_FOUND)
|
||||
- set(GNUTLS_LIBRARIES ${GNUTLS_LINK_LIBRARIES})
|
||||
- endif()
|
||||
- endif()
|
||||
- if(NOT GNUTLS_FOUND)
|
||||
- find_package(GnuTLS REQUIRED)
|
||||
- endif()
|
||||
- find_package(Nettle REQUIRED)
|
||||
+ find_package(PkgConfig REQUIRED)
|
||||
+ pkg_check_modules(GNUTLS REQUIRED gnutls)
|
||||
+ set(GNUTLS_LIBRARIES "${GNUTLS_LINK_LIBRARIES}")
|
||||
+ pkg_check_modules(NETTLE REQUIRED nettle)
|
||||
+ set(NETTLE_LIBRARIES "${NETTLE_LINK_LIBRARIES}")
|
||||
@@ -660,7 +660,7 @@ if(CURL_USE_MBEDTLS)
|
||||
find_package(MbedTLS REQUIRED)
|
||||
set(_ssl_enabled ON)
|
||||
set(USE_MBEDTLS ON)
|
||||
- list(APPEND CURL_LIBS ${MBEDTLS_LIBRARIES})
|
||||
+ list(APPEND CURL_LIBS ${MBEDTLS_LINK_LIBRARIES})
|
||||
list(APPEND CURL_LIBDIRS ${MBEDTLS_LIBRARY_DIRS})
|
||||
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ${MBEDTLS_PC_REQUIRES})
|
||||
include_directories(SYSTEM ${MBEDTLS_INCLUDE_DIRS})
|
||||
@@ -694,7 +694,7 @@ if(CURL_USE_WOLFSSL)
|
||||
find_package(WolfSSL REQUIRED)
|
||||
set(_ssl_enabled ON)
|
||||
set(USE_WOLFSSL ON)
|
||||
- list(APPEND CURL_LIBS ${WOLFSSL_LIBRARIES})
|
||||
+ list(APPEND CURL_LIBS ${WOLFSSL_LINK_LIBRARIES})
|
||||
list(APPEND CURL_LIBDIRS ${WOLFSSL_LIBRARY_DIRS})
|
||||
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "wolfssl")
|
||||
include_directories(SYSTEM ${WOLFSSL_INCLUDE_DIRS})
|
||||
@@ -723,8 +723,8 @@ if(CURL_USE_GNUTLS)
|
||||
find_package(Nettle REQUIRED)
|
||||
set(_ssl_enabled ON)
|
||||
set(USE_GNUTLS ON)
|
||||
list(APPEND CURL_LIBS ${GNUTLS_LIBRARIES} ${NETTLE_LIBRARIES})
|
||||
@@ -761,7 +757,9 @@ endif()
|
||||
option(CURL_BROTLI "Use brotli" OFF)
|
||||
set(HAVE_BROTLI OFF)
|
||||
if(CURL_BROTLI)
|
||||
- find_package(Brotli REQUIRED)
|
||||
+ find_package(BROTLI NAMES unofficial-brotli REQUIRED)
|
||||
+ set(BROTLI_INCLUDE_DIRS "")
|
||||
+ set(BROTLI_LIBRARIES "unofficial::brotli::brotlidec")
|
||||
- list(APPEND CURL_LIBS ${GNUTLS_LIBRARIES} ${NETTLE_LIBRARIES})
|
||||
- list(APPEND CURL_LIBDIRS ${NETTLE_LIBRARY_DIRS})
|
||||
+ list(APPEND CURL_LIBS ${GNUTLS_LINK_LIBRARIES} ${NETTLE_LINK_LIBRARIES})
|
||||
+ list(APPEND CURL_LIBDIRS ${GNUTLS_LIBRARY_DIRS} ${NETTLE_LIBRARY_DIRS})
|
||||
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "gnutls" "nettle")
|
||||
include_directories(SYSTEM ${GNUTLS_INCLUDE_DIRS} ${NETTLE_INCLUDE_DIRS})
|
||||
link_directories(${NETTLE_LIBRARY_DIRS})
|
||||
@@ -789,7 +789,7 @@ if(CURL_BROTLI)
|
||||
find_package(Brotli REQUIRED)
|
||||
if(BROTLI_FOUND)
|
||||
set(HAVE_BROTLI ON)
|
||||
list(APPEND CURL_LIBS ${BROTLI_LIBRARIES})
|
||||
@@ -773,7 +771,9 @@ endif()
|
||||
option(CURL_ZSTD "Use zstd" OFF)
|
||||
set(HAVE_ZSTD OFF)
|
||||
if(CURL_ZSTD)
|
||||
- find_package(Zstd REQUIRED)
|
||||
+ find_package(ZSTD NAMES zstd REQUIRED)
|
||||
+ set(ZSTD_INCLUDE_DIRS "")
|
||||
+ set(ZSTD_LIBRARIES zstd::libzstd)
|
||||
- list(APPEND CURL_LIBS ${BROTLI_LIBRARIES})
|
||||
+ list(APPEND CURL_LIBS ${PC_BROTLI_LINK_LIBRARIES})
|
||||
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libbrotlidec")
|
||||
include_directories(SYSTEM ${BROTLI_INCLUDE_DIRS})
|
||||
endif()
|
||||
@@ -801,7 +801,7 @@ if(CURL_ZSTD)
|
||||
find_package(Zstd REQUIRED)
|
||||
if(ZSTD_FOUND AND NOT ZSTD_VERSION VERSION_LESS 1.0.0)
|
||||
set(HAVE_ZSTD ON)
|
||||
list(APPEND CURL_LIBS ${ZSTD_LIBRARIES})
|
||||
@@ -1104,7 +1104,9 @@ option(USE_LIBIDN2 "Use libidn2 for IDN support" ON)
|
||||
set(HAVE_IDN2_H OFF)
|
||||
set(HAVE_LIBIDN2 OFF)
|
||||
- list(APPEND CURL_LIBS ${ZSTD_LIBRARIES})
|
||||
+ list(APPEND CURL_LIBS ${PC_ZSTD_LINK_LIBRARIES})
|
||||
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libzstd")
|
||||
include_directories(SYSTEM ${ZSTD_INCLUDE_DIRS})
|
||||
else()
|
||||
@@ -899,7 +899,7 @@ if(USE_NGHTTP2)
|
||||
find_package(NGHTTP2)
|
||||
if(NGHTTP2_FOUND)
|
||||
include_directories(SYSTEM ${NGHTTP2_INCLUDE_DIRS})
|
||||
- list(APPEND CURL_LIBS ${NGHTTP2_LIBRARIES})
|
||||
+ list(APPEND CURL_LIBS ${PC_NGHTTP2_LINK_LIBRARIES})
|
||||
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libnghttp2")
|
||||
else()
|
||||
set(USE_NGHTTP2 OFF)
|
||||
@@ -927,13 +927,13 @@ if(USE_NGTCP2)
|
||||
message(FATAL_ERROR "ngtcp2 requires OpenSSL, wolfSSL or GnuTLS")
|
||||
endif()
|
||||
include_directories(SYSTEM ${NGTCP2_INCLUDE_DIRS})
|
||||
- list(APPEND CURL_LIBS ${NGTCP2_LIBRARIES})
|
||||
+ list(APPEND CURL_LIBS ${PC_NGTCP2_LINK_LIBRARIES})
|
||||
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libngtcp2")
|
||||
|
||||
find_package(NGHTTP3 REQUIRED)
|
||||
set(USE_NGHTTP3 ON)
|
||||
include_directories(SYSTEM ${NGHTTP3_INCLUDE_DIRS})
|
||||
- list(APPEND CURL_LIBS ${NGHTTP3_LIBRARIES})
|
||||
+ list(APPEND CURL_LIBS ${PC_NGHTTP3_LINK_LIBRARIES})
|
||||
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libnghttp3")
|
||||
endif()
|
||||
|
||||
@@ -1020,6 +1020,15 @@ if(NOT CURL_DISABLE_LDAP)
|
||||
|
||||
# Now that we know, we are not using Windows LDAP...
|
||||
if(NOT USE_WIN32_LDAP)
|
||||
+ find_package(PkgConfig REQUIRED)
|
||||
+ pkg_check_modules(LDAP REQUIRED ldap)
|
||||
+ set(LDAP_INCLUDE_DIR "${LDAP_INCLUDE_DIRS}")
|
||||
+ set(LDAP_LIBRARY "${LDAP_LINK_LIBRARIES}" CACHE STRING "")
|
||||
+ list(APPEND LIBCURL_PC_REQUIRES_PRIVATE ldap)
|
||||
+ pkg_check_modules(LBER REQUIRED lber)
|
||||
+ set(HAVE_LIBLBER 1)
|
||||
+ set(LDAP_LBER_LIBRARY "${LBER_LINK_LIBRARIES}" CACHE STRING "")
|
||||
+ list(APPEND LIBCURL_PC_REQUIRES_PRIVATE lber)
|
||||
if(NOT DEFINED LDAP_LIBRARY)
|
||||
set(LDAP_LIBRARY "ldap" CACHE STRING "Name or full path to ldap library")
|
||||
endif()
|
||||
@@ -1132,7 +1141,7 @@ set(HAVE_LIBIDN2 OFF)
|
||||
if(USE_LIBIDN2 AND NOT USE_APPLE_IDN AND NOT USE_WIN32_IDN)
|
||||
- find_package(Libidn2)
|
||||
+ find_package(PkgConfig REQUIRED)
|
||||
+ pkg_check_modules(LIBIDN2 REQUIRED libidn2)
|
||||
+ set(LIBIDN2_LIBRARIES "${LIBIDN2_LINK_LIBRARIES}")
|
||||
find_package(Libidn2)
|
||||
if(LIBIDN2_FOUND)
|
||||
set(CURL_LIBS "${LIBIDN2_LIBRARIES};${CURL_LIBS}")
|
||||
- set(CURL_LIBS "${LIBIDN2_LIBRARIES};${CURL_LIBS}")
|
||||
+ set(CURL_LIBS "${LIBIDN2_LINK_LIBRARIES};${CURL_LIBS}")
|
||||
list(APPEND CURL_LIBDIRS ${LIBIDN2_LIBRARY_DIRS})
|
||||
@@ -1125,7 +1127,17 @@ mark_as_advanced(CURL_USE_LIBPSL)
|
||||
set(USE_LIBPSL OFF)
|
||||
|
||||
set(LIBCURL_PC_REQUIRES_PRIVATE "libidn2;${LIBCURL_PC_REQUIRES_PRIVATE}")
|
||||
include_directories(SYSTEM ${LIBIDN2_INCLUDE_DIRS})
|
||||
@@ -1153,7 +1162,7 @@ set(USE_LIBPSL OFF)
|
||||
if(CURL_USE_LIBPSL)
|
||||
- find_package(Libpsl) # TODO: add REQUIRED to match autotools
|
||||
+ find_package(PkgConfig REQUIRED)
|
||||
+ pkg_check_modules(LIBPSL REQUIRED libpsl)
|
||||
+ # 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)
|
||||
+ string(TOLOWER "${lib}" lib_lower)
|
||||
+ if(lib_lower MATCHES win32_standard_libraries)
|
||||
+ list(REMOVE_ITEM LIBPSL_LINK_LIBRARIES "${lib}")
|
||||
+ endif()
|
||||
+ endforeach()
|
||||
+ set(LIBPSL_LIBRARIES "${LIBPSL_LINK_LIBRARIES}")
|
||||
find_package(Libpsl) # TODO: add REQUIRED to match autotools
|
||||
if(LIBPSL_FOUND)
|
||||
list(APPEND CURL_LIBS ${LIBPSL_LIBRARIES})
|
||||
- list(APPEND CURL_LIBS ${LIBPSL_LIBRARIES})
|
||||
+ list(APPEND CURL_LIBS ${PC_LIBPSL_LINK_LIBRARIES})
|
||||
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libpsl")
|
||||
@@ -1142,7 +1154,9 @@ mark_as_advanced(CURL_USE_LIBSSH2)
|
||||
set(USE_LIBSSH2 OFF)
|
||||
|
||||
include_directories(SYSTEM ${LIBPSL_INCLUDE_DIRS})
|
||||
set(USE_LIBPSL ON)
|
||||
@@ -1170,7 +1179,7 @@ set(USE_LIBSSH2 OFF)
|
||||
if(CURL_USE_LIBSSH2)
|
||||
- find_package(Libssh2)
|
||||
+ find_package(LIBSSH2 NAMES libssh2 REQUIRED)
|
||||
+ set(LIBSSH2_LIBRARIES libssh2::libssh2)
|
||||
+ get_target_property(LIBSSH2_INCLUDE_DIRS "${LIBSSH2_LIBRARIES}" INTERFACE_INCLUDE_DIRECTORIES)
|
||||
find_package(Libssh2)
|
||||
if(LIBSSH2_FOUND)
|
||||
list(APPEND CURL_LIBS ${LIBSSH2_LIBRARIES})
|
||||
- list(APPEND CURL_LIBS ${LIBSSH2_LIBRARIES})
|
||||
+ list(APPEND CURL_LIBS ${PC_LIBSSH2_LINK_LIBRARIES})
|
||||
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libssh2")
|
||||
@@ -1189,7 +1203,8 @@ endif()
|
||||
option(CURL_USE_GSASL "Use libgsasl" OFF)
|
||||
mark_as_advanced(CURL_USE_GSASL)
|
||||
include_directories(SYSTEM ${LIBSSH2_INCLUDE_DIRS})
|
||||
set(USE_LIBSSH2 ON)
|
||||
@@ -1217,7 +1226,7 @@ mark_as_advanced(CURL_USE_GSASL)
|
||||
if(CURL_USE_GSASL)
|
||||
- find_package(Libgsasl REQUIRED)
|
||||
+ find_package(PkgConfig REQUIRED)
|
||||
+ pkg_check_modules(GSASL REQUIRED libgsasl)
|
||||
find_package(Libgsasl REQUIRED)
|
||||
if(LIBGSASL_FOUND)
|
||||
list(APPEND CURL_LIBS ${LIBGSASL_LIBRARIES})
|
||||
- list(APPEND CURL_LIBS ${LIBGSASL_LIBRARIES})
|
||||
+ list(APPEND CURL_LIBS ${LIBGSASL_LINK_LIBRARIES})
|
||||
list(APPEND CURL_LIBDIRS ${LIBGSASL_LIBRARY_DIRS})
|
||||
@@ -1207,7 +1222,10 @@ option(CURL_USE_GSSAPI "Use GSSAPI implementation" OFF)
|
||||
mark_as_advanced(CURL_USE_GSSAPI)
|
||||
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "libgsasl")
|
||||
include_directories(SYSTEM ${LIBGSASL_INCLUDE_DIRS})
|
||||
@@ -1234,6 +1243,10 @@ mark_as_advanced(CURL_USE_GSSAPI)
|
||||
|
||||
if(CURL_USE_GSSAPI)
|
||||
- find_package(GSS)
|
||||
+ find_package(PkgConfig REQUIRED)
|
||||
+ pkg_check_modules(GSS REQUIRED krb5-gssapi)
|
||||
+ pkg_get_variable(GSS_FLAVOUR krb5-gssapi vendor)
|
||||
+ list(APPEND GSS_LINK_LIBRARIES resolv) # Fixme: move to krb5 pc files
|
||||
find_package(GSS)
|
||||
+ if(GSS_FLAVOUR STREQUAL "MIT")
|
||||
+ pkg_check_modules(GSS REQUIRED mit-krb5-gssapi)
|
||||
+ set(GSS_LIBRARIES "${GSS_LINK_LIBRARIES}")
|
||||
+ endif()
|
||||
|
||||
set(HAVE_GSSAPI ${GSS_FOUND})
|
||||
if(GSS_FOUND)
|
||||
@@ -1309,6 +1322,12 @@ endif()
|
||||
|
||||
option(USE_LIBRTMP "Enable librtmp from rtmpdump" OFF)
|
||||
if(USE_LIBRTMP)
|
||||
+ find_package(PkgConfig REQUIRED)
|
||||
+ pkg_check_modules(LIBRTMP REQUIRED librtmp)
|
||||
+ include_directories(SYSTEM ${LIBRTMP_INCLUDE_DIRECTORIES})
|
||||
+ list(APPEND CURL_LIBS ${LIBRTMP_LINK_LIBRARIES})
|
||||
+ list(APPEND LIBCURL_PC_REQUIRES_PRIVATE librtmp)
|
||||
+elseif(0)
|
||||
set(_extra_libs "rtmp")
|
||||
if(WIN32)
|
||||
list(APPEND _extra_libs "winmm")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,120 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 0cba6f626..02ead7e23 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -2118,6 +2118,7 @@ if(NOT CURL_DISABLE_INSTALL)
|
||||
endforeach()
|
||||
|
||||
foreach(_libdir IN LISTS _custom_libdirs CURL_LIBDIRS)
|
||||
+ cmake_path(SET _libdir NORMALIZE "${_libdir}")
|
||||
list(FIND _sys_libdirs "${_libdir}" _libdir_index)
|
||||
if(_libdir_index LESS 0)
|
||||
list(APPEND _ldflags "-L${_libdir}")
|
||||
@@ -2129,7 +2130,30 @@ if(NOT CURL_DISABLE_INSTALL)
|
||||
set(_implicit_libs ${CMAKE_C_IMPLICIT_LINK_LIBRARIES})
|
||||
endif()
|
||||
|
||||
- foreach(_lib IN LISTS _implicit_libs _custom_libs CURL_LIBS)
|
||||
+ find_package(PkgConfig)
|
||||
+ pkg_check_modules(CURL_PC_REQUIRED REQUIRED ${LIBCURL_PC_REQUIRES_PRIVATE})
|
||||
+ # Libs which are resolved by pkg-config via Requires (LIBCURL_PC_REQUIRES_PRIVATE)
|
||||
+ # don't need to be written to `libcurl.pc` (LIBCURL_PC_LIBS_PRIVATE),
|
||||
+ # but still need to be written `to curl-config` (CURL_CONFIG_LIBS_PRIVATE)
|
||||
+ set(CURL_CONFIG_LIBS_PRIVATE "")
|
||||
+
|
||||
+ # Imported multi-config targets in CURL_LIBS can't be exported easily to
|
||||
+ # `libcurl.pc` and `curl-config`. Export link libraries as used by pkg-config.
|
||||
+ set(curl_libs "${CURL_LIBS}")
|
||||
+ if(ZLIB::ZLIB IN_LIST CURL_LIBS)
|
||||
+ pkg_check_modules(CURL_PC_ZLIB REQUIRED zlib)
|
||||
+ string(REPLACE "ZLIB::ZLIB" "${CURL_PC_ZLIB_LINK_LIBRARIES}" curl_libs "${curl_libs}")
|
||||
+ endif()
|
||||
+ if(OpenSSL::SSL IN_LIST CURL_LIBS)
|
||||
+ pkg_check_modules(CURL_PC_LIBSSL REQUIRED libssl)
|
||||
+ string(REPLACE "OpenSSL::SSL" "${CURL_PC_LIBSSL_LINK_LIBRARIES}" curl_libs "${curl_libs}")
|
||||
+ endif()
|
||||
+ if(OpenSSL::Crypto IN_LIST CURL_LIBS)
|
||||
+ pkg_check_modules(CURL_PC_LIBCRYPTO REQUIRED libcrypto)
|
||||
+ string(REPLACE "OpenSSL::Crypto" "${CURL_PC_LIBCRYPTO_LINK_LIBRARIES}" curl_libs "${curl_libs}")
|
||||
+ endif()
|
||||
+
|
||||
+ foreach(_lib IN LISTS _custom_libs curl_libs)
|
||||
if(TARGET "${_lib}")
|
||||
set(_libname "${_lib}")
|
||||
get_target_property(_imported "${_libname}" IMPORTED)
|
||||
@@ -2144,6 +2168,10 @@ if(NOT CURL_DISABLE_INSTALL)
|
||||
continue()
|
||||
endif()
|
||||
endif()
|
||||
+ set(out_list LIBCURL_PC_LIBS_PRIVATE)
|
||||
+ if(_lib IN_LIST CURL_PC_REQUIRED_LINK_LIBRARIES)
|
||||
+ set(out_list CURL_CONFIG_LIBS_PRIVATE)
|
||||
+ endif()
|
||||
if(_lib MATCHES "^-") # '-framework <name>'
|
||||
list(APPEND _ldflags "${_lib}")
|
||||
elseif(_lib MATCHES ".*/.*")
|
||||
@@ -2152,17 +2180,24 @@ if(NOT CURL_DISABLE_INSTALL)
|
||||
get_filename_component(_libdir ${_lib} DIRECTORY)
|
||||
get_filename_component(_libname ${_lib} NAME_WE)
|
||||
if(_libname MATCHES "^lib")
|
||||
+ cmake_path(SET _libdir NORMALIZE "${_libdir}")
|
||||
list(FIND _sys_libdirs "${_libdir}" _libdir_index)
|
||||
if(_libdir_index LESS 0)
|
||||
list(APPEND _ldflags "-L${_libdir}")
|
||||
endif()
|
||||
string(REGEX REPLACE "^lib" "" _libname "${_libname}")
|
||||
- list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_libname}")
|
||||
+ list(APPEND ${out_list} "-l${_libname}")
|
||||
+ if(TARGET "${LIB_STATIC}" AND _libdir IN_LIST CMAKE_C_IMPLICIT_LINK_DIRECTORIES)
|
||||
+ # Avoid absolute path to system lib in exported CMake config
|
||||
+ get_target_property(static_link_libs "${LIB_STATIC}" INTERFACE_LINK_LIBRARIES)
|
||||
+ string(REPLACE "${_lib}" "${_libname}" static_link_libs "${static_link_libs}")
|
||||
+ set_target_properties("${LIB_STATIC}" PROPERTIES INTERFACE_LINK_LIBRARIES "${static_link_libs}")
|
||||
+ endif()
|
||||
else()
|
||||
- list(APPEND LIBCURL_PC_LIBS_PRIVATE "${_lib}")
|
||||
+ list(APPEND ${out_list} "${_lib}")
|
||||
endif()
|
||||
else()
|
||||
- list(APPEND LIBCURL_PC_LIBS_PRIVATE "-l${_lib}")
|
||||
+ list(APPEND ${out_list} "-l${_lib}")
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
@@ -2188,11 +2223,11 @@ if(NOT CURL_DISABLE_INSTALL)
|
||||
set(LIBCURL_PC_REQUIRES "")
|
||||
set(LIBCURL_PC_LIBS "")
|
||||
set(LIBCURL_PC_CFLAGS "")
|
||||
+ set(CURL_CONFIG_LIBS_PRIVATE "")
|
||||
else()
|
||||
+ string(REPLACE ";" " " CURL_CONFIG_LIBS_PRIVATE "${CURL_CONFIG_LIBS_PRIVATE}")
|
||||
set(ENABLE_SHARED "no")
|
||||
- set(LIBCURL_PC_REQUIRES "${LIBCURL_PC_REQUIRES_PRIVATE}")
|
||||
- set(LIBCURL_PC_LIBS "${LIBCURL_PC_LIBS_PRIVATE}")
|
||||
- set(LIBCURL_PC_CFLAGS "${LIBCURL_PC_CFLAGS_PRIVATE}")
|
||||
+ # (processing by vcpkg_fixup_pkgconfig)
|
||||
endif()
|
||||
if(BUILD_STATIC_LIBS)
|
||||
set(ENABLE_STATIC "yes")
|
||||
diff --git a/curl-config.in b/curl-config.in
|
||||
index e89c25639..e389f0d52 100644
|
||||
--- a/curl-config.in
|
||||
+++ b/curl-config.in
|
||||
@@ -161,7 +161,7 @@ while test "$#" -gt 0; do
|
||||
CURLLIBDIR=''
|
||||
fi
|
||||
if test 'X@ENABLE_SHARED@' = 'Xno'; then
|
||||
- echo "${CURLLIBDIR}-lcurl @LIBCURL_PC_LIBS_PRIVATE@"
|
||||
+ echo "@libdir@/libcurl.@libext@ @LIBCURL_PC_LDFLAGS_PRIVATE@ @CURL_CONFIG_LIBS_PRIVATE@ @LIBCURL_PC_LIBS_PRIVATE@"
|
||||
else
|
||||
echo "${CURLLIBDIR}-lcurl"
|
||||
fi
|
||||
@@ -173,7 +173,7 @@ while test "$#" -gt 0; do
|
||||
|
||||
--static-libs)
|
||||
if test 'X@ENABLE_STATIC@' != 'Xno'; then
|
||||
- echo "@libdir@/libcurl.@libext@ @LIBCURL_PC_LDFLAGS_PRIVATE@ @LIBCURL_PC_LIBS_PRIVATE@"
|
||||
+ echo "@libdir@/libcurl.@libext@ @LIBCURL_PC_LDFLAGS_PRIVATE@ @CURL_CONFIG_LIBS_PRIVATE@ @LIBCURL_PC_LIBS_PRIVATE@"
|
||||
else
|
||||
echo 'curl was built with static libraries disabled' >&2
|
||||
exit 1
|
||||
|
|
@ -8,17 +8,14 @@ vcpkg_from_github(
|
|||
HEAD_REF master
|
||||
PATCHES
|
||||
0005_remove_imp_suffix.patch
|
||||
0020-fix-pc-file.patch
|
||||
0022-deduplicate-libs.patch
|
||||
export-components.patch
|
||||
dependencies.patch
|
||||
pkgconfig-curl-config.patch
|
||||
cmake-config.patch
|
||||
rtmp.patch
|
||||
)
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
# Support HTTP2 TLS Download https://curl.haxx.se/ca/cacert.pem rename to curl-ca-bundle.crt, copy it to libcurl.dll location.
|
||||
http2 USE_NGHTTP2
|
||||
wolfssl CURL_USE_WOLFSSL
|
||||
openssl CURL_USE_OPENSSL
|
||||
|
|
@ -75,8 +72,9 @@ vcpkg_cmake_configure(
|
|||
${OPTIONS}
|
||||
-DBUILD_TESTING=OFF
|
||||
-DENABLE_CURL_MANUAL=OFF
|
||||
-DSHARE_LIB_OBJECT=OFF
|
||||
-DCURL_CA_FALLBACK=ON
|
||||
-DCURL_USE_PKGCONFIG=OFF
|
||||
-DCURL_USE_PKGCONFIG=ON
|
||||
-DCMAKE_DISABLE_FIND_PACKAGE_Perl=ON
|
||||
MAYBE_UNUSED_VARIABLES
|
||||
PKG_CONFIG_EXECUTABLE
|
||||
|
|
@ -110,6 +108,7 @@ if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/bin/curl-config")
|
|||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "${CURRENT_PACKAGES_DIR}" "\${prefix}")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "${CURRENT_INSTALLED_DIR}" "\${prefix}" IGNORE_UNCHANGED)
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "\nprefix='\${prefix}/debug'" [=[prefix=$(CDPATH= cd -- "$(dirname -- "$0")"/../../../.. && pwd -P)]=])
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "\nexec_prefix=\"\${prefix}\"" "\nexec_prefix=\"\${prefix}/debug\"")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "-lcurl" "-l${namespec}-d")
|
||||
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "curl." "curl-d.")
|
||||
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin")
|
||||
|
|
|
|||
|
|
@ -1,31 +0,0 @@
|
|||
diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in
|
||||
index 9a2559722c..bd25f61a92 100644
|
||||
--- a/CMake/curl-config.cmake.in
|
||||
+++ b/CMake/curl-config.cmake.in
|
||||
@@ -50,6 +50,10 @@ endif()
|
||||
if("@HAVE_ZSTD@")
|
||||
find_dependency(zstd CONFIG)
|
||||
endif()
|
||||
+if("@USE_LIBRTMP@")
|
||||
+ find_dependency(PkgConfig)
|
||||
+ pkg_check_modules(librtmp REQUIRED IMPORTED_TARGET librtmp)
|
||||
+endif()
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
||||
check_required_components("@PROJECT_NAME@")
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 0cba6f626b..fa497f2b70 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -1309,6 +1309,11 @@ endif()
|
||||
|
||||
option(USE_LIBRTMP "Enable librtmp from rtmpdump" OFF)
|
||||
if(USE_LIBRTMP)
|
||||
+ find_package(PkgConfig REQUIRED)
|
||||
+ pkg_check_modules(librtmp REQUIRED IMPORTED_TARGET librtmp)
|
||||
+ list(APPEND CURL_LIBS PkgConfig::librtmp)
|
||||
+ list(APPEND LIBCURL_PC_REQUIRES_PRIVATE rtmp)
|
||||
+elseif(0)
|
||||
set(_extra_libs "rtmp")
|
||||
if(WIN32)
|
||||
list(APPEND _extra_libs "winmm")
|
||||
|
|
@ -28,23 +28,6 @@ if(CURL_FOUND)
|
|||
if(_curl_link_libraries MATCHES "OpenSSL::")
|
||||
string(REGEX REPLACE "([\$]<[^;]*)?OpenSSL::(SSL|Crypto)([^;]*>)?" "${OPENSSL_LIBRARIES}" _curl_link_libraries "${_curl_link_libraries}")
|
||||
endif()
|
||||
if(_curl_link_libraries MATCHES "libssh2::libssh2")
|
||||
# TODO: move find_dependency(Libssh2 CONFIG) into CURL config
|
||||
set(_libssh2_target "${CMAKE_MATCH_0}")
|
||||
find_package(Libssh2 CONFIG QUIET)
|
||||
get_target_property(_libssh2_LIBRARY_DEBUG "${_libssh2_target}" IMPORTED_IMPLIB_DEBUG)
|
||||
get_target_property(_libssh2_LIBRARY_RELEASE "${_libssh2_target}" IMPORTED_IMPLIB_RELEASE)
|
||||
if(NOT IMPORTED_IMPLIB_DEBUG AND NOT IMPORTED_IMPLIB_RELEASE)
|
||||
get_target_property(_libssh2_LIBRARY_DEBUG "${_libssh2_target}" IMPORTED_LOCATION_DEBUG)
|
||||
get_target_property(_libssh2_LIBRARY_RELEASE "${_libssh2_target}" IMPORTED_LOCATION_RELEASE)
|
||||
endif()
|
||||
select_library_configurations(_libssh2)
|
||||
string(REGEX REPLACE "([\$]<[^;]*)?${_libssh2_target}([^;]*>)?" "${_libssh2_LIBRARIES}" _curl_link_libraries "${_curl_link_libraries}")
|
||||
unset(_libssh2_LIBRARIES)
|
||||
unset(_libssh2_LIBRARY_DEBUG)
|
||||
unset(_libssh2_LIBRARY_RELEASE)
|
||||
unset(_libssh2_target)
|
||||
endif()
|
||||
if(_curl_link_libraries MATCHES "::")
|
||||
message(WARNING "CURL_LIBRARIES list at least one target. This will not work for use cases where targets are not resolved.")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "curl",
|
||||
"version": "8.11.1",
|
||||
"port-version": 1,
|
||||
"port-version": 2,
|
||||
"description": "A library for transferring data with URLs",
|
||||
"homepage": "https://curl.se/",
|
||||
"license": "curl AND ISC AND BSD-3-Clause",
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@ find_package(OpenSSL REQUIRED)
|
|||
include_directories(${ZLIB_INCLUDE_DIRS})
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
|
||||
set(CMAKE_DEBUG_POSTFIX "d")
|
||||
|
||||
if(MSVC)
|
||||
add_definitions(-D_CRT_SECURE_NO_DEPRECATE)
|
||||
add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE)
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"name": "librtmp",
|
||||
"version-date": "2024-03-01",
|
||||
"port-version": 1,
|
||||
"description": "RTMPDump Real-Time Messaging Protocol API",
|
||||
"homepage": "https://rtmpdump.mplayerhq.hu",
|
||||
"dependencies": [
|
||||
|
|
|
|||
|
|
@ -0,0 +1,103 @@
|
|||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 6b51ac6..d8d5701 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -310,6 +310,8 @@ if(CRYPTO_BACKEND STREQUAL "OpenSSL" OR NOT CRYPTO_BACKEND)
|
||||
list(APPEND LIBSSH2_LIBS OpenSSL::Crypto)
|
||||
list(APPEND LIBSSH2_PC_REQUIRES_PRIVATE "libcrypto")
|
||||
|
||||
+ endif()
|
||||
+ if(0) # covered by OpenSSL wrapper
|
||||
if(WIN32)
|
||||
# Statically linking to OpenSSL requires crypt32 for some Windows APIs.
|
||||
# This should really be handled by FindOpenSSL.cmake.
|
||||
diff --git a/cmake/libssh2-config.cmake.in b/cmake/libssh2-config.cmake.in
|
||||
index edc86d7..905e4a2 100644
|
||||
--- a/cmake/libssh2-config.cmake.in
|
||||
+++ b/cmake/libssh2-config.cmake.in
|
||||
@@ -14,7 +14,7 @@ elseif("@CRYPTO_BACKEND@" STREQUAL "mbedTLS")
|
||||
find_dependency(MbedTLS)
|
||||
endif()
|
||||
|
||||
-if(@ZLIB_FOUND@)
|
||||
+if(@ENABLE_ZLIB_COMPRESSION@)
|
||||
find_dependency(ZLIB)
|
||||
endif()
|
||||
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index 512c64e..c50ce6a 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -63,7 +63,8 @@ if(ENABLE_ZLIB_COMPRESSION)
|
||||
find_package(ZLIB REQUIRED)
|
||||
|
||||
list(APPEND libssh2_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS})
|
||||
- list(APPEND LIBSSH2_LIBS ${ZLIB_LIBRARIES})
|
||||
+ # Avoid multi-config string. Same pattern as in curl.
|
||||
+ list(APPEND LIBSSH2_LIBS ZLIB::ZLIB)
|
||||
list(APPEND LIBSSH2_PC_REQUIRES_PRIVATE "zlib")
|
||||
if(ZLIB_FOUND)
|
||||
list(APPEND _libssh2_definitions "LIBSSH2_HAVE_ZLIB")
|
||||
@@ -229,6 +230,7 @@ foreach(_libdir IN LISTS CMAKE_SYSTEM_PREFIX_PATH)
|
||||
endforeach()
|
||||
|
||||
foreach(_libdir IN LISTS LIBSSH2_LIBDIRS)
|
||||
+ cmake_path(SET _libdir NORMALIZE "${_libdir}")
|
||||
list(FIND _sys_libdirs "${_libdir}" _libdir_index)
|
||||
if(_libdir_index LESS 0)
|
||||
list(APPEND _ldflags "-L${_libdir}")
|
||||
@@ -240,7 +242,13 @@ if(NOT MINGW AND NOT UNIX)
|
||||
set(_implicit_libs ${CMAKE_C_IMPLICIT_LINK_LIBRARIES})
|
||||
endif()
|
||||
|
||||
-foreach(_lib IN LISTS _implicit_libs LIBSSH2_LIBS)
|
||||
+find_package(PkgConfig)
|
||||
+pkg_check_modules(LIBSSH2_PC_REQUIRED REQUIRED ${LIBSSH2_PC_REQUIRES_PRIVATE})
|
||||
+# Libs which are resolved by pkg-config via Requires (LIBSSH2_PC_REQUIRES_PRIVATE)
|
||||
+# don't need to be written to `libssh2.pc` (LIBSSH2_PC_LIBS_PRIVATE)
|
||||
+list(REMOVE_ITEM LIBSSH2_LIBS ZLIB::ZLIB OpenSSL::Crypto)
|
||||
+
|
||||
+foreach(_lib IN LISTS LIBSSH2_LIBS)
|
||||
if(TARGET "${_lib}")
|
||||
set(_libname "${_lib}")
|
||||
get_target_property(_imported "${_libname}" IMPORTED)
|
||||
@@ -255,6 +263,9 @@ foreach(_lib IN LISTS _implicit_libs LIBSSH2_LIBS)
|
||||
continue()
|
||||
endif()
|
||||
endif()
|
||||
+ if(_lib IN_LIST LIBSSH2_PC_REQUIRED_LINK_LIBRARIES)
|
||||
+ continue()
|
||||
+ endif()
|
||||
if(_lib MATCHES "^-")
|
||||
list(APPEND _ldflags "${_lib}")
|
||||
elseif(_lib MATCHES ".*/.*")
|
||||
@@ -263,12 +274,19 @@ foreach(_lib IN LISTS _implicit_libs LIBSSH2_LIBS)
|
||||
get_filename_component(_libdir ${_lib} DIRECTORY)
|
||||
get_filename_component(_libname ${_lib} NAME_WE)
|
||||
if(_libname MATCHES "^lib")
|
||||
+ cmake_path(SET _libdir NORMALIZE "${_libdir}")
|
||||
list(FIND _sys_libdirs "${_libdir}" _libdir_index)
|
||||
if(_libdir_index LESS 0)
|
||||
list(APPEND _ldflags "-L${_libdir}")
|
||||
endif()
|
||||
string(REGEX REPLACE "^lib" "" _libname "${_libname}")
|
||||
list(APPEND LIBSSH2_PC_LIBS_PRIVATE "-l${_libname}")
|
||||
+ if(TARGET "${LIB_STATIC}" AND _libdir IN_LIST CMAKE_C_IMPLICIT_LINK_DIRECTORIES)
|
||||
+ # Avoid absolute path to system lib in exported CMake config
|
||||
+ get_target_property(static_link_libs "${LIB_STATIC}" INTERFACE_LINK_LIBRARIES)
|
||||
+ string(REPLACE "${_lib}" "${_libname}" static_link_libs "${static_link_libs}")
|
||||
+ set_target_properties("${LIB_STATIC}" PROPERTIES INTERFACE_LINK_LIBRARIES "${static_link_libs}")
|
||||
+ endif()
|
||||
else()
|
||||
list(APPEND LIBSSH2_PC_LIBS_PRIVATE "${_lib}")
|
||||
endif()
|
||||
@@ -296,8 +314,7 @@ if(BUILD_SHARED_LIBS)
|
||||
set(LIBSSH2_PC_REQUIRES "")
|
||||
set(LIBSSH2_PC_LIBS "")
|
||||
else()
|
||||
- set(LIBSSH2_PC_REQUIRES "${LIBSSH2_PC_REQUIRES_PRIVATE}")
|
||||
- set(LIBSSH2_PC_LIBS "${LIBSSH2_PC_LIBS_PRIVATE}")
|
||||
+ # (processing by vcpkg_fixup_pkgconfig)
|
||||
endif()
|
||||
|
||||
set(prefix "${CMAKE_INSTALL_PREFIX}")
|
||||
|
|
@ -4,13 +4,13 @@ vcpkg_from_github(
|
|||
REF "libssh2-${VERSION}"
|
||||
SHA512 616efcd7f5c1fb1046104ebce70549e4756e2a55150efa2df5bb7123051d3bf336023cedcbfe932cd7c690a0b4d1f1a93c760ea39f1dba50c2b06d0945dca958
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
pkgconfig.diff
|
||||
)
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
zlib ENABLE_ZLIB_COMPRESSION
|
||||
INVERTED_FEATURES
|
||||
zlib CMAKE_DISABLE_FIND_PACKAGE_ZLIB # for use by the cryto backend
|
||||
)
|
||||
if("openssl" IN_LIST FEATURES)
|
||||
list(APPEND FEATURE_OPTIONS "-DCRYPTO_BACKEND=OpenSSL")
|
||||
|
|
@ -23,22 +23,21 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
|||
list(APPEND FEATURE_OPTIONS "-DBUILD_STATIC_LIBS:BOOL=OFF")
|
||||
endif()
|
||||
|
||||
vcpkg_find_acquire_program(PKGCONFIG)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
|
||||
-DBUILD_EXAMPLES=OFF
|
||||
-DBUILD_TESTING=OFF
|
||||
${FEATURE_OPTIONS}
|
||||
OPTIONS_DEBUG
|
||||
-DENABLE_DEBUG_LOGGING=OFF
|
||||
MAYBE_UNUSED_VARIABLES
|
||||
CMAKE_DISABLE_FIND_PACKAGE_ZLIB
|
||||
${FEATURE_OPTIONS}
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_copy_pdbs()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
|
||||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libssh2)
|
||||
|
||||
if (VCPKG_TARGET_IS_WINDOWS)
|
||||
|
|
@ -59,4 +58,4 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc")
|
|||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/man")
|
||||
|
||||
file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
||||
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
|
||||
|
|
|
|||
|
|
@ -2,3 +2,8 @@ libssh2 provides CMake targets:
|
|||
|
||||
find_package(libssh2 CONFIG REQUIRED)
|
||||
target_link_libraries(main PRIVATE libssh2::libssh2)
|
||||
|
||||
libssh2 provides pkg-config modules:
|
||||
|
||||
# Library for SSH-based communication
|
||||
libssh2
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
{
|
||||
"name": "libssh2",
|
||||
"version": "1.11.1",
|
||||
"port-version": 1,
|
||||
"description": "libssh2 is a client-side C library implementing the SSH2 protocol.",
|
||||
"homepage": "https://www.libssh2.org",
|
||||
"license": "BSD-3-Clause",
|
||||
|
|
|
|||
|
|
@ -1260,6 +1260,8 @@ vcpkg-ci-curl:x64-android=pass
|
|||
vcpkg-ci-curl:x64-linux=pass
|
||||
vcpkg-ci-curl:arm64-osx=pass
|
||||
vcpkg-ci-curl:x64-osx=pass
|
||||
vcpkg-ci-curl:arm64-uwp=pass
|
||||
vcpkg-ci-curl:x64-uwp=pass
|
||||
vcpkg-ci-curl:arm64-windows=pass
|
||||
vcpkg-ci-curl:arm64-windows-static-md=pass
|
||||
vcpkg-ci-curl:x64-windows-static-md=pass
|
||||
|
|
|
|||
|
|
@ -1 +1,14 @@
|
|||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
||||
|
||||
vcpkg_find_acquire_program(PKGCONFIG)
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${CURRENT_PORT_DIR}/project"
|
||||
OPTIONS
|
||||
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
|
||||
OPTIONS_RELEASE
|
||||
"-DCURL_CONFIG=${CURRENT_INSTALLED_DIR}/tools/curl/bin/curl-config"
|
||||
OPTIONS_DEBUG
|
||||
"-DCURL_CONFIG=${CURRENT_INSTALLED_DIR}/tools/curl/debug/bin/curl-config"
|
||||
)
|
||||
vcpkg_cmake_build()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
cmake_minimum_required(VERSION 3.30)
|
||||
project(libcurl-test C)
|
||||
|
||||
block(SCOPE_FOR VARIABLES)
|
||||
# blocked by FindOpenSSL in CMake 3.30: set(CMAKE_DISABLE_FIND_PACKAGE_PkgConfig 1)
|
||||
|
||||
find_package(CURL COMPONENTS libz REQUIRED)
|
||||
|
||||
add_executable(main main.c)
|
||||
target_link_libraries(main PRIVATE CURL::libcurl)
|
||||
endblock()
|
||||
|
||||
block(SCOPE_FOR VARIABLES)
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(libcurl_pc libcurl REQUIRED IMPORTED_TARGET)
|
||||
|
||||
add_executable(main-pkgconfig main.c)
|
||||
target_link_libraries(main-pkgconfig PRIVATE PkgConfig::libcurl_pc)
|
||||
endblock()
|
||||
|
||||
block(SCOPE_FOR VARIABLES)
|
||||
if(NOT CMAKE_HOST_WIN32)
|
||||
find_program(CURL_CONFIG NAMES curl-config REQUIRED)
|
||||
execute_process(COMMAND "${CURL_CONFIG}" --cflags OUTPUT_VARIABLE curl-config-cflags OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
separate_arguments(curl-config-cflags UNIX_COMMAND "${curl-config-cflags}")
|
||||
execute_process(COMMAND "${CURL_CONFIG}" --libs OUTPUT_VARIABLE curl-config-libs OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
separate_arguments(curl-config-libs UNIX_COMMAND "${curl-config-libs}")
|
||||
string(REGEX REPLACE "(^-|;-)framework;" "\\1framework " curl-config-libs "${curl-config-libs}")
|
||||
|
||||
add_executable(main-curl-config main.c)
|
||||
target_compile_options(main-curl-config PRIVATE ${curl-config-cflags})
|
||||
target_link_libraries(main-curl-config PRIVATE ${curl-config-libs})
|
||||
endif()
|
||||
endblock()
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
#include <curl/curl.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
if(curl) {
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,59 +1,120 @@
|
|||
{
|
||||
"name": "vcpkg-ci-curl",
|
||||
"version-date": "2024-03-05",
|
||||
"version-string": "ci",
|
||||
"description": "Port to force features of certain ports within CI",
|
||||
"homepage": "https://github.com/microsoft/vcpkg",
|
||||
"license": "MIT",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "curl",
|
||||
"features": [
|
||||
"c-ares",
|
||||
"http2",
|
||||
"idn",
|
||||
"zstd"
|
||||
"default-features": false
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
}
|
||||
],
|
||||
"default-features": [
|
||||
"compression",
|
||||
"misc",
|
||||
"security"
|
||||
],
|
||||
"features": {
|
||||
"compression": {
|
||||
"description": "Compression features",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "curl",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"zstd"
|
||||
]
|
||||
},
|
||||
{
|
||||
"$comment": "Known to break aws-sdk-cpp.",
|
||||
"name": "curl",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"brotli"
|
||||
],
|
||||
"platform": "!osx"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"$comment": "Known to break aws-sdk-cpp.",
|
||||
"name": "curl",
|
||||
"features": [
|
||||
"brotli"
|
||||
],
|
||||
"platform": "!osx"
|
||||
"misc": {
|
||||
"description": "Misc features",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "curl",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"c-ares",
|
||||
"http2",
|
||||
"idn",
|
||||
"rtmp",
|
||||
"ssh"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "curl",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"psl"
|
||||
],
|
||||
"platform": "!uwp"
|
||||
},
|
||||
{
|
||||
"name": "curl",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"ldap",
|
||||
"tool"
|
||||
],
|
||||
"platform": "!android & !uwp"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "curl",
|
||||
"features": [
|
||||
"gsasl",
|
||||
"mbedtls",
|
||||
"openssl",
|
||||
"psl",
|
||||
"wolfssl"
|
||||
],
|
||||
"platform": "!uwp"
|
||||
},
|
||||
{
|
||||
"name": "curl",
|
||||
"features": [
|
||||
"gssapi"
|
||||
],
|
||||
"platform": "linux | osx"
|
||||
},
|
||||
{
|
||||
"name": "curl",
|
||||
"features": [
|
||||
"ldap",
|
||||
"tool"
|
||||
],
|
||||
"platform": "!android & !uwp"
|
||||
},
|
||||
{
|
||||
"name": "curl",
|
||||
"features": [
|
||||
"gnutls"
|
||||
],
|
||||
"platform": "!arm & !android & !xbox"
|
||||
"security": {
|
||||
"description": "Security features",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "curl",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"gsasl",
|
||||
"mbedtls",
|
||||
"openssl",
|
||||
"ssl",
|
||||
"wolfssl"
|
||||
],
|
||||
"platform": "!uwp"
|
||||
},
|
||||
{
|
||||
"name": "curl",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"gssapi"
|
||||
],
|
||||
"platform": "linux | osx"
|
||||
},
|
||||
{
|
||||
"name": "curl",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"sspi"
|
||||
],
|
||||
"platform": "windows & !uwp"
|
||||
},
|
||||
{
|
||||
"$comment": "On arm, gnutls crypto symbols clash with openssl.",
|
||||
"name": "curl",
|
||||
"default-features": false,
|
||||
"features": [
|
||||
"gnutls"
|
||||
],
|
||||
"platform": "!android & !uwp & !xbox & !arm"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1442,7 +1442,7 @@
|
|||
},
|
||||
"c-ares": {
|
||||
"baseline": "1.34.4",
|
||||
"port-version": 0
|
||||
"port-version": 1
|
||||
},
|
||||
"c-dbg-macro": {
|
||||
"baseline": "2020-02-29",
|
||||
|
|
@ -2122,7 +2122,7 @@
|
|||
},
|
||||
"curl": {
|
||||
"baseline": "8.11.1",
|
||||
"port-version": 1
|
||||
"port-version": 2
|
||||
},
|
||||
"curlcpp": {
|
||||
"baseline": "3.1",
|
||||
|
|
@ -5062,7 +5062,7 @@
|
|||
},
|
||||
"librtmp": {
|
||||
"baseline": "2024-03-01",
|
||||
"port-version": 0
|
||||
"port-version": 1
|
||||
},
|
||||
"librtpi": {
|
||||
"baseline": "1.0.1",
|
||||
|
|
@ -5182,7 +5182,7 @@
|
|||
},
|
||||
"libssh2": {
|
||||
"baseline": "1.11.1",
|
||||
"port-version": 0
|
||||
"port-version": 1
|
||||
},
|
||||
"libstemmer": {
|
||||
"baseline": "2021.2.2.0",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "b5bb4380f01acfa09047cf3286966951c715f666",
|
||||
"version-semver": "1.34.4",
|
||||
"port-version": 1
|
||||
},
|
||||
{
|
||||
"git-tree": "e7450d43c71f90bacb38c23f1172ac6c9cccb083",
|
||||
"version-semver": "1.34.4",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "804b1265eeee9f8fb5108d3a25e0fd4865b35394",
|
||||
"version": "8.11.1",
|
||||
"port-version": 2
|
||||
},
|
||||
{
|
||||
"git-tree": "d2c7cc1c54b17f6d1814d16c46b709767090d4d6",
|
||||
"version": "8.11.1",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "ab847676a5b3f68c8c24df290faa9d45f6d96a80",
|
||||
"version-date": "2024-03-01",
|
||||
"port-version": 1
|
||||
},
|
||||
{
|
||||
"git-tree": "9aeaa03f258c206742ae8f295d76d4d3d22f2f64",
|
||||
"version-date": "2024-03-01",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,10 @@
|
|||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "01783f68b91820c8270fe759f595b5562fb55a7c",
|
||||
"version": "1.11.1",
|
||||
"port-version": 1
|
||||
},
|
||||
{
|
||||
"git-tree": "0711b8dc1f6946f612076f4b60a60fa022e8e8e7",
|
||||
"version": "1.11.1",
|
||||
|
|
|
|||
Loading…
Reference in New Issue