Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Libxml2 when not available from OS #765

Merged
merged 6 commits into from Dec 11, 2015
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
31 changes: 13 additions & 18 deletions easybuild/easyblocks/l/libxml2.py
Expand Up @@ -27,6 +27,7 @@
implemented as an easyblock.

@author: Jens Timmerman (Ghent University)
@author: Alan O'Cais (Juelich Supercomputing Centre)
"""
import os

Expand All @@ -53,39 +54,31 @@ def configure_step(self):
"""
if not get_software_root('Python'):
raise EasyBuildError("Python module not loaded")

# We will do the python bindings ourselves so force them off
self.cfg.update('configopts', '--without-python')
ConfigureMake.configure_step(self)

try:
os.chdir('python')
PythonPackage.configure_step(self)
os.chdir('..')
except OSError, err:
raise EasyBuildError("Failed to configure libxml2 Python bindings: %s", err)

def build_step(self):
"""
Make libxml2 first, then make python bindings
"""
ConfigureMake.build_step(self)

try:
os.chdir('python')
# set cflags to point to include folder
env.setvar('CFLAGS', "-I../include")
PythonPackage.build_step(self)
os.chdir('..')
except OSError, err:
raise EasyBuildError("Failed to build libxml2 Python bindings: %s", err)

def install_step(self):
"""
Install libxml2 and install python bindings
"""
ConfigureMake.install_step(self)

try:
# We can only do the python bindings after the initial installation
# since setup.py expects to find the include dir in the installation path
# and that only exists after installation
os.chdir('python')
PythonPackage.configure_step(self)
# set cflags to point to include folder for the compilation step to succeed
env.setvar('CFLAGS', "-I../include")
PythonPackage.build_step(self)
PythonPackage.install_step(self)
os.chdir('..')
except OSError, err:
Expand All @@ -101,7 +94,9 @@ def sanity_check_step(self):
"""Custom sanity check for libxml2"""

custom_paths = {
'files':["lib/libxml2.a", "lib/libxml2.so"],
'files':["lib/libxml2.a", "lib/libxml2.so"] +
[os.path.join(self.pylibdir, x)
for x in ['libxml2mod.so', 'libxml2.py', 'drv_libxml2.py']],
'dirs':["bin", self.pylibdir, "include/libxml2/libxml"],
}

Expand Down