From a57edb7029ef5946d56a59168c1c8e454677871c Mon Sep 17 00:00:00 2001 From: Greg Becker Date: Fri, 24 Jan 2020 21:16:48 -0800 Subject: [PATCH] configure z3+python to build python libraries in its own prefix (#14604) --- var/spack/repos/builtin/packages/z3/package.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/var/spack/repos/builtin/packages/z3/package.py b/var/spack/repos/builtin/packages/z3/package.py index 6a47a720a5..bd02c0c0db 100644 --- a/var/spack/repos/builtin/packages/z3/package.py +++ b/var/spack/repos/builtin/packages/z3/package.py @@ -22,6 +22,7 @@ class Z3(MakefilePackage): variant('python', default=False, description='Enable python binding') depends_on('python', type=('build', 'run')) + extends('python', when='+python') # Referenced: https://github.com/Z3Prover/z3/issues/1016 patch('fix_1016_1.patch', when='@:4.4.1') @@ -31,9 +32,18 @@ class Z3(MakefilePackage): def configure_args(self): spec = self.spec - return [ - '--python' if '+python' in spec else '' - ] + + args = [] + + if spec.satisfies('+python'): + args.append('--python') + args.append( + '--pypkgdir=%s' % join_path( + prefix.lib, + 'python%s' % spec['python'].version.up_to(2), + 'site-packages')) + + return args def bootstrap(self, spec, prefix): options = ['--prefix={0}'.format(prefix)] + self.configure_args()