[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
```
This commit is contained in:
talregev 2024-05-06 22:59:50 +03:00 committed by GitHub
parent 645cfa3403
commit 20d55c6fce
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 87 additions and 2 deletions

View File

@ -74,3 +74,18 @@ index 049ac34..cc0fe19 100644
if(LIBSSH2_FOUND)
list(APPEND CURL_LIBS ${LIBSSH2_LIBRARY})
list(APPEND CMAKE_REQUIRED_INCLUDES "${LIBSSH2_INCLUDE_DIR}")
@@ -917,6 +917,14 @@ option(CURL_USE_GSSAPI "Use GSSAPI implementation (right now only Heimdal is sup
mark_as_advanced(CURL_USE_GSSAPI)
if(CURL_USE_GSSAPI)
+ find_package(PkgConfig REQUIRED)
+ pkg_check_modules(KRB5 REQUIRED krb5 krb5-gssapi)
+ list(APPEND CURL_LIBS ${KRB5_LINK_LIBRARIES} resolv)
+ set(HAVE_GSSAPI_GSSAPI_H ON)
+ set(HAVE_GSSAPI_GSSAPI_GENERIC_H ON)
+ set(HAVE_GSSAPI_GSSAPI_KRB5_H ON)
+ set(HAVE_GSSAPI ON)
+ elseif(0)
find_package(GSS)
set(HAVE_GSSAPI ${GSS_FOUND})

View File

@ -46,6 +46,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
websockets ENABLE_WEBSOCKETS
zstd CURL_ZSTD
psl CURL_USE_LIBPSL
gssapi CURL_USE_GSSAPI
INVERTED_FEATURES
ldap CURL_DISABLE_LDAP
ldap CURL_DISABLE_LDAPS

View File

@ -1,7 +1,7 @@
{
"name": "curl",
"version": "8.7.1",
"port-version": 2,
"port-version": 3,
"description": "A library for transferring data with URLs",
"homepage": "https://curl.se/",
"license": "curl AND ISC AND BSD-3-Clause",
@ -33,6 +33,12 @@
"c-ares"
]
},
"gssapi": {
"description": "krb5 support",
"dependencies": [
"krb5"
]
},
"http2": {
"description": "HTTP2 support",
"dependencies": [

37
ports/krb5/portfile.cmake Normal file
View File

@ -0,0 +1,37 @@
vcpkg_download_distfile(ARCHIVE
URLS "https://kerberos.org/dist/krb5/1.21/krb5-${VERSION}.tar.gz"
FILENAME "krb5-${VERSION}.tar.gz"
SHA512 4e09296b412383d53872661718dbfaa90201e0d85f69db48e57a8d4bd73c95a90c7ec7b6f0f325f6bc967f8d203b256b071c0191facf080aca0e2caec5d0ac49
)
vcpkg_extract_source_archive(
SOURCE_PATH
ARCHIVE ${ARCHIVE}
)
vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}/src"
AUTOCONFIG
OPTIONS
"CFLAGS=-fcommon \$CFLAGS"
)
vcpkg_install_make()
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/krb5/cat1")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/krb5/cat5")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/krb5/cat7")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/krb5/cat8")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/krb5/")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/krb5/")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/var")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/var")
# remove due to absolute path error
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools/krb5/bin/compile_et")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools/krb5/bin/krb5-config")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools/krb5/debug/")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/doc/copyright.rst")

8
ports/krb5/vcpkg.json Normal file
View File

@ -0,0 +1,8 @@
{
"name": "krb5",
"version": "1.21.2",
"description": "Network authentication protocol",
"homepage": "https://web.mit.edu/kerberos/",
"license": "MIT",
"supports": "linux"
}

View File

@ -2082,7 +2082,7 @@
},
"curl": {
"baseline": "8.7.1",
"port-version": 2
"port-version": 3
},
"curlpp": {
"baseline": "2018-06-15",
@ -4040,6 +4040,10 @@
"baseline": "4.3.2",
"port-version": 0
},
"krb5": {
"baseline": "1.21.2",
"port-version": 0
},
"ktx": {
"baseline": "4.3.1",
"port-version": 1

View File

@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "32945fcb82088dc4055db602b3ebe95f67f04326",
"version": "8.7.1",
"port-version": 3
},
{
"git-tree": "b72d99e7315d0669d227580f056f7d4ea7303a58",
"version": "8.7.1",

9
versions/k-/krb5.json Normal file
View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "287bac02bb53283b043688050edd9d02e0b039c7",
"version": "1.21.2",
"port-version": 0
}
]
}