[SCM] Packaging for cctbx branch, master, updated. upstream/2012.05.08.2305-4-ge70d458

Radostan Riedel raybuntu at googlemail.com
Sun Jul 8 21:20:33 UTC 2012


The following commit has been merged in the master branch:
commit e70d458152c50d4a47b7bbe9c33c8576e4216ebd
Author: Radostan Riedel <raybuntu at googlemail.com>
Date:   Sun Jul 8 19:16:41 2012 +0200

    Adding Shlib versioning support.

diff --git a/debian/patches/0001-remove-hardcoded-libtbx_build-env.patch b/debian/patches/0001-remove-hardcoded-libtbx_build-env.patch
index 14d3f09..fde9d5e 100644
--- a/debian/patches/0001-remove-hardcoded-libtbx_build-env.patch
+++ b/debian/patches/0001-remove-hardcoded-libtbx_build-env.patch
@@ -22,3 +22,4 @@ index 9c01e0f..8a62446 100644
    set_preferred_sys_prefix_and_sys_executable(build_path=build_path)
    libtbx_env = open(op.join(build_path, "libtbx_env"), "rb")
    env = pickle.load(libtbx_env)
+-- 
diff --git a/debian/patches/0002-fix-opengl-header-missing-gltbx.patch b/debian/patches/0002-fix-opengl-header-missing-gltbx.patch
index d3684a5..670fb33 100644
--- a/debian/patches/0002-fix-opengl-header-missing-gltbx.patch
+++ b/debian/patches/0002-fix-opengl-header-missing-gltbx.patch
@@ -49,3 +49,4 @@ index d02e7a5..4b2213d 100644
    if (not env_etc.gltbx_has_usable_opengl):
      print "gltbx: OpenGL headers and/or libraries not available."
      print "gltbx: Compilation skipped."
+-- 
diff --git a/debian/patches/0003-correct-paths-in-dispatcher-creation.patch b/debian/patches/0003-correct-paths-in-dispatcher-creation.patch
index 4fe0ea3..284ee38 100644
--- a/debian/patches/0003-correct-paths-in-dispatcher-creation.patch
+++ b/debian/patches/0003-correct-paths-in-dispatcher-creation.patch
@@ -83,3 +83,4 @@ index 8a62446..c3e1c7d 100644
      precall_commands = self.dispatcher_precall_commands()
      if (precall_commands is not None):
        for line in precall_commands:
+-- 
diff --git a/debian/patches/0004-correct-boost-build-target.patch b/debian/patches/0004-correct-boost-build-target.patch
index fabdae0..54f3e70 100644
--- a/debian/patches/0004-correct-boost-build-target.patch
+++ b/debian/patches/0004-correct-boost-build-target.patch
@@ -38,3 +38,4 @@ index 866b1c1..11048d5 100644
    if (bool(int(ARGUMENTS.get("boost_python_tests", "0")))):
      warn_if_unexpected_md5_hexdigest(
        path=libtbx.env.under_dist("boost", "libs/python/test/Jamfile.v2"),
+-- 
diff --git a/debian/patches/0005-adding-setup_py.patch b/debian/patches/0005-adding-setup_py.patch
index fbaa529..a89b8f8 100644
--- a/debian/patches/0005-adding-setup_py.patch
+++ b/debian/patches/0005-adding-setup_py.patch
@@ -66,3 +66,4 @@ index 0000000..814dce9
 +      packages = PACKS,
 +      package_dir = PACKDIR,
 +      py_modules = MODS,)
+-- 
diff --git a/debian/patches/0006-adding-shlib-versioning.patch b/debian/patches/0006-adding-shlib-versioning.patch
new file mode 100644
index 0000000..d872c31
--- /dev/null
+++ b/debian/patches/0006-adding-shlib-versioning.patch
@@ -0,0 +1,168 @@
+From: Radostan Riedel <raybuntu at googlemail.com>
+Date: Sun, 8 Jul 2012 18:15:24 +0200
+Subject: adding-shlib-versioning
+
+---
+ cctbx_sources/boost_adaptbx/SConscript |    3 ++
+ cctbx_sources/libtbx/SConscript        |   57 ++++++++++++++++++++++++++++++++
+ cctbx_sources/libtbx/env_config.py     |   22 +++++++++++-
+ cctbx_sources/scitbx/lbfgs/SConscript  |    4 +++
+ 4 files changed, 85 insertions(+), 1 deletion(-)
+
+diff --git a/cctbx_sources/boost_adaptbx/SConscript b/cctbx_sources/boost_adaptbx/SConscript
+index 11048d5..4cba06d 100644
+--- a/cctbx_sources/boost_adaptbx/SConscript
++++ b/cctbx_sources/boost_adaptbx/SConscript
+@@ -51,6 +51,9 @@ if (not env_etc.no_boost_python):
+     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)
+   env_no_includes_boost_python_ext.Append(
+     LIBPATH=env_etc.libpath_python)
+   env_no_includes_boost_python_ext.Append(
+diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
+index debf569..3976ba3 100644
+--- a/cctbx_sources/libtbx/SConscript
++++ b/cctbx_sources/libtbx/SConscript
+@@ -1018,4 +1018,61 @@ def enable_cuda_if_possible():
+ enable_openmp_if_possible()
+ enable_cuda_if_possible()
+ 
++def set_libtool(env, rpath):
++  # Versioning can be provided by adding by adding the
++  # "-version-info 3:12:1" to the SHLINKFLAGS
++  # Please see:
++  # http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
++  # for reference. Otherwise it will be set to 0:0:0
++  import SCons.Action
++  import copy
++  env_etc.cc_save = env['CC']
++  env_etc.shcc_save = env['SHCC']
++  env_etc.cxx_save = env['CXX']
++  env_etc.link_save = env['LINK']
++  env_etc.shcxx_save = env['SHCXX']
++  env_etc.shlink_save = env['SHLINK']
++  env_etc.shobjsuffix_save = env['SHOBJSUFFIX']
++  env_etc.SharedLibraryBuilder_save = env['BUILDERS']['SharedLibrary']
++  env.Replace(
++    CC='libtool --tag=CC --mode=compile ' + env_etc.cc_save,
++    SHCC='libtool --tag=CC --mode=compile ' + env_etc.shcc_save,
++    CXX='libtool --tag=CXX --mode=compile ' + env_etc.cxx_save,
++    LINK='libtool --tag=CXX --mode=link ' + env_etc.link_save,
++    SHCXX='libtool --tag=CXX --mode=compile ' + env_etc.shcxx_save,
++    SHLINK='libtool --tag=CXX --mode=link ' + env_etc.shlink_save,
++    SHLINKFLAGS='-rpath ' + rpath,
++    SHOBJSUFFIX='.lo',
++    SHLIBSUFFIX='.la',
++  )
++  libtool_install = 'libtool --mode=install install -D ${TARGET.abspath} %s%s/${TARGET.file}'%(abs(libtbx.env.lib_path), rpath)
++  action_list = SCons.Action.ListAction([libtool_install]).list
++  customBuilder = copy.deepcopy(env['BUILDERS']['SharedLibrary'])
++  customBuilder.action.list.extend(action_list)
++  env['BUILDERS']['SharedLibrary'] = customBuilder
++env_etc.set_libtool = set_libtool
++
++def unset_libtool(env, rpath):
++  env['BUILDERS']['SharedLibrary'] = env_etc.SharedLibraryBuilder_save
++  env.Replace(
++  CC=env_etc.cc_save,
++  SHCC=env_etc.shcc_save,
++  CXX=env_etc.cxx_save,
++  LINK=env_etc.link_save,
++  SHCXX=env_etc.shcxx_save,
++  SHLINK=env_etc.shlink_save,
++  SHOBJSUFFIX=env_etc.shobjsuffix_save,
++  )
++  libtool_install_path = '#lib' + rpath
++  env.Append(LIBPATH=libtool_install_path)
++env_etc.unset_libtool = unset_libtool
++
++if (libtbx.env.build_options.libtoolize):
++  env_etc.shlibsuffix = ".la"
++  env_base.Append(LIBSUFFIXES=[env_etc.shlibsuffix])
++  env_etc.rpath = libtbx.env.build_options.rpath
++  rpath_link = ['-rpath', env_etc.rpath]
++  env_etc.shlinkflags.extend(rpath_link)
++  env_etc.set_libtool(env_base, env_etc.rpath)
++
+ Export("env_base", "env_etc")
+diff --git a/cctbx_sources/libtbx/env_config.py b/cctbx_sources/libtbx/env_config.py
+index c3e1c7d..484142b 100644
+--- a/cctbx_sources/libtbx/env_config.py
++++ b/cctbx_sources/libtbx/env_config.py
+@@ -701,6 +701,8 @@ Wait for the command to finish, then try again.""" % vars())
+         precompile_headers=command_line.options.precompile_headers,
+         static_libraries=command_line.options.static_libraries,
+         static_exe=command_line.options.static_exe,
++        libtoolize=command_line.options.libtoolize,
++        rpath=command_line.options.rpath,
+         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
+@@ -1759,6 +1761,8 @@ class build_options:
+         warning_level,
+         static_libraries,
+         static_exe,
++        libtoolize,
++        rpath,
+         scan_boost,
+         write_full_flex_fwd_h=default_write_full_flex_fwd_h,
+         build_boost_python_extensions=default_build_boost_python_extensions,
+@@ -1783,7 +1787,12 @@ class build_options:
+       "debug", "debug_optimized", "profile"])
+     if (self.static_exe):
+       self.static_libraries = True
+-    if (self.msvc_arch_flag == "None"): self.msvc_arch_flag = None
++    if self.rpath != '/usr/lib':
++      if (not op.isabs(self.rpath)):
++        raise RuntimeError("Not an absolute path name:"
++          " --rpath %s" % show_string(self.rpath))
++      else:
++        self.libtoolize = True
+ 
+   def get_flags_from_environment(self):
+     if (self.use_environment_flags ):
+@@ -1822,6 +1831,7 @@ class build_options:
+     print >> f, "Boost threads enabled:", self.enable_boost_threads
+     print >> f, "Enable OpenMP if possible:", self.enable_openmp_if_possible
+     print >> f, "Enable CUDA:", self.enable_cuda
++    print >> f, "Libtoolize:", self.libtoolize
+     print >> f, "Use opt_resources if available:", self.opt_resources
+     print >> f, "Use environment flags:", self.use_environment_flags
+     if( self.use_environment_flags ):
+@@ -1940,6 +1950,16 @@ class pre_process_args:
+         action="store_true",
+         default=False,
+         help="link all executables statically (implies --static_libraries)")
++      parser.option(None, "--libtoolize",
++        action="store_true",
++        default=False,
++        help="build all shared libraries with libtool. Optionally set --rpath")
++      parser.option(None, "--rpath",
++        type="string",
++        action="store",
++        default="/usr/lib",
++        help="sets the rpath libtool (implies --libtoolize). Default: /usr/lib",
++        metavar="DIRECTORY")
+       parser.option(None, "--scan_boost",
+         action="store_true",
+         default=False,
+diff --git a/cctbx_sources/scitbx/lbfgs/SConscript b/cctbx_sources/scitbx/lbfgs/SConscript
+index 3b487a5..cbe0def 100644
+--- a/cctbx_sources/scitbx/lbfgs/SConscript
++++ b/cctbx_sources/scitbx/lbfgs/SConscript
+@@ -2,6 +2,10 @@ import libtbx.load_env
+ Import("env_base", "env_etc")
+ 
+ env = env_base.Clone()
++if (libtbx.env.build_options.libtoolize):
++  # we need to unset libtool since this SharedObject
++  # will be linked into a python-ext which is not supported by libtool
++  env_etc.unset_libtool(env, env_etc.rpath)
+ env_etc.enable_more_warnings(env=env)
+ env_etc.include_registry.append(
+   env=env,
+-- 
diff --git a/debian/patches/series b/debian/patches/series
index 25acfb6..7289e6c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@
 0003-correct-paths-in-dispatcher-creation.patch
 0004-correct-boost-build-target.patch
 0005-adding-setup_py.patch
+0006-adding-shlib-versioning.patch

-- 
Packaging for cctbx



More information about the debian-science-commits mailing list