py-sip installs properly into a prefix
This commit is contained in:
parent
c0c0879924
commit
3c0048dd89
2 changed files with 14 additions and 3 deletions
|
@ -1,4 +1,5 @@
|
|||
from spack import *
|
||||
import os
|
||||
|
||||
class PySip(Package):
|
||||
"""SIP is a tool that makes it very easy to create Python bindings for C and C++ libraries."""
|
||||
|
@ -10,6 +11,10 @@ class PySip(Package):
|
|||
extends('python')
|
||||
|
||||
def install(self, spec, prefix):
|
||||
python('configure.py')
|
||||
python('configure.py',
|
||||
'--destdir=%s' % site_packages_dir,
|
||||
'--bindir=%s' % spec.prefix.bin,
|
||||
'--incdir=%s' % python_include_dir,
|
||||
'--sipdir=%s' % os.path.join(spec.prefix.share, 'sip'))
|
||||
make()
|
||||
make('install')
|
||||
|
|
|
@ -42,6 +42,11 @@ def python_lib_dir(self):
|
|||
return os.path.join('lib', 'python%d.%d' % self.version[:2])
|
||||
|
||||
|
||||
@property
|
||||
def python_include_dir(self):
|
||||
return os.path.join('include', 'python%d.%d' % self.version[:2])
|
||||
|
||||
|
||||
@property
|
||||
def site_packages_dir(self):
|
||||
return os.path.join(self.python_lib_dir, 'site-packages')
|
||||
|
@ -59,6 +64,7 @@ def setup_dependent_environment(self, module, spec, ext_spec):
|
|||
|
||||
# Add variables for lib/pythonX.Y and lib/pythonX.Y/site-packages dirs.
|
||||
module.python_lib_dir = os.path.join(ext_spec.prefix, self.python_lib_dir)
|
||||
module.python_include_dir = os.path.join(ext_spec.prefix, self.python_include_dir)
|
||||
module.site_packages_dir = os.path.join(ext_spec.prefix, self.site_packages_dir)
|
||||
|
||||
# Make the site packages directory if it does not exist already.
|
||||
|
|
Loading…
Reference in a new issue