diff options
author | Toyohisa Kameyama <kameyama@riken.jp> | 2021-01-21 12:42:36 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-20 21:42:36 -0600 |
commit | c5ed46e0264c7f62d95c7ad1f69717b19f06db8c (patch) | |
tree | c4f490a93034ed877cbac7a35d41fe3a17c36147 | |
parent | bf3fb8428d9d329d313c28a37f0ad7303774709d (diff) | |
download | spack-c5ed46e0264c7f62d95c7ad1f69717b19f06db8c.tar.gz spack-c5ed46e0264c7f62d95c7ad1f69717b19f06db8c.tar.bz2 spack-c5ed46e0264c7f62d95c7ad1f69717b19f06db8c.tar.xz spack-c5ed46e0264c7f62d95c7ad1f69717b19f06db8c.zip |
libcap-ng: fix detect python. (#21162)
* libcap-ng: fix detect python.
- add python variant.
- add --with-python and --with-python3 configure option.
* fix style.
* - Add python variant.
- change - to --
-rw-r--r-- | var/spack/repos/builtin/packages/libcap-ng/package.py | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/libcap-ng/package.py b/var/spack/repos/builtin/packages/libcap-ng/package.py index a401b37b75..d1e6182c92 100644 --- a/var/spack/repos/builtin/packages/libcap-ng/package.py +++ b/var/spack/repos/builtin/packages/libcap-ng/package.py @@ -21,4 +21,25 @@ class LibcapNg(AutotoolsPackage): depends_on('libtool', type='build') depends_on('m4', type='build') depends_on('attr', type='build') - depends_on('python', type=('build', 'run')) + depends_on('swig', type='build') + depends_on('python@2.7:', type=('build', 'link', 'run'), when='+python') + + variant('python', default=True, description='Enable python') + + extends('python', when='+python') + + def setup_build_environment(self, env): + if self.spec.satisfies('+python'): + env.set('PYTHON', self.spec['python'].command.path) + + def configure_args(self): + args = [] + spec = self.spec + if spec.satisfies('+python'): + if spec.satisfies('^python@3:'): + args.extend(['--without-python', '--with-python3']) + else: + args.extend(['--with-python', '--without-python3']) + else: + args.extend(['--without-python', '--without-python3']) + return args |