2023-07-08 01:09:39 +08:00
|
|
|
diff --git a/CMake/curl-config.cmake.in b/CMake/curl-config.cmake.in
|
2024-06-11 08:26:53 +08:00
|
|
|
index 9adb96e..9bf6900 100644
|
2023-07-08 01:09:39 +08:00
|
|
|
--- a/CMake/curl-config.cmake.in
|
|
|
|
+++ b/CMake/curl-config.cmake.in
|
2024-06-11 08:26:53 +08:00
|
|
|
@@ -31,6 +31,19 @@ if(@USE_ZLIB@)
|
2023-07-08 01:09:39 +08:00
|
|
|
find_dependency(ZLIB @ZLIB_VERSION_MAJOR@)
|
|
|
|
endif()
|
2023-07-21 23:46:53 +08:00
|
|
|
|
2023-07-08 01:09:39 +08:00
|
|
|
+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()
|
2024-06-11 08:26:53 +08:00
|
|
|
+if("@HAVE_ZSTD@")
|
|
|
|
+ find_dependency(zstd CONFIG)
|
|
|
|
+endif()
|
2023-07-21 23:46:53 +08:00
|
|
|
+
|
2023-07-08 01:09:39 +08:00
|
|
|
include("${CMAKE_CURRENT_LIST_DIR}/@TARGETS_EXPORT_NAME@.cmake")
|
|
|
|
check_required_components("@PROJECT_NAME@")
|
2023-10-12 02:10:58 +08:00
|
|
|
|
2023-07-08 01:09:39 +08:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2024-06-11 08:26:53 +08:00
|
|
|
index c3525d3..aaeb237 100644
|
2023-07-08 01:09:39 +08:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2024-06-11 08:26:53 +08:00
|
|
|
@@ -164,7 +164,8 @@ set(CURL_LIBS "")
|
2023-07-08 01:09:39 +08:00
|
|
|
|
|
|
|
if(ENABLE_ARES)
|
|
|
|
set(USE_ARES 1)
|
|
|
|
- find_package(CARES REQUIRED)
|
|
|
|
+ find_package(CARES NAMES c-ares CONFIG REQUIRED)
|
|
|
|
+ set(CARES_LIBRARY c-ares::cares)
|
|
|
|
list(APPEND CURL_LIBS ${CARES_LIBRARY})
|
|
|
|
endif()
|
|
|
|
|
2024-06-11 08:26:53 +08:00
|
|
|
@@ -461,7 +462,7 @@ if(use_core_foundation_and_core_services)
|
|
|
|
message(FATAL_ERROR "CoreServices framework not found")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
- list(APPEND CURL_LIBS "-framework CoreFoundation -framework CoreServices")
|
|
|
|
+ list(APPEND CURL_LIBS "-framework CoreFoundation" "-framework CoreServices")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CURL_USE_OPENSSL)
|
|
|
|
@@ -577,10 +578,11 @@ endif()
|
2023-07-08 01:09:39 +08:00
|
|
|
option(CURL_BROTLI "Set to ON to enable building curl with brotli support." OFF)
|
|
|
|
set(HAVE_BROTLI OFF)
|
|
|
|
if(CURL_BROTLI)
|
2023-07-21 23:46:53 +08:00
|
|
|
- find_package(Brotli REQUIRED)
|
2023-07-08 01:09:39 +08:00
|
|
|
+ find_package(BROTLI NAMES unofficial-brotli REQUIRED)
|
|
|
|
+ set(BROTLI_INCLUDE_DIRS "")
|
|
|
|
+ set(BROTLI_LIBRARIES "unofficial::brotli::brotlidec")
|
|
|
|
if(BROTLI_FOUND)
|
|
|
|
set(HAVE_BROTLI ON)
|
2024-06-11 08:26:53 +08:00
|
|
|
- set(CURL_LIBS "${BROTLI_LIBRARIES};${CURL_LIBS}") # For 'ld' linker. Emulate `list(PREPEND ...)` to stay compatible with <v3.15 CMake.
|
|
|
|
list(APPEND CURL_LIBS ${BROTLI_LIBRARIES})
|
|
|
|
include_directories(${BROTLI_INCLUDE_DIRS})
|
|
|
|
list(APPEND CMAKE_REQUIRED_INCLUDES ${BROTLI_INCLUDE_DIRS})
|
|
|
|
@@ -590,7 +592,9 @@ endif()
|
|
|
|
option(CURL_ZSTD "Set to ON to enable building curl with zstd support." 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)
|
|
|
|
if(Zstd_FOUND AND NOT Zstd_VERSION VERSION_LESS "1.0.0")
|
|
|
|
set(HAVE_ZSTD ON)
|
|
|
|
list(APPEND CURL_LIBS ${Zstd_LIBRARIES})
|
|
|
|
@@ -883,8 +887,13 @@ endif()
|
|
|
|
# Check for idn2
|
|
|
|
option(USE_LIBIDN2 "Use libidn2 for IDN support" ON)
|
|
|
|
if(USE_LIBIDN2)
|
|
|
|
- check_library_exists("idn2" "idn2_lookup_ul" "" HAVE_LIBIDN2)
|
|
|
|
+ find_package(PkgConfig REQUIRED)
|
|
|
|
+ pkg_check_modules(LIBIDN2 REQUIRED libidn2)
|
|
|
|
+ set(HAVE_LIBIDN2 TRUE)
|
|
|
|
if(HAVE_LIBIDN2)
|
|
|
|
+ list(APPEND CURL_LIBS ${LIBIDN2_LINK_LIBRARIES})
|
|
|
|
+ set(HAVE_IDN2_H TRUE)
|
|
|
|
+ elseif(0)
|
|
|
|
set(CURL_LIBS "idn2;${CURL_LIBS}")
|
|
|
|
check_include_file_concat("idn2.h" HAVE_IDN2_H)
|
|
|
|
endif()
|
|
|
|
@@ -920,11 +929,18 @@ mark_as_advanced(CURL_USE_LIBPSL)
|
2024-04-24 22:57:12 +08:00
|
|
|
set(USE_LIBPSL OFF)
|
|
|
|
|
|
|
|
if(CURL_USE_LIBPSL)
|
|
|
|
- find_package(LibPSL)
|
|
|
|
+ find_package(PkgConfig REQUIRED)
|
|
|
|
+ pkg_check_modules(LIBPSL REQUIRED libpsl)
|
|
|
|
if(LIBPSL_FOUND)
|
|
|
|
- list(APPEND CURL_LIBS ${LIBPSL_LIBRARY})
|
|
|
|
- list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBPSL_INCLUDE_DIR}")
|
|
|
|
- include_directories("${LIBPSL_INCLUDE_DIR}")
|
2024-06-11 08:26:53 +08:00
|
|
|
+ # 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()
|
2024-04-24 22:57:12 +08:00
|
|
|
+ list(APPEND CURL_LIBS ${LIBPSL_LINK_LIBRARIES})
|
|
|
|
set(USE_LIBPSL ON)
|
|
|
|
endif()
|
|
|
|
endif()
|
2024-06-11 08:26:53 +08:00
|
|
|
@@ -935,7 +951,13 @@ mark_as_advanced(CURL_USE_LIBSSH2)
|
2023-07-08 01:09:39 +08:00
|
|
|
set(USE_LIBSSH2 OFF)
|
|
|
|
|
|
|
|
if(CURL_USE_LIBSSH2)
|
|
|
|
- find_package(LibSSH2)
|
|
|
|
+ find_package(LIBSSH2 NAMES Libssh2 REQUIRED)
|
|
|
|
+ if(TARGET Libssh2::libssh2_shared)
|
|
|
|
+ set(LIBSSH2_LIBRARY Libssh2::libssh2_shared)
|
|
|
|
+ else()
|
|
|
|
+ set(LIBSSH2_LIBRARY Libssh2::libssh2_static)
|
|
|
|
+ endif()
|
|
|
|
+ get_target_property(LIBSSH2_INCLUDE_DIR "${LIBSSH2_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES)
|
|
|
|
if(LIBSSH2_FOUND)
|
|
|
|
list(APPEND CURL_LIBS ${LIBSSH2_LIBRARY})
|
|
|
|
list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBSSH2_INCLUDE_DIR}")
|
2024-06-11 08:26:53 +08:00
|
|
|
@@ -961,7 +983,11 @@ option(CURL_USE_GSSAPI "Use GSSAPI implementation (right now only Heimdal is sup
|
[krb5, curl] Add new port, and add new feature curl[gssapi] (#38402)
- [x] Changes comply with the [maintainer
guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md).
- [x] The name of the port matches an existing name for this component
on https://repology.org/ if possible, and/or is strongly associated with
that component on search engines.
- [x] Optional dependencies are resolved in exactly one way. For
example, if the component is built with CMake, all `find_package` calls
are REQUIRED, are satisfied by `vcpkg.json`'s declared dependencies, or
disabled with
[CMAKE_DISABLE_FIND_PACKAGE_Xxx](https://cmake.org/cmake/help/latest/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.html).
- [x] The versioning scheme in `vcpkg.json` matches what upstream says.
- [x] The license declaration in `vcpkg.json` matches what upstream
says.
- [x] The installed as the "copyright" file matches what upstream says.
- [x] The source code of the component installed comes from an
authoritative source.
- [x] The generated "usage text" is accurate. See
[adding-usage](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/examples/adding-usage.md)
for context.
- [x] The version database is fixed by rerunning `./vcpkg x-add-version
--all` and committing the result.
- [x] Only one version is in the new port's versions file.
- [x] Only one version is added to each modified port's versions file.
krb5 have an issue of absolute paths that I am not sure how to fix, also
I didn't succeeded to compile it on windows, but this PR is a good
start.
```
warning: There should be no absolute paths, such as the following, in an installed package:
/home/tal/vcpkg/packages/krb5_x64-linux
/home/tal/vcpkg/installed
/home/tal/vcpkg/buildtrees/krb5
/home/tal/vcpkg/downloads
Absolute paths were found in the following files:
/home/tal/vcpkg/packages/krb5_x64-linux/tools/krb5/bin/compile_et
/home/tal/vcpkg/packages/krb5_x64-linux/tools/krb5/bin/krb5-config
/home/tal/vcpkg/packages/krb5_x64-linux/tools/krb5/debug/bin/compile_et
/home/tal/vcpkg/packages/krb5_x64-linux/tools/krb5/debug/bin/krb5-config
error: Found 1 post-build check problem(s). To submit these ports to curated catalogs, please first correct the portfile: /home/tal/vcpkg/ports/krb5/portfile.cmake
```
2024-05-07 03:59:50 +08:00
|
|
|
mark_as_advanced(CURL_USE_GSSAPI)
|
|
|
|
|
|
|
|
if(CURL_USE_GSSAPI)
|
2024-06-11 08:26:53 +08:00
|
|
|
- find_package(GSS)
|
[krb5, curl] Add new port, and add new feature curl[gssapi] (#38402)
- [x] Changes comply with the [maintainer
guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md).
- [x] The name of the port matches an existing name for this component
on https://repology.org/ if possible, and/or is strongly associated with
that component on search engines.
- [x] Optional dependencies are resolved in exactly one way. For
example, if the component is built with CMake, all `find_package` calls
are REQUIRED, are satisfied by `vcpkg.json`'s declared dependencies, or
disabled with
[CMAKE_DISABLE_FIND_PACKAGE_Xxx](https://cmake.org/cmake/help/latest/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.html).
- [x] The versioning scheme in `vcpkg.json` matches what upstream says.
- [x] The license declaration in `vcpkg.json` matches what upstream
says.
- [x] The installed as the "copyright" file matches what upstream says.
- [x] The source code of the component installed comes from an
authoritative source.
- [x] The generated "usage text" is accurate. See
[adding-usage](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/examples/adding-usage.md)
for context.
- [x] The version database is fixed by rerunning `./vcpkg x-add-version
--all` and committing the result.
- [x] Only one version is in the new port's versions file.
- [x] Only one version is added to each modified port's versions file.
krb5 have an issue of absolute paths that I am not sure how to fix, also
I didn't succeeded to compile it on windows, but this PR is a good
start.
```
warning: There should be no absolute paths, such as the following, in an installed package:
/home/tal/vcpkg/packages/krb5_x64-linux
/home/tal/vcpkg/installed
/home/tal/vcpkg/buildtrees/krb5
/home/tal/vcpkg/downloads
Absolute paths were found in the following files:
/home/tal/vcpkg/packages/krb5_x64-linux/tools/krb5/bin/compile_et
/home/tal/vcpkg/packages/krb5_x64-linux/tools/krb5/bin/krb5-config
/home/tal/vcpkg/packages/krb5_x64-linux/tools/krb5/debug/bin/compile_et
/home/tal/vcpkg/packages/krb5_x64-linux/tools/krb5/debug/bin/krb5-config
error: Found 1 post-build check problem(s). To submit these ports to curated catalogs, please first correct the portfile: /home/tal/vcpkg/ports/krb5/portfile.cmake
```
2024-05-07 03:59:50 +08:00
|
|
|
+ find_package(PkgConfig REQUIRED)
|
2024-06-11 08:26:53 +08:00
|
|
|
+ pkg_check_modules(GSS REQUIRED krb5-gssapi)
|
|
|
|
+ list(APPEND CURL_LIBS ${GSS_LINK_LIBRARIES})
|
|
|
|
+ list(APPEND CURL_LIBS resolv) # Fixme: move to krb5 pc files
|
|
|
|
+ pkg_get_variable(GSS_FLAVOUR krb5-gssapi vendor)
|
[krb5, curl] Add new port, and add new feature curl[gssapi] (#38402)
- [x] Changes comply with the [maintainer
guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md).
- [x] The name of the port matches an existing name for this component
on https://repology.org/ if possible, and/or is strongly associated with
that component on search engines.
- [x] Optional dependencies are resolved in exactly one way. For
example, if the component is built with CMake, all `find_package` calls
are REQUIRED, are satisfied by `vcpkg.json`'s declared dependencies, or
disabled with
[CMAKE_DISABLE_FIND_PACKAGE_Xxx](https://cmake.org/cmake/help/latest/variable/CMAKE_DISABLE_FIND_PACKAGE_PackageName.html).
- [x] The versioning scheme in `vcpkg.json` matches what upstream says.
- [x] The license declaration in `vcpkg.json` matches what upstream
says.
- [x] The installed as the "copyright" file matches what upstream says.
- [x] The source code of the component installed comes from an
authoritative source.
- [x] The generated "usage text" is accurate. See
[adding-usage](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/examples/adding-usage.md)
for context.
- [x] The version database is fixed by rerunning `./vcpkg x-add-version
--all` and committing the result.
- [x] Only one version is in the new port's versions file.
- [x] Only one version is added to each modified port's versions file.
krb5 have an issue of absolute paths that I am not sure how to fix, also
I didn't succeeded to compile it on windows, but this PR is a good
start.
```
warning: There should be no absolute paths, such as the following, in an installed package:
/home/tal/vcpkg/packages/krb5_x64-linux
/home/tal/vcpkg/installed
/home/tal/vcpkg/buildtrees/krb5
/home/tal/vcpkg/downloads
Absolute paths were found in the following files:
/home/tal/vcpkg/packages/krb5_x64-linux/tools/krb5/bin/compile_et
/home/tal/vcpkg/packages/krb5_x64-linux/tools/krb5/bin/krb5-config
/home/tal/vcpkg/packages/krb5_x64-linux/tools/krb5/debug/bin/compile_et
/home/tal/vcpkg/packages/krb5_x64-linux/tools/krb5/debug/bin/krb5-config
error: Found 1 post-build check problem(s). To submit these ports to curated catalogs, please first correct the portfile: /home/tal/vcpkg/ports/krb5/portfile.cmake
```
2024-05-07 03:59:50 +08:00
|
|
|
|
|
|
|
set(HAVE_GSSAPI ${GSS_FOUND})
|
2024-06-11 08:26:53 +08:00
|
|
|
if(GSS_FOUND)
|
|
|
|
@@ -973,6 +999,7 @@ if(CURL_USE_GSSAPI)
|
|
|
|
check_include_file_concat("gssapi/gssapi_generic.h" HAVE_GSSAPI_GSSAPI_GENERIC_H)
|
|
|
|
check_include_file_concat("gssapi/gssapi_krb5.h" HAVE_GSSAPI_GSSAPI_KRB5_H)
|
|
|
|
|
|
|
|
+ elseif(0)
|
|
|
|
if(NOT GSS_FLAVOUR STREQUAL "Heimdal")
|
|
|
|
# MIT
|
|
|
|
set(_INCLUDE_LIST "")
|