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 --
This commit is contained in:
parent
bf3fb8428d
commit
c5ed46e026
1 changed files with 22 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue