diff options
-rw-r--r-- | var/spack/repos/builtin/packages/krb5/package.py | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/var/spack/repos/builtin/packages/krb5/package.py b/var/spack/repos/builtin/packages/krb5/package.py index 93367a3461..bdc99e1059 100644 --- a/var/spack/repos/builtin/packages/krb5/package.py +++ b/var/spack/repos/builtin/packages/krb5/package.py @@ -3,7 +3,7 @@ # # SPDX-License-Identifier: (Apache-2.0 OR MIT) -from spack import * +import re class Krb5(AutotoolsPackage): @@ -23,19 +23,32 @@ class Krb5(AutotoolsPackage): version('1.16.2', sha256='9f721e1fe593c219174740c71de514c7228a97d23eb7be7597b2ae14e487f027') version('1.16.1', sha256='214ffe394e3ad0c730564074ec44f1da119159d94281bbec541dc29168d21117') - def url_for_version(self, version): - url = 'https://kerberos.org/dist/krb5/{0}/krb5-{1}.tar.gz' - return url.format(version.up_to(2), version) - depends_on('bison', type='build') depends_on('openssl') configure_directory = 'src' build_directory = 'src' + executables = ['^krb5-config$'] + + @classmethod + def determine_version(cls, exe): + output = Executable(exe)('--version', output=str, error=str) + match = re.search(r'Kerberos 5 release\s+(\S+)', output) + return match.group(1) if match else None + + def url_for_version(self, version): + url = 'https://kerberos.org/dist/krb5/{0}/krb5-{1}.tar.gz' + return url.format(version.up_to(2), version) + + def patch(self): + # https://github.com/Homebrew/homebrew-core/blob/master/Formula/krb5.rb + # https://krbdev.mit.edu/rt/Ticket/Display.html?id=8928 + filter_file( + 'void foo1() __attribute__((constructor));', + '#include <unistd.h>\nvoid foo1() __attribute__((constructor));', + join_path(self.configure_directory, 'configure'), + string=True) + def configure_args(self): - args = ['--disable-debug', - '--disable-dependency-tracking', - '--disable-silent-rules', - '--without-system-verto'] - return args + return ['--without-system-verto'] |