summaryrefslogtreecommitdiff
path: root/var/spack/packages/libxml2/package.py
diff options
context:
space:
mode:
Diffstat (limited to 'var/spack/packages/libxml2/package.py')
-rw-r--r--var/spack/packages/libxml2/package.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/var/spack/packages/libxml2/package.py b/var/spack/packages/libxml2/package.py
index 3a0af6b368..134e596963 100644
--- a/var/spack/packages/libxml2/package.py
+++ b/var/spack/packages/libxml2/package.py
@@ -1,4 +1,5 @@
from spack import *
+import os
class Libxml2(Package):
"""Libxml2 is the XML C parser and toolkit developed for the Gnome
@@ -9,12 +10,21 @@ class Libxml2(Package):
version('2.9.2', '9e6a9aca9d155737868b3dc5fd82f788')
- extends('python')
+ variant('python', default=False, description='Enable Python support')
+
+ extends('python', when='+python', ignore=r'(bin.*$)|(include.*$)|(share.*$)|(lib/libxml2.*$)|(lib/xml2.*$)|(lib/cmake.*$)')
depends_on('zlib')
depends_on('xz')
def install(self, spec, prefix):
- configure("--prefix=%s" % prefix)
+ if '+python' in spec:
+ site_packages_dir = os.path.join(prefix, 'lib/python%s.%s/site-packages' %(spec['python'].version[:2]))
+ python_args = ["--with-python=%s" % spec['python'].prefix, "--with-python-install-dir=%s" % site_packages_dir]
+ else:
+ python_args = ["--without-python"]
+
+ configure("--prefix=%s" % prefix,
+ *python_args)
make()
make("install")