From c5ed46e0264c7f62d95c7ad1f69717b19f06db8c Mon Sep 17 00:00:00 2001 From: Toyohisa Kameyama Date: Thu, 21 Jan 2021 12:42:36 +0900 Subject: 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 -- --- .../repos/builtin/packages/libcap-ng/package.py | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'var') 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 -- cgit v1.2.3-70-g09d2