[SCM] Packaging for cctbx branch, master, updated. upstream/2012.05.08.2305-34-g5bca3be
Radostan Riedel
raybuntu at googlemail.com
Sun Jul 22 22:43:00 UTC 2012
The following commit has been merged in the master branch:
commit 2ac04bd1c7ed2cd78f8c8175c072a45894930f0b
Author: Radostan Riedel <raybuntu at googlemail.com>
Date: Mon Jul 23 00:29:27 2012 +0200
Fix in install targets and support for pickle object
diff --git a/debian/patches/0007-options-for-system-libs-installtarget-and-prefix.patch b/debian/patches/0007-options-for-system-libs-installtarget-and-prefix.patch
index dc1c7bf..d9f8979 100644
--- a/debian/patches/0007-options-for-system-libs-installtarget-and-prefix.patch
+++ b/debian/patches/0007-options-for-system-libs-installtarget-and-prefix.patch
@@ -10,7 +10,7 @@ Subject: options for system libs installtarget and prefix
cctbx_sources/gltbx/SConscript | 2 +-
cctbx_sources/iotbx/mtz/SConscript | 3 +-
cctbx_sources/iotbx/pdb/SConscript | 2 +-
- cctbx_sources/libtbx/SConscript | 78 +++++++++++++++++-
+ cctbx_sources/libtbx/SConscript | 80 +++++++++++++++++-
cctbx_sources/libtbx/env_config.py | 19 +++++
cctbx_sources/mmtbx/den/SConscript | 2 +-
cctbx_sources/mmtbx/geometry_restraints/SConscript | 2 +-
@@ -21,7 +21,7 @@ Subject: options for system libs installtarget and prefix
.../smtbx/refinement/boost_python/SConscript | 4 +-
.../refinement/constraints/boost_python/SConscript | 4 +-
cctbx_sources/spotfinder/SConscript | 2 +-
- 18 files changed, 178 insertions(+), 66 deletions(-)
+ 18 files changed, 180 insertions(+), 66 deletions(-)
diff --git a/cctbx_sources/boost_adaptbx/SConscript b/cctbx_sources/boost_adaptbx/SConscript
index 0d95318..5417e1b 100644
@@ -260,7 +260,7 @@ index 6af2664..9b89fe1 100644
env.SharedLibrary(
target="#lib/iotbx_pdb_ext",
diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
-index ba00dd3..1795e59 100644
+index ba00dd3..109b0d8 100644
--- a/cctbx_sources/libtbx/SConscript
+++ b/cctbx_sources/libtbx/SConscript
@@ -4,7 +4,7 @@ from libtbx import easy_run
@@ -280,7 +280,7 @@ index ba00dd3..1795e59 100644
if (libtbx.env.build_options.libtoolize):
env_etc.shlibsuffix = ".la"
env_base.Append(LIBSUFFIXES=[env_etc.shlibsuffix])
-@@ -1093,4 +1094,79 @@ if (libtbx.env.build_options.libtoolize):
+@@ -1093,4 +1094,81 @@ if (libtbx.env.build_options.libtoolize):
env_etc.shlinkflags.remove('-shared')
env_etc.set_libtool(env_base, env_etc.rpath)
@@ -327,10 +327,12 @@ index ba00dd3..1795e59 100644
+ rp = libtbx.env.repository_paths
+ lib_dir = '%s%s'%(abs(libtbx.env.lib_path), env_etc.rpath)
+ exe_dev = libtbx.env.under_build("exe_dev")
++ include_path = libtbx.env.include_path
+ if not os.path.exists(lib_dir):
+ os.makedirs(lib_dir)
+ rp = list(rp)
+ rp.append(lib_dir)
++ rp.append(include_path)
+ for p in rp:
+ if isinstance(p, str):
+ src_dir = p
diff --git a/debian/patches/0008-add-with_pycbf-option.patch b/debian/patches/0008-add-with_pycbf-option.patch
index 88a650c..2f31cdc 100644
--- a/debian/patches/0008-add-with_pycbf-option.patch
+++ b/debian/patches/0008-add-with_pycbf-option.patch
@@ -29,7 +29,7 @@ index 4ac6717..14deee3 100644
Export("env_cbflib_boost_python_ext")
diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
-index 1795e59..e3e4318 100644
+index 109b0d8..c899fbc 100644
--- a/cctbx_sources/libtbx/SConscript
+++ b/cctbx_sources/libtbx/SConscript
@@ -1127,6 +1127,7 @@ else:
diff --git a/debian/patches/0010-adding-setup_py.patch b/debian/patches/0010-adding-setup_py.patch
index 7c6bb19..8774c20 100644
--- a/debian/patches/0010-adding-setup_py.patch
+++ b/debian/patches/0010-adding-setup_py.patch
@@ -4,9 +4,9 @@ Subject: adding-setup_py
---
cctbx_sources/stdlib.py | 4 ++
- sconsutils.py | 109 ++++++++++++++++++++++++++++++++++++++++++++
- setup.py | 115 +++++++++++++++++++++++++++++++++++++++++++++++
- 3 files changed, 228 insertions(+)
+ sconsutils.py | 154 +++++++++++++++++++++++++++++++++++++++++++++++
+ setup.py | 122 +++++++++++++++++++++++++++++++++++++
+ 3 files changed, 280 insertions(+)
create mode 100755 cctbx_sources/stdlib.py
create mode 100644 sconsutils.py
create mode 100755 setup.py
@@ -23,18 +23,21 @@ index 0000000..759f689
+random = stdlib_import("random")
diff --git a/sconsutils.py b/sconsutils.py
new file mode 100644
-index 0000000..2d20eb4
+index 0000000..93b1542
--- /dev/null
+++ b/sconsutils.py
-@@ -0,0 +1,109 @@
+@@ -0,0 +1,154 @@
++from distutils.sysconfig import get_python_lib
+from distutils.command.build_ext import build_ext as _build_ext
+from distutils.command.install import install as _install
+from distutils.cmd import Command as _Command
+import sys, os
+import SCons.Script
-+import libtbx.env_config
+import libtbx
++import libtbx.env_config
++from libtbx.path import relocatable_path, absolute_path
+import threading
++import pickle
+
+BUILDDIR = ''
+configure_list = []
@@ -58,12 +61,54 @@ index 0000000..2d20eb4
+ os.chdir(cwd)
+class install(_install, Command):
+ def run(self):
-+ super(install, self).run()
+ if self.root != None:
+ ip = '--install_prefix'
+ if ip not in configure_list:
+ configure_list.extend([ip, self.root + PREFIX])
+ self.run_scons(scons_installargv)
++ self.modify_libtbx_env()
++ super(install, self).run()
++
++ def modify_libtbx_env(self):
++ """ Modify libtbx_env pickle object to set the correct paths. """
++ env = libtbx.env_config.unpickle()
++ env.build_path = absolute_path(PREFIX)
++ build_path = env.build_path
++ python_lib = get_python_lib()
++ rel_path = os.path.join(python_lib, 'cctbx')
++ env.bin_path = relocatable_path(build_path, 'bin')
++ env.lib_path = relocatable_path(build_path, 'lib')
++ env.include_path = relocatable_path(build_path, 'include')
++ env.repository_paths = relocatable_path(build_path, rel_path)
++ env.scons_dist_path = None
++ env.pythonpath = None
++ env.exe_path = env.bin_path
++ env.python_exe = relocatable_path(build_path, sys.executable)
++ env.path_utility = relocatable_path(build_path,
++ os.path.join(rel_path, 'libtbx/command_line/path_utility.py'))
++ module_dist_paths = {}
++ for key, value in env.module_dist_paths.items():
++ head, module = os.path.split(abs(value))
++ module_dist_paths[key] = relocatable_path(build_path,
++ os.path.join(rel_path, module))
++ env.module_dist_paths = module_dist_paths
++ for module in env.module_list:
++ paths = []
++ for path in module.dist_paths:
++ if path != None:
++ head, tail = os.path.split(abs(path))
++ rp = relocatable_path(build_path, os.path.join(rel_path, tail))
++ paths.append(rp)
++ else:
++ paths.append(None)
++ module.dist_paths = paths
++ env.reset_dispatcher_bookkeeping()
++ # Don't want to override libtbx_env so I put it into BUILDDIR/lib
++ # So data_files sould look in their
++ file_name = os.path.join(BUILDDIR, 'lib', "libtbx_env")
++ file_path = open(file_name, 'wb')
++ pickle.dump(env, file_path, 0)
++ file_path.close()
+
+class build_ext(_build_ext, Command):
+ def run(self):
@@ -138,10 +183,10 @@ index 0000000..2d20eb4
+ return out, list(outext)
diff --git a/setup.py b/setup.py
new file mode 100755
-index 0000000..3549da0
+index 0000000..addf444
--- /dev/null
+++ b/setup.py
-@@ -0,0 +1,115 @@
+@@ -0,0 +1,122 @@
+from distutils.core import setup, Extension
+import sys, os, shutil
+
@@ -149,7 +194,11 @@ index 0000000..3549da0
+opj = os.path.join
+CURDIR = os.getcwd()
+SRCDIR = opj(CURDIR, 'cctbx_sources/')
-+BUILDDIR = opj(CURDIR, 'build%i.%i'%(sys.version_info[0], sys.version_info[1]))
++py_vers = sys.version_info
++py_major = py_vers[0]
++py_minor = py_vers[1]
++py_str = 'python%s.%s'%(py_major, py_minor)
++BUILDDIR = opj(CURDIR, 'build%i.%i'%(py_major, py_minor))
+clipper = 'clipper_adaptbx/clipper'
+boost = 'boost_adaptbx/boost'
+libtbx_pypath = 'libtbx/pythonpath'
@@ -240,6 +289,8 @@ index 0000000..3549da0
+# file ext.
+EXT_MODULES = [ Extension(e, ['lib/%s.so'%e]) for e in EXT_MODULES ]
+
++# modified version of libtbx_env lies in BUILDDIR/lib
++libtbx_env = opj(BUILDDIR, 'lib', 'libtbx_env')
+setup(name=NAME,
+ version = VERSION,
+ author = AUTHOR,
@@ -256,5 +307,6 @@ index 0000000..3549da0
+ cmdclass = {'build_ext': build_ext,
+ 'install': install},
+ py_modules = MODS,
++ data_files = [('/usr/share/cctbx/%s'%(py_str), [libtbx_env])],
+ )
--
diff --git a/debian/patches/0011-fix-missing-python-lib-during-linking.patch b/debian/patches/0011-fix-missing-python-lib-during-linking.patch
index 75e34bf..2f0b54f 100644
--- a/debian/patches/0011-fix-missing-python-lib-during-linking.patch
+++ b/debian/patches/0011-fix-missing-python-lib-during-linking.patch
@@ -7,7 +7,7 @@ Subject: fix missing python lib during linking
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
-index e3e4318..ab9e503 100644
+index c899fbc..ef57294 100644
--- a/cctbx_sources/libtbx/SConscript
+++ b/cctbx_sources/libtbx/SConscript
@@ -56,7 +56,7 @@ def set_python_include_and_libs(env_etc):
diff --git a/debian/python-cctbx.install b/debian/python-cctbx.install
index b2cc136..92c96eb 100644
--- a/debian/python-cctbx.install
+++ b/debian/python-cctbx.install
@@ -1 +1,2 @@
usr/lib/python2*
+usr/share/cctbx
--
Packaging for cctbx
More information about the debian-science-commits
mailing list