2023-03-30 01:26:06 +02:00
|
|
|
string(REPLACE "." "_" curl_version "curl-${VERSION}")
|
2024-03-29 06:59:27 +01:00
|
|
|
|
2017-08-10 21:43:50 +02:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO curl/curl
|
2023-06-01 20:07:32 +02:00
|
|
|
REF "${curl_version}"
|
2024-07-31 02:42:29 +02:00
|
|
|
SHA512 9f7e92292bde501334ee415335404da7c40e033443c34464ed48af5bab7d1fd594859278eac695bec77ee6d58c0629162a7a9876a38a5abd404faa1c43f2b14e
|
2017-08-10 21:43:50 +02:00
|
|
|
HEAD_REF master
|
2016-12-07 09:04:49 +01:00
|
|
|
PATCHES
|
2019-06-26 11:49:39 -07:00
|
|
|
0005_remove_imp_suffix.patch
|
2021-07-01 16:22:56 +02:00
|
|
|
0020-fix-pc-file.patch
|
2021-08-12 04:38:08 +02:00
|
|
|
0022-deduplicate-libs.patch
|
2022-01-19 18:15:16 +01:00
|
|
|
export-components.patch
|
2023-07-07 19:09:39 +02:00
|
|
|
dependencies.patch
|
2024-01-03 06:32:00 +08:00
|
|
|
cmake-config.patch
|
2016-12-07 09:04:49 +01:00
|
|
|
)
|
|
|
|
|
2020-02-05 06:40:19 +08:00
|
|
|
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
|
|
|
FEATURES
|
2021-08-12 04:38:08 +02:00
|
|
|
# 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
|
2022-05-17 11:13:39 -07:00
|
|
|
wolfssl CURL_USE_WOLFSSL
|
2022-01-19 18:15:16 +01:00
|
|
|
openssl CURL_USE_OPENSSL
|
|
|
|
mbedtls CURL_USE_MBEDTLS
|
|
|
|
ssh CURL_USE_LIBSSH2
|
2021-08-12 04:38:08 +02:00
|
|
|
tool BUILD_CURL_EXE
|
|
|
|
c-ares ENABLE_ARES
|
|
|
|
sspi CURL_WINDOWS_SSPI
|
|
|
|
brotli CURL_BROTLI
|
2022-01-19 18:15:16 +01:00
|
|
|
schannel CURL_USE_SCHANNEL
|
|
|
|
sectransp CURL_USE_SECTRANSP
|
2021-08-12 04:38:08 +02:00
|
|
|
idn2 USE_LIBIDN2
|
|
|
|
winidn USE_WIN32_IDN
|
2022-11-21 18:13:49 +01:00
|
|
|
websockets ENABLE_WEBSOCKETS
|
2023-07-13 21:24:11 +03:00
|
|
|
zstd CURL_ZSTD
|
2024-04-24 17:57:12 +03:00
|
|
|
psl CURL_USE_LIBPSL
|
[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-06 22:59:50 +03:00
|
|
|
gssapi CURL_USE_GSSAPI
|
2024-06-27 07:12:35 +03:00
|
|
|
gsasl CURL_USE_GSASL
|
2020-02-05 06:40:19 +08:00
|
|
|
INVERTED_FEATURES
|
2024-03-13 23:48:53 +01:00
|
|
|
ldap CURL_DISABLE_LDAP
|
|
|
|
ldap CURL_DISABLE_LDAPS
|
2021-08-12 04:38:08 +02:00
|
|
|
non-http HTTP_ONLY
|
2020-02-05 06:40:19 +08:00
|
|
|
)
|
2018-01-23 21:11:15 +01:00
|
|
|
|
2022-01-19 18:15:16 +01:00
|
|
|
set(OPTIONS "")
|
2021-08-12 04:38:08 +02:00
|
|
|
|
2019-05-27 07:53:41 +08:00
|
|
|
if("sectransp" IN_LIST FEATURES)
|
2022-08-03 08:20:19 +02:00
|
|
|
list(APPEND OPTIONS -DCURL_CA_PATH=none -DCURL_CA_BUNDLE=none)
|
2019-07-07 23:11:01 -07:00
|
|
|
endif()
|
|
|
|
|
2018-02-27 23:15:37 +03:00
|
|
|
# UWP targets
|
2020-02-05 06:40:19 +08:00
|
|
|
if(VCPKG_TARGET_IS_UWP)
|
2022-01-19 18:15:16 +01:00
|
|
|
list(APPEND OPTIONS
|
2017-08-10 21:43:50 +02:00
|
|
|
-DCURL_DISABLE_TELNET=ON
|
|
|
|
-DENABLE_IPV6=OFF
|
|
|
|
-DENABLE_UNIX_SOCKETS=OFF
|
2017-01-11 10:59:45 -08:00
|
|
|
)
|
|
|
|
endif()
|
2016-09-18 20:50:08 -07:00
|
|
|
|
2022-09-02 23:46:16 +03:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
list(APPEND OPTIONS -DENABLE_UNICODE=ON)
|
|
|
|
endif()
|
|
|
|
|
2024-05-25 04:19:10 +02:00
|
|
|
vcpkg_find_acquire_program(PKGCONFIG)
|
|
|
|
|
2021-08-12 04:38:08 +02:00
|
|
|
vcpkg_cmake_configure(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
OPTIONS
|
2022-01-19 18:15:16 +01:00
|
|
|
"-DCMAKE_PROJECT_INCLUDE=${CMAKE_CURRENT_LIST_DIR}/cmake-project-include.cmake"
|
2024-05-25 04:19:10 +02:00
|
|
|
"-DPKG_CONFIG_EXECUTABLE=${PKGCONFIG}"
|
2021-08-12 04:38:08 +02:00
|
|
|
${FEATURE_OPTIONS}
|
2022-01-19 18:15:16 +01:00
|
|
|
${OPTIONS}
|
2017-08-10 21:43:50 +02:00
|
|
|
-DBUILD_TESTING=OFF
|
2024-03-13 23:48:53 +01:00
|
|
|
-DENABLE_CURL_MANUAL=OFF
|
2020-09-05 00:18:37 -04:00
|
|
|
-DCURL_CA_FALLBACK=ON
|
2023-06-01 20:07:32 +02:00
|
|
|
-DCMAKE_DISABLE_FIND_PACKAGE_Perl=ON
|
2021-08-12 04:38:08 +02:00
|
|
|
OPTIONS_DEBUG
|
2022-07-05 23:57:47 +02:00
|
|
|
-DENABLE_DEBUG=ON
|
2017-08-10 21:43:50 +02:00
|
|
|
)
|
2021-08-12 04:38:08 +02:00
|
|
|
vcpkg_cmake_install()
|
2020-02-05 06:40:19 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2019-04-09 02:53:10 -04:00
|
|
|
|
2020-02-05 06:40:19 +08:00
|
|
|
if ("tool" IN_LIST FEATURES)
|
2020-08-08 07:15:20 +08:00
|
|
|
vcpkg_copy_tools(TOOL_NAMES curl AUTO_CLEAN)
|
2018-02-27 23:15:37 +03:00
|
|
|
endif()
|
|
|
|
|
2021-08-12 04:38:08 +02:00
|
|
|
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/CURL)
|
2019-06-26 11:49:39 -07:00
|
|
|
|
2021-11-23 00:44:48 +01:00
|
|
|
vcpkg_fixup_pkgconfig()
|
|
|
|
set(namespec "curl")
|
|
|
|
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
|
|
|
set(namespec "libcurl")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/libcurl.pc" " -lcurl" " -l${namespec}")
|
|
|
|
endif()
|
|
|
|
if(NOT DEFINED VCPKG_BUILD_TYPE)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/libcurl.pc" " -lcurl" " -l${namespec}-d")
|
|
|
|
endif()
|
2019-05-13 17:57:55 +02:00
|
|
|
|
2020-11-12 12:33:02 -08:00
|
|
|
#Fix install path
|
2021-08-12 04:38:08 +02:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/bin/curl-config" "${CURRENT_PACKAGES_DIR}" "\${prefix}")
|
2024-06-20 07:07:05 +10:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/bin/curl-config" "${CURRENT_INSTALLED_DIR}" "\${prefix}" IGNORE_UNCHANGED)
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/bin/curl-config" "\nprefix=\${prefix}" [=[prefix=$(CDPATH= cd -- "$(dirname -- "$0")"/../../.. && pwd -P)]=] IGNORE_UNCHANGED)
|
2021-08-12 04:38:08 +02:00
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/bin/curl-config" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin/curl-config")
|
|
|
|
if(EXISTS "${CURRENT_PACKAGES_DIR}/debug/bin/curl-config")
|
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "${CURRENT_PACKAGES_DIR}" "\${prefix}")
|
2024-06-20 07:07:05 +10:00
|
|
|
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)]=] IGNORE_UNCHANGED)
|
2021-11-23 00:44:48 +01:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "-lcurl" "-l${namespec}-d")
|
2021-08-12 04:38:08 +02:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "curl." "curl-d.")
|
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin")
|
|
|
|
file(RENAME "${CURRENT_PACKAGES_DIR}/debug/bin/curl-config" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin/curl-config")
|
2021-05-13 14:00:32 -07:00
|
|
|
endif()
|
2021-08-12 04:38:08 +02:00
|
|
|
|
2021-11-23 00:44:48 +01:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
2022-01-19 18:15:16 +01:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2021-08-12 04:38:08 +02:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR NOT VCPKG_TARGET_IS_WINDOWS)
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/bin")
|
2017-08-10 21:43:50 +02:00
|
|
|
endif()
|
|
|
|
|
2019-06-26 11:49:39 -07:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
2021-08-12 04:38:08 +02:00
|
|
|
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/curl/curl.h"
|
2020-07-07 04:23:44 +08:00
|
|
|
"#ifdef CURL_STATICLIB"
|
|
|
|
"#if 1"
|
|
|
|
)
|
2020-11-20 21:18:17 +01:00
|
|
|
endif()
|
|
|
|
|
2021-05-28 19:00:20 +02:00
|
|
|
file(INSTALL "${CURRENT_PORT_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2023-09-26 09:09:06 +02:00
|
|
|
file(INSTALL "${CURRENT_PORT_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
|
|
|
|
|
|
|
file(READ "${SOURCE_PATH}/lib/krb5.c" krb5_c)
|
|
|
|
string(REGEX REPLACE "#i.*" "" krb5_c "${krb5_c}")
|
|
|
|
set(krb5_copyright "${CURRENT_BUILDTREES_DIR}/krb5.c Notice")
|
|
|
|
file(WRITE "${krb5_copyright}" "${krb5_c}")
|
|
|
|
|
|
|
|
file(READ "${SOURCE_PATH}/lib/inet_ntop.c" inet_ntop_c)
|
|
|
|
string(REGEX REPLACE "#i.*" "" inet_ntop_c "${inet_ntop_c}")
|
|
|
|
set(inet_ntop_copyright "${CURRENT_BUILDTREES_DIR}/inet_ntop.c and inet_pton.c Notice")
|
|
|
|
file(WRITE "${inet_ntop_copyright}" "${inet_ntop_c}")
|
|
|
|
|
|
|
|
vcpkg_install_copyright(
|
|
|
|
FILE_LIST
|
|
|
|
"${SOURCE_PATH}/COPYING"
|
|
|
|
"${krb5_copyright}"
|
|
|
|
"${inet_ntop_copyright}"
|
|
|
|
)
|