[SCM] Packaging for cctbx branch, master, updated. upstream/2012.05.08.2305-18-g8edde0d
Radostan Riedel
raybuntu at googlemail.com
Sun Jul 15 19:27:55 UTC 2012
The following commit has been merged in the master branch:
commit 8edde0dd4ded91d31939cf583a2e7ad3eefde555
Author: Radostan Riedel <raybuntu at googlemail.com>
Date: Sun Jul 15 16:40:36 2012 +0200
Rework upstream fix to use system libraries
diff --git a/debian/patches/0008-upstream-fix-to-use-system-libraries.patch b/debian/patches/0008-upstream-fix-to-use-system-libraries.patch
index 6065085..7851cff 100644
--- a/debian/patches/0008-upstream-fix-to-use-system-libraries.patch
+++ b/debian/patches/0008-upstream-fix-to-use-system-libraries.patch
@@ -3,44 +3,70 @@ Date: Fri, 13 Jul 2012 15:11:27 +0200
Subject: upstream fix to use system libraries
---
- cctbx_sources/boost_adaptbx/SConscript | 21 +++---
- cctbx_sources/clipper_adaptbx/SConscript | 84 ++++++++++++----------
+ cctbx_sources/boost_adaptbx/SConscript | 40 +++++++---
+ cctbx_sources/clipper_adaptbx/SConscript | 86 ++++++++++++----------
cctbx_sources/clipper_adaptbx/clipper/SConscript | 2 +-
- cctbx_sources/libtbx/SConscript | 4 ++
- cctbx_sources/libtbx/env_config.py | 7 ++
- 5 files changed, 70 insertions(+), 48 deletions(-)
+ cctbx_sources/libtbx/SConscript | 22 ++++++
+ cctbx_sources/libtbx/env_config.py | 10 +++
+ 5 files changed, 108 insertions(+), 52 deletions(-)
diff --git a/cctbx_sources/boost_adaptbx/SConscript b/cctbx_sources/boost_adaptbx/SConscript
-index 0d95318..86dbc94 100644
+index 0d95318..b28a1cc 100644
--- a/cctbx_sources/boost_adaptbx/SConscript
+++ b/cctbx_sources/boost_adaptbx/SConscript
-@@ -9,7 +9,10 @@ import sys, os
+@@ -9,7 +9,14 @@ import sys, os
op = os.path
Import("env_base", "env_etc")
env_etc.boost_dist = libtbx.env.dist_path("boost")
-env_etc.boost_include = env_etc.boost_dist
-+if not env_etc.use_system_libs:
++py_dot_str = '%s.%s'%(env_etc.py_major, env_etc.py_minor)
++if not env_etc.check_syslib('boost_python', extra_libs='python%s'%py_dot_str) or \
++ not env_etc.check_syslib('boost_thread'):
+ env_etc.boost_include = env_etc.boost_dist
+else:
-+ env_etc.boost_include = '/usr/include'
++ # This way the compiler looks in the standard location for includes
++ # should work on all platforms.
++ env_etc.boost_include = ''
env_etc.boost_adaptbx_dist = libtbx.env.dist_path("boost_adaptbx")
env_etc.boost_adaptbx_include = os.path.dirname(env_etc.boost_adaptbx_dist)
-@@ -35,9 +38,10 @@ def build_boost_thread():
+@@ -35,9 +42,10 @@ def build_boost_thread():
lo="boost/libs/thread/src/libboost_thread.lo",
dylib="lib/libboost_thread.dylib")
env.Repository(os.path.dirname(env_etc.boost_dist))
- env.SharedLibrary(
- target='#lib/boost_thread',
- source=source)
-+ if not env_etc.use_system_libs:
++ if not env_etc.check_syslib('boost_thread'):
+ env.SharedLibrary(
+ target='#lib/boost_thread',
+ source=source)
build_boost_thread()
-@@ -238,10 +242,11 @@ object/function_doc_signature.cpp
+@@ -47,10 +55,17 @@ if (not env_etc.no_boost_python):
+ if (libtbx.env.build_options.boost_python_no_py_signatures):
+ env_etc.cxxflags_bpl_defines_base.append(
+ "-DBOOST_PYTHON_NO_PY_SIGNATURES")
+- env_no_includes_boost_python_ext = env_base.Clone(
+- SHLINKFLAGS=env_etc.shlinkflags_bpl,
+- SHLIBPREFIX="",
+- LIBS=["boost_python"] + env_etc.libs_python + env_etc.libm)
++ py_str = '-py%s%s'%(env_etc.py_major, env_etc.py_minor)
++ if env_etc.check_syslib('boost_python%s'%py_str, extra_libs='python%s'%py_dot_str):
++ env_no_includes_boost_python_ext = env_base.Clone(
++ SHLINKFLAGS=env_etc.shlinkflags_bpl,
++ SHLIBPREFIX="",
++ LIBS=['boost_python%s'%py_str] + env_etc.libs_python + env_etc.libm)
++ else:
++ env_no_includes_boost_python_ext = env_base.Clone(
++ SHLINKFLAGS=env_etc.shlinkflags_bpl,
++ SHLIBPREFIX="",
++ LIBS=["boost_python"] + env_etc.libs_python + env_etc.libm)
+ if (libtbx.env.build_options.libtoolize):
+ # Need to unset libtool since it does not support linking python-ext
+ env_etc.unset_libtool(env_no_includes_boost_python_ext, env_etc.rpath)
+@@ -238,10 +253,11 @@ object/function_doc_signature.cpp
bpl_dll_sources = [os.path.join(prefix, path) for path in bpl_dll_sources]
#
env.Repository(os.path.dirname(env_etc.boost_dist))
@@ -48,7 +74,7 @@ index 0d95318..86dbc94 100644
- env.StaticLibrary(target="#lib/boost_python", source=bpl_dll_sources)
- else:
- env.SharedLibrary(target="#lib/boost_python", source=bpl_dll_sources)
-+ if not env_etc.use_system_libs:
++ if not env_etc.check_syslib('boost_python', extra_libs='python%s'%py_dot_str):
+ if (env_etc.static_bpl):
+ env.StaticLibrary(target="#lib/boost_python", source=bpl_dll_sources)
+ else:
@@ -57,20 +83,22 @@ index 0d95318..86dbc94 100644
warn_if_unexpected_md5_hexdigest(
path=libtbx.env.under_dist("boost", "libs/python/test/Jamfile.v2"),
diff --git a/cctbx_sources/clipper_adaptbx/SConscript b/cctbx_sources/clipper_adaptbx/SConscript
-index 9cce49e..a522057 100644
+index 9cce49e..21c81c4 100644
--- a/cctbx_sources/clipper_adaptbx/SConscript
+++ b/cctbx_sources/clipper_adaptbx/SConscript
-@@ -3,54 +3,59 @@ Import("env_base", "env_etc")
+@@ -3,54 +3,61 @@ Import("env_base", "env_etc")
env_etc.clipper_dist = libtbx.env.dist_path("clipper")
env_etc.clipper_include = env_etc.clipper_dist
-+env_etc.clipper_sysinclude = '/usr/include'
++# This way the compiler looks in the standard location for includes
++# should work on all platforms
++env_etc.clipper_sysinclude = ''
env = env_base.Clone(
SHLINKFLAGS=env_etc.shlinkflags,
LIBS=env_etc.libm)
-env.Prepend(CPPPATH=[env_etc.clipper_include])
-+if not env_etc.use_system_libs:
++if not env_etc.check_syslib('clipper-core'):
+ env.Prepend(CPPPATH=[env_etc.clipper_include])
+else:
+ env.Prepend(CPPPATH=[env_etc.clipper_sysinclude])
@@ -114,7 +142,7 @@ index 9cce49e..a522057 100644
-""".split()])
-# fftmap_sparse.cpp
-# fftmap.cpp
-+if not env_etc.use_system_libs:
++if not env_etc.check_syslib('clipper-core'):
+ builder(target='#lib/clipper-core',
+ source = ["../clipper/clipper/core/"+file_name for file_name in """
+ atomsf.cpp
@@ -159,7 +187,7 @@ index 9cce49e..a522057 100644
exe = env_exe.Program(
target='#exe_dev/'+env["PROGPREFIX"]+'clipper.symtest'
-@@ -77,6 +82,7 @@ if (hasattr(env_etc, "cctbx_include")):
+@@ -77,6 +84,7 @@ if (hasattr(env_etc, "cctbx_include")):
env=env_clipper_boost_python_ext,
paths=[
env_etc.clipper_include,
@@ -180,23 +208,51 @@ index 9f79f83..37280af 100644
target="#lib/clipper_ext",
source=[
diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
-index 1443e6c..beae6b8 100644
+index 1443e6c..2d6f6bc 100644
--- a/cctbx_sources/libtbx/SConscript
+++ b/cctbx_sources/libtbx/SConscript
-@@ -1082,4 +1082,8 @@ if (libtbx.env.build_options.libtoolize):
+@@ -1082,4 +1082,26 @@ if (libtbx.env.build_options.libtoolize):
env_etc.shlinkflags.extend(rpath_link)
env_etc.set_libtool(env_base, env_etc.rpath)
+env_etc.use_system_libs = False
++def check_syslib(lib, extra_libs=None):
++ """ Check if a system library is available """
++ if not env_etc.use_system_libs:
++ return False
++ env_syslib = env_base.Clone(LIBS=extra_libs)
++ conf = env_syslib.Configure()
++ if not conf.CheckLib(library=lib):
++ print 'Could not find %s library!'%(lib)
++ conf.Finish()
++ return False
++ else:
++ conf.Finish()
++ return True
++env_etc.check_syslib = check_syslib
++
++env_etc.py_vers = libtbx.env_config.python_version()
++env_etc.py_major = env_etc.py_vers[0]
++env_etc.py_minor = env_etc.py_vers[1]
+if (libtbx.env.build_options.use_system_libs):
+ env_etc.use_system_libs = True
+
Export("env_base", "env_etc")
diff --git a/cctbx_sources/libtbx/env_config.py b/cctbx_sources/libtbx/env_config.py
-index 2285c9d..d992c2c 100644
+index 2285c9d..8b0cc88 100644
--- a/cctbx_sources/libtbx/env_config.py
+++ b/cctbx_sources/libtbx/env_config.py
-@@ -703,6 +703,7 @@ Wait for the command to finish, then try again.""" % vars())
+@@ -161,6 +161,9 @@ def python_include_path(must_exist=True):
+ % include_path)
+ return include_path
+
++def python_version(must_exist=True):
++ return sys.version_info
++
+ def ld_library_path_var_name():
+ if (os.name == "nt"):
+ return "PATH"
+@@ -703,6 +706,7 @@ Wait for the command to finish, then try again.""" % vars())
static_exe=command_line.options.static_exe,
libtoolize=command_line.options.libtoolize,
rpath=command_line.options.rpath,
@@ -204,7 +260,7 @@ index 2285c9d..d992c2c 100644
scan_boost=command_line.options.scan_boost,
write_full_flex_fwd_h=command_line.options.write_full_flex_fwd_h,
boost_python_no_py_signatures
-@@ -1762,6 +1763,7 @@ class build_options:
+@@ -1762,6 +1766,7 @@ class build_options:
static_libraries,
static_exe,
libtoolize,
@@ -212,7 +268,7 @@ index 2285c9d..d992c2c 100644
rpath,
scan_boost,
write_full_flex_fwd_h=default_write_full_flex_fwd_h,
-@@ -1833,6 +1835,7 @@ class build_options:
+@@ -1833,6 +1838,7 @@ class build_options:
print >> f, "Enable OpenMP if possible:", self.enable_openmp_if_possible
print >> f, "Enable CUDA:", self.enable_cuda
print >> f, "Libtoolize:", self.libtoolize
@@ -220,7 +276,7 @@ index 2285c9d..d992c2c 100644
print >> f, "Use opt_resources if available:", self.opt_resources
print >> f, "Use environment flags:", self.use_environment_flags
if( self.use_environment_flags ):
-@@ -1955,6 +1958,10 @@ class pre_process_args:
+@@ -1955,6 +1961,10 @@ class pre_process_args:
action="store_true",
default=False,
help="build all shared libraries with libtool. Optionally set --rpath")
--
Packaging for cctbx
More information about the debian-science-commits
mailing list