Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

py-gssapi: Add kerberos5 variant, to allow use of MIT Kerberos #27644

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions python/py-gssapi/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,28 @@ checksums rmd160 71966a7d6bf97fca5ccf27f687334b53f8bd1d85 \

python.versions 39 310 311 312 313

patchfiles patch-setup.py.diff
# python-gssapi knows when it's running on macOS, and automatically configures
# itself to use macOS' GSSAPI Framework, which uses macOS' build of Heimdal
# Kerberos.
variant kerberos5 description {Use MIT Kerberos} {
long_description-append Uses GSSAPI/Kerberos from MacPorts' kerberos5 \
package.
depends_lib-append port:kerberos5

# Support for MIT Kerberos has been brought up upstream before, in
# https://github.com/pythongssapi/python-gssapi/issues/347
# In that GitHub issue, this is how the devs say to use MIT Kerberos.
pre-build {
set gssapi_cflags [exec ${prefix}/bin/krb5-config --cflags gssapi]
set gssapi_libs [exec ${prefix}/bin/krb5-config --libs gssapi]
build.env-append GSSAPI_MAIN_LIB=${prefix}/lib/libgssapi_krb5.dylib \
GSSAPI_COMPILER_ARGS=${gssapi_cflags} \
GSSAPI_LINKER_ARGS=${gssapi_libs}
}
}
if {![variant_isset kerberos5]} {
long_description-append Uses macOS's built-in GSSAPI/Kerberos.
}

if {${name} ne ${subport}} {
depends_build-append port:py${python.version}-setuptools \
Expand All @@ -34,7 +55,11 @@ if {${name} ne ${subport}} {

# Uses GSS.framework on macOS >= 10.9
if {${os.platform} eq "darwin" && ${os.major} < 13} {
depends_lib-append port:kerberos5
default_variants +kerberos5
if {![variant_isset kerberos5]} {
ui_error "Built-in GSSAPI/Kerberos is not usable on Mac OS X below 10.9."
return -code error
}
}

livecheck.type none
Expand Down
20 changes: 0 additions & 20 deletions python/py-gssapi/files/patch-setup.py.diff

This file was deleted.