diff options
author | Adam J. Stewart <ajstewart426@gmail.com> | 2018-12-19 11:39:19 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-19 11:39:19 -0600 |
commit | adfbe71b1bb5a91279888bb68d9f05c0beeef074 (patch) | |
tree | 244147960535306f797520bb0829830d5125285a | |
parent | 654360d2ad2395519360cb275519d0c4bdddd945 (diff) | |
download | spack-adfbe71b1bb5a91279888bb68d9f05c0beeef074.tar.gz spack-adfbe71b1bb5a91279888bb68d9f05c0beeef074.tar.bz2 spack-adfbe71b1bb5a91279888bb68d9f05c0beeef074.tar.xz spack-adfbe71b1bb5a91279888bb68d9f05c0beeef074.zip |
Add python bindings to libxslt (#10149)
-rw-r--r-- | var/spack/repos/builtin/packages/libxslt/package.py | 36 |
1 files changed, 27 insertions, 9 deletions
diff --git a/var/spack/repos/builtin/packages/libxslt/package.py b/var/spack/repos/builtin/packages/libxslt/package.py index e64ab447cd..145e2313cb 100644 --- a/var/spack/repos/builtin/packages/libxslt/package.py +++ b/var/spack/repos/builtin/packages/libxslt/package.py @@ -21,19 +21,37 @@ class Libxslt(AutotoolsPackage): version('1.1.28', '9667bf6f9310b957254fdcf6596600b7') version('1.1.26', 'e61d0364a30146aaa3001296f853b2b9') - variant('crypto', default=True, - description='Build libexslt with crypto support') + variant('crypto', default=True, description='Build libexslt with crypto support') + variant('python', default=False, description='Build Python bindings') - depends_on("libiconv") - depends_on("libxml2") - depends_on("xz") - depends_on("zlib") - depends_on("libgcrypt", when="+crypto") + depends_on('pkgconfig@0.9.0:', type='build') + depends_on('libiconv') + depends_on('libxml2') + depends_on('libxml2+python', when='+python') + depends_on('xz') + depends_on('zlib') + depends_on('libgcrypt', when='+crypto') + + extends('python+shared', when='+python') def configure_args(self): args = [] - if '~crypto' in self.spec: + + if '+crypto' in self.spec: + args.append('--with-crypto') + else: args.append('--without-crypto') + + if '+python' in self.spec: + args.append('--with-python={0}'.format(self.spec['python'].home)) else: - args.append('--with-crypto') + args.append('--without-python') + return args + + @run_after('install') + @on_package_attributes(run_tests=True) + def import_module_test(self): + if '+python' in self.spec: + with working_dir('spack-test', create=True): + python('-c', 'import libxslt') |