summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/py-cffi/package.py
diff options
context:
space:
mode:
Diffstat (limited to 'var/spack/repos/builtin/packages/py-cffi/package.py')
-rw-r--r--var/spack/repos/builtin/packages/py-cffi/package.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/py-cffi/package.py b/var/spack/repos/builtin/packages/py-cffi/package.py
index 58d0a81990..7c08e51de8 100644
--- a/var/spack/repos/builtin/packages/py-cffi/package.py
+++ b/var/spack/repos/builtin/packages/py-cffi/package.py
@@ -22,8 +22,11 @@
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##############################################################################
+import os
+
from spack import *
+
class PyCffi(Package):
"""Foreign Function Interface for Python calling C code"""
homepage = "http://cffi.readthedocs.org/en/latest/"
@@ -33,9 +36,17 @@ class PyCffi(Package):
version('1.1.2', 'ca6e6c45b45caa87aee9adc7c796eaea')
extends('python')
- depends_on('py-setuptools')
- depends_on('py-pycparser')
+ depends_on('py-setuptools', type='build')
+ depends_on('py-pycparser', type=nolink)
depends_on('libffi')
def install(self, spec, prefix):
+ # This sets the compiler (and flags) that distutils will use
+ # to create the final shared library. It will use the
+ # compiler specified by the environment variable 'CC' for all
+ # other compilation. We are setting the 'LDSHARED" to the
+ # spack compiler wrapper plus a few extra flags necessary for
+ # building the shared library.
+ os.environ['LDSHARED'] = "{0} -shared -pthread".format(spack_cc)
+
python('setup.py', 'install', '--prefix=%s' % prefix)