summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Oberzalek <62324958+moberza@users.noreply.github.com>2020-12-07 10:13:01 +0100
committerGitHub <noreply@github.com>2020-12-07 10:13:01 +0100
commita5b3a77741cc2de23331f849d3d5767511121ce9 (patch)
treed9c8db9a03768ba2e3fca8d1dc90244765827d08
parent401fe7179fa88d4016b4316e1f3502d02f7a83e0 (diff)
downloadspack-a5b3a77741cc2de23331f849d3d5767511121ce9.tar.gz
spack-a5b3a77741cc2de23331f849d3d5767511121ce9.tar.bz2
spack-a5b3a77741cc2de23331f849d3d5767511121ce9.tar.xz
spack-a5b3a77741cc2de23331f849d3d5767511121ce9.zip
krb5: added 'shared' variant and support to build static library (#20017)
Co-authored-by: Massimiliano Culpo <massimiliano.culpo@gmail.com>
-rw-r--r--var/spack/repos/builtin/packages/krb5/mit-krb5-1.17-static-libs.patch15
-rw-r--r--var/spack/repos/builtin/packages/krb5/package.py16
2 files changed, 30 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/krb5/mit-krb5-1.17-static-libs.patch b/var/spack/repos/builtin/packages/krb5/mit-krb5-1.17-static-libs.patch
new file mode 100644
index 0000000000..cdf0a097b4
--- /dev/null
+++ b/var/spack/repos/builtin/packages/krb5/mit-krb5-1.17-static-libs.patch
@@ -0,0 +1,15 @@
+--- src/lib/crypto/builtin/aes/Makefile.in.orig 2019-06-27 14:51:51.305688932 +0200
++++ src/lib/crypto/builtin/aes/Makefile.in 2019-06-27 14:52:46.428203235 +0200
+@@ -34,10 +34,10 @@
+
+ all-unix: all-libobjs # aes-gen
+
+-iaesx64@SHOBJEXT@: $(srcdir)/iaesx64.s
++iaesx64.$(OBJEXT) iaesx64@SHOBJEXT@: $(srcdir)/iaesx64.s
+ $(YASM) $(AESNI_FLAGS) -o $@ $(srcdir)/iaesx64.s
+
+-iaesx86@SHOBJEXT@: $(srcdir)/iaesx86.s
++iaesx86.$(OBJEXT) iaesx86@SHOBJEXT@: $(srcdir)/iaesx86.s
+ $(YASM) $(AESNI_FLAGS) -o $@ $(srcdir)/iaesx86.s
+
+ includes: depend
diff --git a/var/spack/repos/builtin/packages/krb5/package.py b/var/spack/repos/builtin/packages/krb5/package.py
index bdc99e1059..78fcdd1f42 100644
--- a/var/spack/repos/builtin/packages/krb5/package.py
+++ b/var/spack/repos/builtin/packages/krb5/package.py
@@ -26,6 +26,12 @@ class Krb5(AutotoolsPackage):
depends_on('bison', type='build')
depends_on('openssl')
+ variant(
+ 'shared', default=True,
+ description='install shared libraries if True, static if false'
+ )
+ patch('mit-krb5-1.17-static-libs.patch', level=0)
+
configure_directory = 'src'
build_directory = 'src'
@@ -51,4 +57,12 @@ class Krb5(AutotoolsPackage):
string=True)
def configure_args(self):
- return ['--without-system-verto']
+ args = ['--without-system-verto']
+
+ if '~shared' in self.spec:
+ args.append('--enable-static')
+ args.append('--disable-shared')
+ else:
+ args.append('--disable-static')
+
+ return args