[SCM] Packaging for cctbx branch, master, updated. upstream/2012.05.08.2305-35-g3caabac

Radostan Riedel raybuntu at googlemail.com
Mon Jul 23 12:22:56 UTC 2012


The following commit has been merged in the master branch:
commit 3caabacabc1adf958611f6e3345c1f583b9e7b8e
Author: Radostan Riedel <raybuntu at googlemail.com>
Date:   Mon Jul 23 14:00:06 2012 +0200

    Few bugfixes in setup.py and DESTDIR support.

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 d9f8979..ca83b63 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,8 +10,8 @@ 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                    |   80 +++++++++++++++++-
- cctbx_sources/libtbx/env_config.py                 |   19 +++++
+ cctbx_sources/libtbx/SConscript                    |   82 ++++++++++++++++++-
+ cctbx_sources/libtbx/env_config.py                 |   28 +++++++
  cctbx_sources/mmtbx/den/SConscript                 |    2 +-
  cctbx_sources/mmtbx/geometry_restraints/SConscript |    2 +-
  cctbx_sources/mmtbx/secondary_structure/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, 180 insertions(+), 66 deletions(-)
+ 18 files changed, 191 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..109b0d8 100644
+index ba00dd3..ee7b1de 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..109b0d8 100644
  if (libtbx.env.build_options.libtoolize):
    env_etc.shlibsuffix = ".la"
    env_base.Append(LIBSUFFIXES=[env_etc.shlibsuffix])
-@@ -1093,4 +1094,81 @@ if (libtbx.env.build_options.libtoolize):
+@@ -1093,4 +1094,83 @@ if (libtbx.env.build_options.libtoolize):
      env_etc.shlinkflags.remove('-shared')
    env_etc.set_libtool(env_base, env_etc.rpath)
  
@@ -318,9 +318,11 @@ index ba00dd3..109b0d8 100644
 +  env_etc.scitbx_boost_python = 'scitbx_boost_python'
 +
 +env_etc.prefix = libtbx.env.build_options.install_prefix
-+env_etc.binpath = os.path.join(env_etc.prefix, 'bin')
-+env_etc.libpath = os.path.join(env_etc.prefix, 'lib')
-+env_etc.inclpath = os.path.join(env_etc.prefix, 'include')
++env_etc.destdir = libtbx.env.build_options.install_destdir
++env_etc.install_path = os.path.abspath(env_etc.destdir + '/' + env_etc.prefix)
++env_etc.binpath = os.path.join(env_etc.install_path, 'bin')
++env_etc.libpath = os.path.join(env_etc.install_path, 'lib')
++env_etc.inclpath = os.path.join(env_etc.install_path, 'include')
 +
 +def create_install_targets():
 +  cwd = os.getcwd()
@@ -363,7 +365,7 @@ index ba00dd3..109b0d8 100644
 +
  Export("env_base", "env_etc")
 diff --git a/cctbx_sources/libtbx/env_config.py b/cctbx_sources/libtbx/env_config.py
-index 2285c9d..b6bab84 100644
+index 2285c9d..281bb42 100644
 --- a/cctbx_sources/libtbx/env_config.py
 +++ b/cctbx_sources/libtbx/env_config.py
 @@ -161,6 +161,9 @@ def python_include_path(must_exist=True):
@@ -376,34 +378,37 @@ index 2285c9d..b6bab84 100644
  def ld_library_path_var_name():
    if (os.name == "nt"):
      return "PATH"
-@@ -703,6 +706,8 @@ Wait for the command to finish, then try again.""" % vars())
+@@ -703,6 +706,9 @@ 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,
 +        use_system_libs=command_line.options.use_system_libs,
 +        install_prefix=command_line.options.install_prefix,
++        install_destdir=command_line.options.install_destdir,
          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 +1767,8 @@ class build_options:
+@@ -1762,6 +1768,9 @@ class build_options:
          static_libraries,
          static_exe,
          libtoolize,
 +        use_system_libs,
 +        install_prefix,
++        install_destdir,
          rpath,
          scan_boost,
          write_full_flex_fwd_h=default_write_full_flex_fwd_h,
-@@ -1833,6 +1840,8 @@ class build_options:
+@@ -1833,6 +1842,9 @@ 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
 +    print >> f, "Use System Libraries:", self.use_system_libs
 +    print >> f, "Install Prefix:", self.install_prefix
++    print >> f, "Install Destdir:", self.install_destdir
      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,12 +1964,22 @@ class pre_process_args:
+@@ -1955,12 +1967,28 @@ class pre_process_args:
          action="store_true",
          default=False,
          help="build all shared libraries with libtool. Optionally set --rpath")
@@ -417,6 +422,12 @@ index 2285c9d..b6bab84 100644
          default="/usr/lib",
          help="sets the rpath libtool (implies --libtoolize). Default: /usr/lib",
          metavar="DIRECTORY")
++      parser.option(None, "--install_destdir",
++        type="string",
++        action="store",
++        default="",
++        help="sets the destdir for the install targets.",
++        metavar="DIRECTORY")
 +      parser.option(None, "--install_prefix",
 +        type="string",
 +        action="store",
diff --git a/debian/patches/0008-add-with_pycbf-option.patch b/debian/patches/0008-add-with_pycbf-option.patch
index 2f31cdc..95e3f3b 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 109b0d8..c899fbc 100644
+index ee7b1de..26f2808 100644
 --- a/cctbx_sources/libtbx/SConscript
 +++ b/cctbx_sources/libtbx/SConscript
 @@ -1127,6 +1127,7 @@ else:
@@ -38,10 +38,10 @@ index 109b0d8..c899fbc 100644
  
 +env_etc.with_pycbf = libtbx.env.build_options.with_pycbf
  env_etc.prefix = libtbx.env.build_options.install_prefix
- env_etc.binpath = os.path.join(env_etc.prefix, 'bin')
- env_etc.libpath = os.path.join(env_etc.prefix, 'lib')
+ env_etc.destdir = libtbx.env.build_options.install_destdir
+ env_etc.install_path = os.path.abspath(env_etc.destdir + '/' + env_etc.prefix)
 diff --git a/cctbx_sources/libtbx/env_config.py b/cctbx_sources/libtbx/env_config.py
-index b6bab84..687c00d 100644
+index 281bb42..bd4b612 100644
 --- a/cctbx_sources/libtbx/env_config.py
 +++ b/cctbx_sources/libtbx/env_config.py
 @@ -707,6 +707,7 @@ Wait for the command to finish, then try again.""" % vars())
@@ -50,17 +50,17 @@ index b6bab84..687c00d 100644
          use_system_libs=command_line.options.use_system_libs,
 +        with_pycbf=command_line.options.with_pycbf,
          install_prefix=command_line.options.install_prefix,
+         install_destdir=command_line.options.install_destdir,
          scan_boost=command_line.options.scan_boost,
-         write_full_flex_fwd_h=command_line.options.write_full_flex_fwd_h,
-@@ -1768,6 +1769,7 @@ class build_options:
+@@ -1769,6 +1770,7 @@ class build_options:
          static_exe,
          libtoolize,
          use_system_libs,
 +        with_pycbf,
          install_prefix,
+         install_destdir,
          rpath,
-         scan_boost,
-@@ -1968,6 +1970,10 @@ class pre_process_args:
+@@ -1971,6 +1973,10 @@ class pre_process_args:
          action="store_true",
          default=False,
          help="Use system Libraries to build.")
diff --git a/debian/patches/0010-adding-setup_py.patch b/debian/patches/0010-adding-setup_py.patch
index 8774c20..ae1c18b 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           |  154 +++++++++++++++++++++++++++++++++++++++++++++++
- setup.py                |  122 +++++++++++++++++++++++++++++++++++++
- 3 files changed, 280 insertions(+)
+ sconsutils.py           |  155 +++++++++++++++++++++++++++++++++++++++++++++++
+ setup.py                |  123 +++++++++++++++++++++++++++++++++++++
+ 3 files changed, 282 insertions(+)
  create mode 100755 cctbx_sources/stdlib.py
  create mode 100644 sconsutils.py
  create mode 100755 setup.py
@@ -23,13 +23,13 @@ index 0000000..759f689
 +random = stdlib_import("random")
 diff --git a/sconsutils.py b/sconsutils.py
 new file mode 100644
-index 0000000..93b1542
+index 0000000..d568ba7
 --- /dev/null
 +++ b/sconsutils.py
-@@ -0,0 +1,154 @@
+@@ -0,0 +1,155 @@
 +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.command.install_lib import install_lib as _install_lib
 +from distutils.cmd import Command as _Command
 +import sys, os
 +import SCons.Script
@@ -59,15 +59,16 @@ index 0000000..93b1542
 +        os.environ['PYTHONPATH'] = ':'.join(sys.path)
 +        self.spawn(argv)
 +        os.chdir(cwd)
-+class install(_install, Command):
++class install_lib(_install_lib, Command):
 +    def run(self):
-+        if self.root != None:
-+            ip = '--install_prefix'
++        super(install_lib, self).run()
++        install_root = self.get_finalized_command('install').root
++        if install_root != None:
++            ip = '--install_destdir'
 +            if ip not in configure_list:
-+                configure_list.extend([ip, self.root + PREFIX])
++                configure_list.extend([ip, install_root])
 +        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. """
@@ -95,7 +96,7 @@ index 0000000..93b1542
 +        for module in env.module_list:
 +            paths = []
 +            for path in module.dist_paths:
-+                if path != None: 
++                if path != None:
 +                    head, tail = os.path.split(abs(path))
 +                    rp = relocatable_path(build_path, os.path.join(rel_path, tail))
 +                    paths.append(rp)
@@ -183,10 +184,10 @@ index 0000000..93b1542
 +    return out, list(outext)
 diff --git a/setup.py b/setup.py
 new file mode 100755
-index 0000000..addf444
+index 0000000..0f0b48a
 --- /dev/null
 +++ b/setup.py
-@@ -0,0 +1,122 @@
+@@ -0,0 +1,123 @@
 +from distutils.core import setup, Extension
 +import sys, os, shutil
 +
@@ -203,6 +204,7 @@ index 0000000..addf444
 +boost = 'boost_adaptbx/boost'
 +libtbx_pypath = 'libtbx/pythonpath'
 +scons_path = '/usr/lib/scons/'
++PREFIX = '/usr'
 +PATHLIST= [ SRCDIR,
 +            opj(SRCDIR, libtbx_pypath),
 +            opj(SRCDIR, clipper),
@@ -214,8 +216,7 @@ index 0000000..addf444
 +        sys.path.append(p)
 +
 +import sconsutils
-+from sconsutils import build_ext, find_packages_and_extensions, install
-+
++from sconsutils import build_ext, find_packages_and_extensions, install_lib
 +
 +# Configure settings
 +# We need this directory to get env_config.cold_start to run!
@@ -224,6 +225,7 @@ index 0000000..addf444
 +build_opts = [ '--libtoolize',
 +               '--rpath', '/usr/lib',
 +               '--use_system_libs',
++               '--install_prefix', PREFIX,
 +             ]
 +conf_modules = [ 'annlib_adaptbx',
 +                 'boost_adaptbx',
@@ -253,7 +255,7 @@ index 0000000..addf444
 +sconsutils.configure_list.extend(build_opts)
 +sconsutils.configure_list.extend(conf_modules)
 +sconsutils.BUILDDIR = BUILDDIR
-+sconsutils.PREFIX = '/usr/'
++sconsutils.PREFIX = PREFIX
 +
 +# Build settings
 +sconsutils.scons_buildargv = [sys.executable, '/usr/bin/scons']
@@ -264,7 +266,7 @@ index 0000000..addf444
 +# Setup settings
 +
 +NAME = 'cctbx'
-+VERSION = '0.1'
++VERSION = '2012.05.08.2305'
 +DESCRIPTION = 'cctbx'
 +AUTHOR = 'cctbx'
 +AUTHOR_EMAIL = 'cctbx at cci.lbl.gov'
@@ -305,7 +307,7 @@ index 0000000..addf444
 +      package_dir = PACKDIR,
 +      ext_modules = EXT_MODULES,
 +      cmdclass = {'build_ext': build_ext,
-+                  'install': install},
++                  'install_lib': install_lib},
 +      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 2f0b54f..2d78645 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 c899fbc..ef57294 100644
+index 26f2808..90a4d95 100644
 --- a/cctbx_sources/libtbx/SConscript
 +++ b/cctbx_sources/libtbx/SConscript
 @@ -56,7 +56,7 @@ def set_python_include_and_libs(env_etc):

-- 
Packaging for cctbx



More information about the debian-science-commits mailing list