summaryrefslogtreecommitdiff
path: root/sci-libs/cctbx
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /sci-libs/cctbx
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.xz
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sci-libs/cctbx')
-rw-r--r--sci-libs/cctbx/Manifest1
-rw-r--r--sci-libs/cctbx/cctbx-2010.03.29.2334-r7.ebuild190
-rw-r--r--sci-libs/cctbx/files/2010.03.29.2334-boost.patch516
-rw-r--r--sci-libs/cctbx/files/2010.03.29.2334-clipper.patch77
-rw-r--r--sci-libs/cctbx/files/2010.03.29.2334-flags.patch94
-rw-r--r--sci-libs/cctbx/files/2010.03.29.2334-format-security.patch117
-rw-r--r--sci-libs/cctbx/files/2010.03.29.2334-gcc-4.6.patch29
-rw-r--r--sci-libs/cctbx/files/2010.03.29.2334-gcc-4.7.patch154
-rw-r--r--sci-libs/cctbx/files/2010.03.29.2334-soname.patch123
-rw-r--r--sci-libs/cctbx/files/2010.03.29.2334-tst_server.py.patch15
-rw-r--r--sci-libs/cctbx/metadata.xml18
11 files changed, 1334 insertions, 0 deletions
diff --git a/sci-libs/cctbx/Manifest b/sci-libs/cctbx/Manifest
new file mode 100644
index 00000000000..ac309cf50fd
--- /dev/null
+++ b/sci-libs/cctbx/Manifest
@@ -0,0 +1 @@
+DIST cctbx-2010.03.29.2334.tar.gz 15570372 SHA256 e1fae804caaf8593c7a3f32e4544046f4c00293063d9099721578cc8fbd17213 SHA512 7aafd647db49925fc1df16a9ccb4f8caf040b4d73e9601731eb3da3051467c3005fb2cc95b498501c899cd1bd378e6a6135cffe734cb4f93eccacbc13575b2c8 WHIRLPOOL 5954ce6ae8bd3a29deaa5d7f8b354d9468a87a01fc7d6aa9a0545e1d323b1ee209348e88270e2f50d7985b1916a7b5bf687dfdf871013d3ec35925fde253d9a0
diff --git a/sci-libs/cctbx/cctbx-2010.03.29.2334-r7.ebuild b/sci-libs/cctbx/cctbx-2010.03.29.2334-r7.ebuild
new file mode 100644
index 00000000000..c00c31bef51
--- /dev/null
+++ b/sci-libs/cctbx/cctbx-2010.03.29.2334-r7.ebuild
@@ -0,0 +1,190 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 )
+
+inherit eutils fortran-2 multilib prefix python-single-r1 toolchain-funcs
+
+MY_PV="${PV//./_}"
+
+DESCRIPTION="Computational Crystallography Toolbox"
+HOMEPAGE="http://cctbx.sourceforge.net/"
+SRC_URI="http://cci.lbl.gov/cctbx_build/results/${MY_PV}/${PN}_bundle.tar.gz -> ${P}.tar.gz"
+
+LICENSE="cctbx-2.0"
+SLOT="0"
+KEYWORDS="amd64 ~ppc x86 ~amd64-linux ~x86-linux"
+IUSE="+minimal openmp threads"
+
+REQUIRED_USE="
+ ${PYTHON_REQUIRED_USE}
+ ?? ( openmp threads )"
+
+RDEPEND="
+ ${PYTHON_DEPS}
+ >=dev-libs/boost-1.48[python,${PYTHON_USEDEP}]
+ sci-libs/clipper
+ sci-libs/fftw:3.0=
+ !minimal? (
+ sci-chemistry/cns
+ sci-chemistry/shelx )"
+DEPEND="${RDEPEND}
+ !prefix? ( >=dev-util/scons-1.2[${PYTHON_USEDEP}] )"
+
+S="${WORKDIR}"
+MY_S="${WORKDIR}"/cctbx_sources
+MY_B="${WORKDIR}"/cctbx_build
+
+pkg_setup() {
+ use openmp && FORTRAN_NEED_OPENMP="1"
+ if use openmp && ! tc-has-openmp; then
+ ewarn "You are using gcc and OpenMP is only available with gcc >= 4.2 and icc"
+ ewarn "If you want to build ${PN} with OpenMP, abort now,"
+ ewarn "and switch CC to an OpenMP capable compiler"
+ FORTRAN_NEED_OPENMP=1
+ fi
+ fortran-2_pkg_setup
+ python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ local opts
+ local optsld
+
+ epatch \
+ "${FILESDIR}"/${PV}-tst_server.py.patch \
+ "${FILESDIR}"/${PV}-boost.patch \
+ "${FILESDIR}"/${PV}-clipper.patch \
+ "${FILESDIR}"/${PV}-flags.patch \
+ "${FILESDIR}"/${PV}-soname.patch \
+ "${FILESDIR}"/${PV}-gcc-4.6.patch \
+ "${FILESDIR}"/${PV}-gcc-4.7.patch \
+ "${FILESDIR}"/${PV}-format-security.patch
+
+ eprefixify "${MY_S}"/scitbx/libtbx_refresh.py
+
+ rm -rvf "${MY_S}/boost" "${MY_S}/PyCifRW" >> "${T}"/clean.log || die
+ if ! use prefix; then
+ rm -rvf "${MY_S}/scons" >> "${T}"/clean.log || die
+ echo "import os, sys; os.execvp('scons', sys.argv)" > "${MY_S}"/libtbx/command_line/scons.py || die
+ fi
+
+ find "${MY_S}/clipper" -name "*.h" -print -delete >> "${T}"/clean.log || die
+
+ sed \
+ -e "/LIBS/s:boost_python:boost_python-$(echo ${EPYTHON} | sed 's/python//'):g" \
+ -i "${MY_S}"/boost_adaptbx/SConscript "${MY_S}"/scitbx/boost_python/SConscript || die
+}
+
+src_configure() {
+ local compiler
+ local myconf
+
+ myconf="${MY_S}/libtbx/configure.py"
+
+ compiler=$(expr match "$(tc-getCC)" '.*\([a-z]cc\)')
+ myconf="${myconf} --compiler=${compiler}"
+
+ # Additional USE flag usage
+ myconf="${myconf} --enable-openmp-if-possible=$(usex openmp true false)"
+
+ use threads && USEthreads="--enable-boost-threads"
+
+ myconf="${myconf} ${USE_threads} --scan-boost --use_environment_flags"
+
+ mkdir "${MY_B}" && myconf="${myconf} --current_working_directory=${MY_B}"
+ cd "${MY_B}"
+
+ myconf="${myconf} --build=release fftw3tbx rstbx smtbx mmtbx clipper_adaptbx fable"
+ einfo "configuring with ${python} ${myconf}"
+
+ ${EPYTHON} ${myconf} || die "configure failed"
+}
+
+src_compile() {
+ local makeopts_exp
+
+ cd "${MY_B}"
+
+ makeopts_exp=${MAKEOPTS/j/j }
+ makeopts_exp=${makeopts_exp%-l[0-9]*}
+
+ source setpaths_all.sh
+
+ einfo "compiling with libtbx.scons ${makeopts_exp}"
+ libtbx.scons ${makeopts_exp} .|| die "make failed"
+}
+
+src_test(){
+ source "${MY_B}"/setpaths_all.sh
+ libtbx.python $(libtbx.show_dist_paths boost_adaptbx)/tests/tst_rational.py && \
+ libtbx.python ${SCITBX_DIST}/run_tests.py ${MAKEOPTS_EXP} && \
+ libtbx.python ${CCTBX_DIST}/run_tests.py ${MAKEOPTS_EXP} \
+ || die "test failed"
+}
+
+src_install(){
+ local lib baselib
+# find cctbx_build/ -type f \( -name "*.py" -o -name "*sh" \) -exec \
+# sed -e "s:${MY_S}:${EPREFIX}/usr/$(get_libdir)/cctbx/cctbx_sources:g" \
+# -e "s:${MY_B}:${EPREFIX}/usr/$(get_libdir)/cctbx/cctbx_build:g" \
+# -i '{}' \; || die "Fail to correct path"
+
+ sed \
+ -e "s:${MY_B}:${EPREFIX}/usr:g" \
+ -e "s:${MY_S}:${EPREFIX}/$(python_get_sitedir):g" \
+ -i "${MY_B}/libtbx_env" || die
+
+ insinto /usr/share/cctbx
+ doins "${MY_B}/libtbx_env" || die
+
+ ebegin "removing unnessary files"
+ rm -r "${S}"/cctbx_sources/{clipper,ccp4io,ucs-fonts,TAG} || die "failed to remove uneeded scons"
+ find -O3 "${S}" -type f \
+ \( -name "*conftest*" -o -name "*.o" -o -name "*.c" -o -name "*.f" -o -name "*.cpp" -o \
+ -name "*.pyc" -o -name "SCons*" -o -name "Makefile" -o -name "config.log" \) -delete \
+ -print >> "${T}"/clean.log || die
+ find "${S}" -type d -empty -delete -print >> "${T}"/clean.log || die
+ find "${MY_B}" -maxdepth 1 -type f -delete -print >> "${T}"/clean.log || die
+ eend
+
+ dobin "${MY_B}"/bin/*
+ rm -vrf "${MY_B}/bin" >> "${T}"/clean.log || die
+ dolib.so "${MY_B}"/lib/lib*
+ mv "${ED}"/usr/$(get_libdir)/libscitbx_min{,i}pack.so || die
+ rm -vf "${MY_B}"/lib/lib* >> "${T}"/clean.log || die
+
+ for lib in "${ED}"/usr/$(get_libdir)/*.so; do
+ baselib=$(basename ${lib})
+ mv ${lib}{,.0.0} || die
+ dosym ${baselib}.0.0 /usr/$(get_libdir)/${baselib}
+ done
+
+ insinto /usr/include
+ doins -r "${MY_B}"/include/* || die
+ rm -rvf "${MY_B}/include" >> "${T}"/clean.log || die
+
+ insinto /usr/libexec/${PN}
+ doins -r "${MY_B}"/* || die
+ find "${ED}"/usr/libexec/${PN} -type f -exec chmod 755 '{}' \;
+
+ cd "${MY_S}"
+ python_domodule * "${MY_B}"/lib/*
+ rm -rvf "${MY_B}/lib" >> "${T}"/clean.log || die
+
+ sed \
+ -e "/PYTHONPATH/s:${MY_S}:$(python_get_sitedir):g" \
+ -e "/PYTHONPATH/s:${MY_B}:$(python_get_sitedir):g" \
+ -e "/LD_LIBRARY_PATH/s:${MY_B}/lib:${EPREFIX}/usr/$(get_libdir):g" \
+ -e "/PATH/s:${MY_B}/bin:${EPREFIX}/usr/bin:g" \
+ -e "/PATH/s:${MY_B}/exe:${EPREFIX}/usr/bin:g" \
+ -e "/exec/s:${MY_S}:$(python_get_sitedir):g" \
+ -e "/LIBTBX_BUILD/s:${MY_B}:${EPREFIX}/usr/share/cctbx:g" \
+ -e "s:${MY_B}/exe_dev/:${EPREFIX}/usr/libexec/${PN}/exe_dev/:g" \
+ -i "${ED}"/usr/bin/* || die
+
+ python_optimize
+}
diff --git a/sci-libs/cctbx/files/2010.03.29.2334-boost.patch b/sci-libs/cctbx/files/2010.03.29.2334-boost.patch
new file mode 100644
index 00000000000..5b4439ee678
--- /dev/null
+++ b/sci-libs/cctbx/files/2010.03.29.2334-boost.patch
@@ -0,0 +1,516 @@
+From 7e77ff8694b87e95efe56ed961fbc8dd30d8c238 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <gentoo@mgorny.alt.pl>
+Date: Sun, 4 Jul 2010 12:21:10 +0200
+Subject: [PATCH] Unbundle boost.
+
+---
+ work/cctbx_sources/boost_adaptbx/SConscript | 260 -------------------------
+ work/cctbx_sources/cbflib_adaptbx/SConscript | 1 -
+ work/cctbx_sources/cctbx/SConscript | 1 -
+ work/cctbx_sources/clipper_adaptbx/SConscript | 1 -
+ work/cctbx_sources/fable/SConscript | 1 -
+ work/cctbx_sources/fable/libtbx_config | 2 +-
+ work/cctbx_sources/fftw3tbx/SConscript | 1 -
+ work/cctbx_sources/gltbx/SConscript | 1 -
+ work/cctbx_sources/iotbx/SConscript | 2 -
+ work/cctbx_sources/mmtbx/SConscript | 1 -
+ work/cctbx_sources/omptbx/libtbx_config | 2 +-
+ work/cctbx_sources/rstbx/SConscript | 1 -
+ work/cctbx_sources/scitbx/SConscript | 1 -
+ work/cctbx_sources/scitbx/libtbx_config | 2 +-
+ work/cctbx_sources/scitbx/libtbx_refresh.py | 3 +-
+ work/cctbx_sources/smtbx/SConscript | 1 -
+ work/cctbx_sources/spotfinder/SConscript | 1 -
+ work/cctbx_sources/tntbx/SConscript | 1 -
+ 18 files changed, 4 insertions(+), 279 deletions(-)
+
+diff --git a/work/cctbx_sources/boost_adaptbx/SConscript b/work/cctbx_sources/boost_adaptbx/SConscript
+index 0701816..9f8cbf9 100644
+--- a/work/cctbx_sources/boost_adaptbx/SConscript
++++ b/work/cctbx_sources/boost_adaptbx/SConscript
+@@ -8,39 +8,9 @@ import string
+ 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
+ env_etc.boost_adaptbx_dist = libtbx.env.dist_path("boost_adaptbx")
+ env_etc.boost_adaptbx_include = os.path.dirname(env_etc.boost_adaptbx_dist)
+
+-def build_boost_thread():
+- if (not libtbx.env.build_options.enable_boost_threads):
+- return
+- if (sys.platform == "win32"): s = "win32"
+- else: s = "pthread"
+- join = os.path.join
+- src = join("libs", "thread", "src", s)
+- prefix = "#" + join(os.path.basename(env_etc.boost_dist), src)
+- source = []
+- for node in sorted(os.listdir(join(env_etc.boost_dist, src))):
+- if (not node.lower().endswith(".cpp")): continue
+- source.append(join(prefix, node))
+- env = env_base.Clone(
+- SHLINKFLAGS=env_etc.shlinkflags)
+- env.Append(SHCXXFLAGS=["-DBOOST_THREAD_BUILD_DLL"])
+- env_etc.include_registry.append(
+- env=env,
+- paths=[env_etc.boost_include])
+- darwin_shlinkcom(env_etc, env,
+- 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)
+-
+-build_boost_thread()
+-
+ if (not env_etc.no_boost_python):
+ env_etc.cxxflags_bpl_defines_base = [
+ "-DBOOST_PYTHON_MAX_BASES=2"]
+@@ -64,12 +34,10 @@ if (not env_etc.no_boost_python):
+ ' /manifest ${TARGET}.manifest'])
+ Export("env_no_includes_boost_python_ext")
+ env_pure_boost_python_ext = env_no_includes_boost_python_ext.Clone()
+- env_etc.include_registry.set_boost_dir_name(env_etc.boost_dist)
+ env_etc.include_registry.append(
+ env=env_pure_boost_python_ext,
+ paths=[
+ "#include",
+- env_etc.boost_include,
+ env_etc.python_include])
+ env_boost_python_ext = env_pure_boost_python_ext.Clone()
+ env_etc.include_registry.prepend(
+@@ -113,234 +81,6 @@ if (not env_etc.no_boost_python):
+ target="tests/tst_optional_copy",
+ source="tests/tst_optional_copy.cpp")
+
+- import os, os.path
+- env = env_base.Clone(LIBS=env_etc.libs_python)
+- env.Append(LIBPATH=env_etc.libpath_python)
+- env.Append(SHCXXFLAGS=env_etc.cxxflags_bpl_defines_base)
+- env.Append(SHCXXFLAGS=["-DBOOST_PYTHON_SOURCE"])
+- if (libtbx.env.build_options.boost_python_bool_int_strict):
+- env.Append(SHCXXFLAGS=["-DBOOST_PYTHON_BOOL_INT_STRICT"])
+- env.Replace(SHLINKFLAGS=env_etc.shlinkflags)
+- env.Append(CXXFLAGS=env_etc.cxxflags_bpl_defines_base)
+- env.Append(CXXFLAGS="-DBOOST_PYTHON_SOURCE")
+- env.Replace(LINKFLAGS=env_etc.shlinkflags)
+- env_etc.include_registry.append(
+- env=env,
+- paths=[env_etc.boost_include, env_etc.python_include])
+-
+- darwin_shlinkcom(env_etc, env,
+- lo="boost/libs/python/src/libboost_python.lo",
+- dylib="lib/libboost_python.dylib")
+-
+- # fixed list of file names introduced 2009-09-29, due to major changes in
+- # boost/libs/python/build/Jamfile.v2 svn rev. 56305 (new Python 3 support)
+- bpl_dll_sources = """\
+-numeric.cpp
+-list.cpp
+-long.cpp
+-dict.cpp
+-tuple.cpp
+-str.cpp
+-slice.cpp
+-converter/from_python.cpp
+-converter/registry.cpp
+-converter/type_id.cpp
+-object/enum.cpp
+-object/class.cpp
+-object/function.cpp
+-object/inheritance.cpp
+-object/life_support.cpp
+-object/pickle_support.cpp
+-errors.cpp
+-module.cpp
+-converter/builtin_converters.cpp
+-converter/arg_to_python_base.cpp
+-object/iterator.cpp
+-object/stl_iterator.cpp
+-object_protocol.cpp
+-object_operators.cpp
+-wrapper.cpp
+-import.cpp
+-exec.cpp
+-object/function_doc_signature.cpp
+-""".splitlines()
+- prefix = "#"+os.path.join(
+- os.path.basename(env_etc.boost_dist), "libs", "python", "src")
+- bpl_dll_sources = [os.path.join(prefix, path) for path in bpl_dll_sources]
+- #
+- env.Repository(os.path.dirname(env_etc.boost_dist))
+- if (env_etc.static_bpl):
+- env.StaticLibrary(target="#lib/boost_python", source=bpl_dll_sources)
+- else:
+- env.SharedLibrary(target="#lib/boost_python", source=bpl_dll_sources)
+- if (int(ARGUMENTS.get("boost_python_tests", 0))):
+- warn_if_unexpected_md5_hexdigest(
+- path=libtbx.env.under_dist("boost", "libs/python/test/Jamfile.v2"),
+- expected_md5_hexdigests=[
+- "c7a3dd81bf730635146f5c908ac982eb", # svn revision 39065M
+- "d40aac0029bcd28f6e205ae3b30a1284", # svn revision 40216
+- "b79f016d3ec10cf1625a9e006e605428", # svn revision 40714
+- "f948983d970fd47e83a3a785bb54520a", # svn revision 41550
+- "c3d84006331d534840c42ab956fdfa05", # svn revision 50367M
+- "cedfd061d767a27413ef4a75ee0e446f", # svn revision 56310
+- "e5507482a1937825e4c9f3ffe555fc59", # svn revision 59331
+- ])
+- bpl_tests = Split("""
+-staticmethod
+-shared_ptr
+-enable_shared_from_this
+-andreas_beyer
+-polymorphism
+-polymorphism2
+-auto_ptr
+-minimal
+-args
+-numpy
+-enum
+-exception_translator
+-test_pointer_adoption
+-operators
+-callbacks
+-defaults
+-object
+-list
+-long
+-dict
+-tuple
+-str
+-virtual_functions
+-back_reference
+-implicit
+-data_members
+-ben_scott1
+-bienstman1
+-bienstman2
+-bienstman3
+-multi_arg_constructor
+-extract
+-opaque
+-pickle1
+-pickle2
+-pickle3
+-pickle4
+-nested
+-docstring
+-pytype_function
+-bienstman4
+-bienstman5
+-test_builtin_converters,builtin_converters_ext,test_builtin_converters
+-cltree,cltree,test_cltree
+-m1,m1,newtest
+-m2,m2,newtest
+-iterator,iterator_ext,iterator
+-input_iterator,input_iterator,iterator
+-crossmod_exception_a,crossmod_exception_a,crossmod_exception
+-crossmod_exception_b,crossmod_exception_b,crossmod_exception
+-vector_indexing_suite
+-return_arg
+-keywords,keywords,keywords_test
+-properties
+-map_indexing_suite;int_map_indexing_suite;a_map_indexing_suite,map_indexing_suite_ext,map_indexing_suite
+-injected
+-slice
+-const_argument
+-raw_ctor
+-pointer_vector
+-wrapper_held_type
+-polymorphism2_auto_ptr
+-stl_iterator
+-voidptr
+-crossmod_opaque_a,crossmod_opaque_a,crossmod_opaque
+-crossmod_opaque_b,crossmod_opaque_b,crossmod_opaque
+-""")
+-# non-portable tests are not included above:
+-# calling_conventions
+-# calling_conventions_mf
+-#
+- Import("env_boost_python_ext")
+- test_dir = libtbx.env.under_dist("boost", "libs/python/test")
+- prefix = "#"+os.path.join(
+- os.path.basename(env_etc.boost_dist), "libs", "python", "test")
+- all_tst = []
+- for bpl_test in bpl_tests:
+- flds = bpl_test.split(",")
+- assert len(flds) in (1,3)
+- if (len(flds) == 1):
+- src = bpl_test
+- pyd = bpl_test + "_ext"
+- tst = bpl_test
+- else:
+- src = flds[0]
+- pyd = flds[1]
+- tst = flds[2]
+- env = env_pure_boost_python_ext.Clone()
+- env.Repository(os.path.dirname(env_etc.boost_dist))
+- ok = True
+- source = []
+- for s in src.split(";"):
+- cpp = "%s.cpp" % s
+- file_name = os.path.join(test_dir, cpp)
+- if (not os.path.isfile(file_name)):
+- print "Warning: source file not available:", show_string(file_name)
+- ok = False
+- else:
+- source.append(os.path.join(prefix, cpp))
+- if (ok):
+- if (not tst in all_tst):
+- all_tst.append(tst)
+- env.SharedLibrary(target="#lib/%s" % pyd, source=source)
+- all_tst = [os.path.join(test_dir, tst+".py") for tst in all_tst]
+- #
+- if (sys.platform == "linux2"):
+- base_lib = libtbx.env.under_build(path="base/lib")
+- if (os.path.isdir(base_lib)):
+- env_prog = env.Clone()
+- env_prog.Append(LIBPATH=[base_lib])
+- env_prog.Append(LIBS=[
+- "-lpython%d.%d" % sys.version_info[:2],
+- "-lpthread",
+- "-lutil",
+- "-ldl"])
+- exe = env_prog.Program(
+- target="boost/libs/python/test/exec_dynamic",
+- source=[os.path.join(prefix, "exec.cpp")])
+- libtbx.env.write_dispatcher_in_bin(
+- source_file=exe[0].get_abspath(),
+- target_file="boost_libs_python_test_exec_dynamic")
+- all_tst.append("$ boost_libs_python_test_exec_dynamic %s"
+- % show_string(os.path.join(test_dir, "exec.py")))
+- #
+- if (os.name != "nt"):
+- env.SharedLibrary(
+- target="#lib/boost_adaptbx_char_array_ext",
+- source=["char_array_ext.cpp"])
+- all_tst.append(
+- libtbx.env.under_dist("boost_adaptbx", "tests/tst_char_array.py"))
+- #
+- if (os.name == "nt"):
+- boost_python_run_tests = \
+- "%s\\boost_python_run_tests.bat" % libtbx.env.build_path
+- f = open(boost_python_run_tests, "w")
+- for tst in all_tst:
+- if (tst.startswith("$ ")):
+- print >> f, 'call %s' % tst[2:]
+- else:
+- print >> f, 'call libtbx.python %s' % show_string(tst)
+- f.close()
+- else:
+- boost_python_run_tests = \
+- "%s/boost_python_run_tests.csh" % libtbx.env.build_path
+- f = open(boost_python_run_tests, "w")
+- print >> f, "#! /bin/csh -f"
+- print >> f, "set verbose"
+- for tst in all_tst:
+- if (tst.startswith("$ ")):
+- print >> f, tst[2:]
+- else:
+- print >> f, 'libtbx.python "%s"' % show_string(tst)
+- f.close()
+- os.chmod(boost_python_run_tests, 0755)
+-
+ def write_type_id_eq_h():
+ unsigned_types = [
+ "unsigned short",
+diff --git a/work/cctbx_sources/cbflib_adaptbx/SConscript b/work/cctbx_sources/cbflib_adaptbx/SConscript
+index 78c1297..dffc247 100644
+--- a/work/cctbx_sources/cbflib_adaptbx/SConscript
++++ b/work/cctbx_sources/cbflib_adaptbx/SConscript
+@@ -14,7 +14,6 @@ env_etc.cbflib_common_includes = [
+ env_etc.libtbx_include,
+ env_etc.scitbx_include,
+ env_etc.boost_adaptbx_include,
+- env_etc.boost_include,
+ env_etc.cbflib_dist, # for the adaptor cpp files
+ env_etc.cbflib_include[0], # for the cbflib c-files
+ env_etc.cbflib_include[1], # for the cbflib c-files
+diff --git a/work/cctbx_sources/cctbx/SConscript b/work/cctbx_sources/cctbx/SConscript
+index 6ec7c93..2dfb442 100644
+--- a/work/cctbx_sources/cctbx/SConscript
++++ b/work/cctbx_sources/cctbx/SConscript
+@@ -10,7 +10,6 @@ env_etc.cctbx_common_includes = [
+ env_etc.scitbx_include,
+ env_etc.chiltbx_include,
+ env_etc.omptbx_include,
+- env_etc.boost_include,
+ ]
+
+ env = env_base.Clone(
+diff --git a/work/cctbx_sources/fable/SConscript b/work/cctbx_sources/fable/SConscript
+index bf8e198..b6acccf 100644
+--- a/work/cctbx_sources/fable/SConscript
++++ b/work/cctbx_sources/fable/SConscript
+@@ -13,7 +13,6 @@ if (not env_etc.no_boost_python):
+ env_etc.libtbx_include,
+ env_etc.fable_include,
+ env_etc.boost_adaptbx_include,
+- env_etc.boost_include,
+ env_etc.python_include])
+ env.SharedLibrary(
+ target="#lib/fable_ext",
+diff --git a/work/cctbx_sources/fable/libtbx_config b/work/cctbx_sources/fable/libtbx_config
+index d456588..f00ae86 100644
+--- a/work/cctbx_sources/fable/libtbx_config
++++ b/work/cctbx_sources/fable/libtbx_config
+@@ -1,4 +1,4 @@
+ {
+- "modules_required_for_build": ["boost"],
++ "modules_required_for_build": [],
+ "modules_required_for_use": ["boost_adaptbx"],
+ }
+diff --git a/work/cctbx_sources/fftw3tbx/SConscript b/work/cctbx_sources/fftw3tbx/SConscript
+index ecc3a03..4fc1ec1 100755
+--- a/work/cctbx_sources/fftw3tbx/SConscript
++++ b/work/cctbx_sources/fftw3tbx/SConscript
+@@ -8,7 +8,6 @@ env_etc.fftw3tbx_dist = libtbx.env.dist_path("fftw3tbx")
+ env_etc.fftw3tbx_common_includes = [
+ env_etc.libtbx_include,
+ env_etc.scitbx_include,
+- env_etc.boost_include,
+ ]
+
+ base_include = libtbx.env.under_build("base/include")
+diff --git a/work/cctbx_sources/gltbx/SConscript b/work/cctbx_sources/gltbx/SConscript
+index 56a7115..f6214a4 100644
+--- a/work/cctbx_sources/gltbx/SConscript
++++ b/work/cctbx_sources/gltbx/SConscript
+@@ -7,7 +7,6 @@ env_etc.gltbx_common_includes = [
+ env_etc.libtbx_include,
+ env_etc.gltbx_include,
+ env_etc.scitbx_include,
+- env_etc.boost_include,
+ ]
+
+ if (not env_etc.no_boost_python):
+diff --git a/work/cctbx_sources/iotbx/SConscript b/work/cctbx_sources/iotbx/SConscript
+index df17856..c5cf7da 100644
+--- a/work/cctbx_sources/iotbx/SConscript
++++ b/work/cctbx_sources/iotbx/SConscript
+@@ -10,7 +10,6 @@ env_etc.iotbx_common_includes = [
+ env_etc.iotbx_include,
+ env_etc.cctbx_include,
+ env_etc.scitbx_include,
+- env_etc.boost_include,
+ env_etc.boost_adaptbx_include,
+ ]
+
+@@ -37,7 +36,6 @@ if (not env_etc.no_boost_python):
+ env_etc.include_registry.append(
+ env=env,
+ paths=[env_etc.libtbx_include,
+- env_etc.boost_include,
+ env_etc.python_include])
+ env.SharedLibrary(
+ target="#lib/iotbx_wildcard_ext",
+diff --git a/work/cctbx_sources/mmtbx/SConscript b/work/cctbx_sources/mmtbx/SConscript
+index 0532878..9bcaeb2 100755
+--- a/work/cctbx_sources/mmtbx/SConscript
++++ b/work/cctbx_sources/mmtbx/SConscript
+@@ -10,7 +10,6 @@ env_etc.mmtbx_common_includes = [
+ env_etc.mmtbx_include,
+ env_etc.cctbx_include,
+ env_etc.scitbx_include,
+- env_etc.boost_include,
+ ]
+
+ if (not env_etc.no_boost_python):
+diff --git a/work/cctbx_sources/omptbx/libtbx_config b/work/cctbx_sources/omptbx/libtbx_config
+index d456588..f00ae86 100644
+--- a/work/cctbx_sources/omptbx/libtbx_config
++++ b/work/cctbx_sources/omptbx/libtbx_config
+@@ -1,4 +1,4 @@
+ {
+- "modules_required_for_build": ["boost"],
++ "modules_required_for_build": [],
+ "modules_required_for_use": ["boost_adaptbx"],
+ }
+diff --git a/work/cctbx_sources/rstbx/SConscript b/work/cctbx_sources/rstbx/SConscript
+index 2213c2f..232b5d7 100644
+--- a/work/cctbx_sources/rstbx/SConscript
++++ b/work/cctbx_sources/rstbx/SConscript
+@@ -11,7 +11,6 @@ env_etc.rstbx_common_includes = [
+ env_etc.scitbx_include,
+ env_etc.chiltbx_include,
+ env_etc.omptbx_include,
+- env_etc.boost_include,
+ ]
+
+ env = env_base.Clone(SHLINKFLAGS=env_etc.shlinkflags)
+diff --git a/work/cctbx_sources/scitbx/SConscript b/work/cctbx_sources/scitbx/SConscript
+index f30b9db..10e0967 100644
+--- a/work/cctbx_sources/scitbx/SConscript
++++ b/work/cctbx_sources/scitbx/SConscript
+@@ -9,7 +9,6 @@ env_etc.scitbx_common_includes = [
+ env_etc.scitbx_include,
+ env_etc.omptbx_include,
+ env_etc.boost_adaptbx_include,
+- env_etc.boost_include,
+ ]
+
+ SConscript("error/SConscript")
+diff --git a/work/cctbx_sources/scitbx/libtbx_config b/work/cctbx_sources/scitbx/libtbx_config
+index 87cc3c7..d147819 100644
+--- a/work/cctbx_sources/scitbx/libtbx_config
++++ b/work/cctbx_sources/scitbx/libtbx_config
+@@ -1,4 +1,4 @@
+ {
+- "modules_required_for_build": ["boost"],
++ "modules_required_for_build": [],
+ "modules_required_for_use": ["boost_adaptbx", "omptbx"],
+ }
+diff --git a/work/cctbx_sources/scitbx/libtbx_refresh.py b/work/cctbx_sources/scitbx/libtbx_refresh.py
+index 10d4ee0..c8374b2 100644
+--- a/work/cctbx_sources/scitbx/libtbx_refresh.py
++++ b/work/cctbx_sources/scitbx/libtbx_refresh.py
+@@ -13,8 +13,7 @@ if (self.env.is_ready_for_build()):
+ generate_all.refresh(array_family=os.path.dirname(target_dir))
+ #
+ warn_if_unexpected_md5_hexdigest(
+- path=self.env.under_dist(
+- module_name="boost", path="boost/random/mersenne_twister.hpp"),
++ path="@GENTOO_PORTAGE_EPREFIX@/usr/include/boost/random/mersenne_twister.hpp",
+ expected_md5_hexdigests=[
+ "a2533c79a21f0f773f2e0d29a37371b0", # CVS revision 1.21
+ "378432b5b280c9c0c894f7c80f0dad92", # CVS revision 1.20
+diff --git a/work/cctbx_sources/smtbx/SConscript b/work/cctbx_sources/smtbx/SConscript
+index f5031ee..02f81a4 100644
+--- a/work/cctbx_sources/smtbx/SConscript
++++ b/work/cctbx_sources/smtbx/SConscript
+@@ -7,7 +7,6 @@ env_etc.smtbx_common_includes = [
+ env_etc.cctbx_include,
+ env_etc.scitbx_include,
+ env_etc.chiltbx_include,
+- env_etc.boost_include,
+ ]
+
+ env = env_base.Clone(
+diff --git a/work/cctbx_sources/spotfinder/SConscript b/work/cctbx_sources/spotfinder/SConscript
+index 1d280d4..9dc9195 100644
+--- a/work/cctbx_sources/spotfinder/SConscript
++++ b/work/cctbx_sources/spotfinder/SConscript
+@@ -13,7 +13,6 @@ env_etc.spotfinder_common_includes = [
+ env_etc.iotbx_include,
+ os.path.dirname(env_etc.spotfinder_dist),
+ env_etc.boost_adaptbx_include,
+- env_etc.boost_include,
+ env_etc.annlib_dist,
+ env_etc.annlib_include[0],
+ env_etc.annlib_include[1],
+diff --git a/work/cctbx_sources/tntbx/SConscript b/work/cctbx_sources/tntbx/SConscript
+index e773186..ee29f10 100755
+--- a/work/cctbx_sources/tntbx/SConscript
++++ b/work/cctbx_sources/tntbx/SConscript
+@@ -10,7 +10,6 @@ env_etc.tntbx_common_includes = [
+ env_etc.tntbx_include,
+ env_etc.tntbx_tnt_include,
+ env_etc.scitbx_include,
+- env_etc.boost_include,
+ ]
+
+ Import("env_base", "env_etc")
+--
+1.7.1.1
diff --git a/sci-libs/cctbx/files/2010.03.29.2334-clipper.patch b/sci-libs/cctbx/files/2010.03.29.2334-clipper.patch
new file mode 100644
index 00000000000..8830dd8a054
--- /dev/null
+++ b/sci-libs/cctbx/files/2010.03.29.2334-clipper.patch
@@ -0,0 +1,77 @@
+diff --git a/cctbx_sources/clipper_adaptbx/SConscript b/cctbx_sources/clipper_adaptbx/SConscript
+index 9cce49e..1046ed0 100644
+--- a/cctbx_sources/clipper_adaptbx/SConscript
++++ b/cctbx_sources/clipper_adaptbx/SConscript
+@@ -1,56 +1,13 @@
+ import libtbx.load_env
+ Import("env_base", "env_etc")
+
+-env_etc.clipper_dist = libtbx.env.dist_path("clipper")
+-env_etc.clipper_include = env_etc.clipper_dist
+-
+ env = env_base.Clone(
+ SHLINKFLAGS=env_etc.shlinkflags,
+ LIBS=env_etc.libm)
+-env.Prepend(CPPPATH=[env_etc.clipper_include])
+-
+-if (env_etc.static_libraries): builder = env.StaticLibrary
+-else: builder = env.SharedLibrary
+-builder(target='#lib/clipper',
+- source = ["../clipper/clipper/core/"+file_name for file_name in """
+- atomsf.cpp
+- cell.cpp
+- clipper_memory.cpp
+- clipper_message.cpp
+- clipper_stats.cpp
+- clipper_types.cpp
+- clipper_util.cpp
+- container.cpp
+- container_hkl.cpp
+- container_map.cpp
+- container_types.cpp
+- coords.cpp
+- derivs.cpp
+- hkl_compute.cpp
+- hkl_data.cpp
+- hkl_datatypes.cpp
+- hkl_info.cpp
+- hkl_lookup.cpp
+- hkl_operators.cpp
+- map_interp.cpp
+- map_utils.cpp
+- nxmap.cpp
+- nxmap_operator.cpp
+- ramachandran.cpp
+- resol_basisfn.cpp
+- resol_fn.cpp
+- resol_targetfn.cpp
+- rotation.cpp
+- spacegroup.cpp
+- spacegroup_data.cpp
+- symop.cpp
+- xmap.cpp
+-""".split()])
+-# fftmap_sparse.cpp
+-# fftmap.cpp
+
+ env_exe = env.Clone()
+-env_exe.Prepend(LIBS=["clipper"])
++env_exe.Prepend(LIBS=["clipper-minimol","clipper-mmdb","clipper-cns","clipper-cif","clipper-contrib","clipper-ccp4","clipper-phs","clipper-core"])
++env_exe.Prepend(SHLINKFLAGS=["-Wl,--as-needed"])
+
+ exe = env_exe.Program(
+ target='#exe_dev/'+env["PROGPREFIX"]+'clipper.symtest'
+@@ -76,12 +33,10 @@ if (hasattr(env_etc, "cctbx_include")):
+ env_etc.include_registry.append(
+ env=env_clipper_boost_python_ext,
+ paths=[
+- env_etc.clipper_include,
+ env_etc.libtbx_include,
+ env_etc.cctbx_include,
+ env_etc.scitbx_include,
+ env_etc.boost_adaptbx_include,
+- env_etc.boost_include,
+ env_etc.python_include])
+ Export("env_clipper_boost_python_ext")
+- SConscript("clipper/SConscript")
++
diff --git a/sci-libs/cctbx/files/2010.03.29.2334-flags.patch b/sci-libs/cctbx/files/2010.03.29.2334-flags.patch
new file mode 100644
index 00000000000..8a803323471
--- /dev/null
+++ b/sci-libs/cctbx/files/2010.03.29.2334-flags.patch
@@ -0,0 +1,94 @@
+diff --git a/cctbx_sources/libtbx/SConscript b/cctbx_sources/libtbx/SConscript
+index 16d22b6..f85b664 100644
+--- a/cctbx_sources/libtbx/SConscript
++++ b/cctbx_sources/libtbx/SConscript
+@@ -5,6 +5,7 @@ from libtbx.str_utils import show_string
+ from libtbx.path import norm_join, full_command_path
+ import platform
+ import sys, os
++import SCons.Util
+
+ if (hasattr(Environment, "Clone")):
+ Environment.Copy = Environment.Clone # XXX backward compatibility 2008_03_30
+@@ -132,9 +133,7 @@ if (env_etc.compiler == "unix_icpc"):
+ static_exe = libtbx.env.build_options.static_exe
+
+ def gcc_common_warn_options():
+- result = ["-Wall", "-Wno-sign-compare", "-Wno-unknown-pragmas"]
+- if (env_etc.gcc_version >= 40000):
+- result.append("-Winit-self")
++ result = [""]
+ return result
+
+ def enable_more_warnings(env):
+@@ -355,16 +354,22 @@ else:
+ cc = env_etc.compiler.replace("unix_", "")
+ cxx = cc.replace("gcc", "g++")
+ env_etc.gcc_version = libtbx.env_config.get_gcc_version(command_name=cc)
++# linkerflags = os.environ.get("LDFLAGS")
++# link_flags=env_etc.ldflags
++ link_flags=os.environ.get("LDFLAGS")
++ linker_options=SCons.Util.CLVar(os.environ['LDFLAGS'])
+ env_base.Replace(
+ CC=cc,
+ SHCC=cc,
+ CXX=cxx,
+ LINK=cxx,
++ LINKFLAGS=linker_options,
+ SHCXX=cxx,
+ SHLINK=cxx,
+ SHLIBSUFFIX=env_etc.shlibsuffix,
+ )
+- env_etc.c_link = cc
++# linkerflags = env_etc.ldflags
++# env_etc.c_link = cc + " " + linkerflags
+ env_etc.ccflags_base = [
+ "-fPIC",
+ "-fno-strict-aliasing"]
+@@ -380,7 +385,7 @@ else:
+ warn_options = gcc_common_warn_options() + ["-Werror"]
+ env_etc.ccflags_base.extend(warn_options)
+ if (libtbx.env.build_options.optimization):
+- opts = ["-DNDEBUG", "-O3", "-ffast-math"]
++ opts = ["-DNDEBUG"]
+ if (env_etc.gcc_version >= 40300):
+ opts.append("-fno-associative-math")
+ opts.append("-ftrapping-math")
+@@ -401,6 +406,7 @@ else:
+ env_base.Prepend(LINKFLAGS=["-static"])
+ static_exe = None
+ env_etc.shlinkflags = ["-shared"]
++ env_etc.shlinkflags.append(linker_options)
+ env_etc.shlinkflags_bpl = env_etc.shlinkflags
+ if (libtbx.env.build_options.mode == "profile"):
+ env_base.Prepend(LINKFLAGS=["-pg"])
+diff --git a/cctbx_sources/libtbx/env_config.py b/cctbx_sources/libtbx/env_config.py
+index ca510b9..68c58ea 100644
+--- a/cctbx_sources/libtbx/env_config.py
++++ b/cctbx_sources/libtbx/env_config.py
+@@ -1608,6 +1608,7 @@ class build_options:
+ self.env_cxxflags = ""
+ self.env_cflags = ""
+ self.env_cppflags = ""
++ self.env_ldflags = ""
+ flg = os.environ.get("CXXFLAGS")
+ if flg is not None:
+ self.env_cxxflags = flg
+@@ -1617,6 +1618,9 @@ class build_options:
+ flg = os.environ.get("CPPFLAGS")
+ if flg is not None:
+ self.env_cppflags = flg
++ flg = os.environ.get("LDFLAGS")
++ if flg is not None:
++ self.env_ldflags = flg
+
+ def report(self, f=None):
+ if (f is None): f = sys.stdout
+@@ -1640,6 +1644,7 @@ class build_options:
+ print >>f, " CXXFLAGS = ", self.env_cxxflags
+ print >>f, " CFLAGS = ", self.env_cflags
+ print >>f, " CPPFLAGS = ", self.env_cppflags
++ print >>f, " LDFLAGS = ", self.env_ldflags
+
+ class include_registry:
+
diff --git a/sci-libs/cctbx/files/2010.03.29.2334-format-security.patch b/sci-libs/cctbx/files/2010.03.29.2334-format-security.patch
new file mode 100644
index 00000000000..057c135f995
--- /dev/null
+++ b/sci-libs/cctbx/files/2010.03.29.2334-format-security.patch
@@ -0,0 +1,117 @@
+ cctbx_sources/scitbx/lbfgsb/raw.h | 54 +++++++++++++++++++--------------------
+ 1 file changed, 27 insertions(+), 27 deletions(-)
+
+diff --git a/cctbx_sources/scitbx/lbfgsb/raw.h b/cctbx_sources/scitbx/lbfgsb/raw.h
+index 21afed7..5b15055 100644
+--- a/cctbx_sources/scitbx/lbfgsb/raw.h
++++ b/cctbx_sources/scitbx/lbfgsb/raw.h
+@@ -853,7 +853,7 @@ namespace raw {
+ if (iprint >= 99) {
+ printf(" LINE SEARCH%12d times; norm of step = %.15G\n",
+ iback, xstep);
+- printf(fmt_2001, iter,f,sbgnrm);
++ printf("%s %i %f %f", fmt_2001, iter,f,sbgnrm);
+ if (iprint > 100) {
+ write_ref1(" X =", x);
+ write_ref1(" G =", g);
+@@ -862,7 +862,7 @@ namespace raw {
+ else if (iprint > 0) {
+ int imod = iter % iprint;
+ if (imod == 0) {
+- printf(fmt_2001, iter,f,sbgnrm);
++ printf("%s %i %f %f", fmt_2001, iter,f,sbgnrm);
+ }
+ }
+ if (iprint >= 1) {
+@@ -967,9 +967,9 @@ namespace raw {
+ " 2 rounding error dominate computation.\n";
+ if (task.substr(0,5) == "ERROR") goto lbl_999;
+ if (iprint >= 0) {
+- printf(fmt_3003);
+- printf(fmt_3004);
+- printf(fmt_3005, n,iter,nfgv,nintol,nskip,nact,sbgnrm,f);
++ printf("%s", fmt_3003);
++ printf("%s", fmt_3004);
++ printf("%s %i %i %i %i %i %i %f %f", fmt_3005, n,iter,nfgv,nintol,nskip,nact,sbgnrm,f);
+ if (iprint >= 100) {
+ write_ref1(" X =", x);
+ }
+@@ -977,40 +977,40 @@ namespace raw {
+ }
+ lbl_999:
+ if (iprint >= 0) {
+- printf(fmt_3009, task.c_str());
++ printf("%s %s", fmt_3009, task.c_str());
+ if (info != 0) {
+- if (info == -1) printf(fmt_9011);
+- if (info == -2) printf(fmt_9012);
+- if (info == -3) printf(fmt_9013);
+- if (info == -4) printf(fmt_9014);
+- if (info == -5) printf(fmt_9015);
++ if (info == -1) printf("%s", fmt_9011);
++ if (info == -2) printf("%s", fmt_9012);
++ if (info == -3) printf("%s", fmt_9013);
++ if (info == -4) printf("%s", fmt_9014);
++ if (info == -5) printf("%s", fmt_9015);
+ if (info == -6) {
+ printf(" Input nbd(%12d) is invalid.\n", k);
+ }
+ if (info == -7) {
+ printf(" l(%12d) > u(%12d). No feasible solution.\n", k, k);
+ }
+- if (info == -8) printf(fmt_9018);
+- if (info == -9) printf(fmt_9019);
++ if (info == -8) printf("%s", fmt_9018);
++ if (info == -9) printf("%s", fmt_9019);
+ }
+- if (iprint >= 1) printf(fmt_3007, cachyt,sbtime,lnscht);
+- printf(fmt_3008, time);
++ if (iprint >= 1) printf("%s %f %f %f", fmt_3007, cachyt,sbtime,lnscht);
++ printf("%s %f", fmt_3008, time);
+ if (iprint >= 1) {
+ if (info == -4 || info == -9) {
+- printf(fmt_3002,
++ printf("%s %i %i %i %i %s %i %f %f", fmt_3002,
+ iter,nfgv,nint,nact,word.c_str(),iback,stp,xstep); // itfile
+ }
+- printf(fmt_3009, task.c_str()); // itfile
++ printf("%s %s", fmt_3009, task.c_str()); // itfile
+ if (info != 0) {
+- if (info == -1) printf(fmt_9011); // itfile
+- if (info == -2) printf(fmt_9012); // itfile
+- if (info == -3) printf(fmt_9013); // itfile
+- if (info == -4) printf(fmt_9014); // itfile
+- if (info == -5) printf(fmt_9015); // itfile
+- if (info == -8) printf(fmt_9018); // itfile
+- if (info == -9) printf(fmt_9019); // itfile
++ if (info == -1) printf("%s", fmt_9011); // itfile
++ if (info == -2) printf("%s", fmt_9012); // itfile
++ if (info == -3) printf("%s", fmt_9013); // itfile
++ if (info == -4) printf("%s", fmt_9014); // itfile
++ if (info == -5) printf("%s", fmt_9015); // itfile
++ if (info == -8) printf("%s", fmt_9018); // itfile
++ if (info == -9) printf("%s", fmt_9019); // itfile
+ }
+- printf(fmt_3008, time); // itfile
++ printf("%s %f", fmt_3008, time); // itfile
+ }
+ }
+ }
+@@ -3902,7 +3902,7 @@ namespace raw {
+ " refresh the lbfgs memory and restart the iteration.\n";
+ if (info != 0) {
+ // singular triangular system detected; refresh the lbfgs memory.
+- if(iprint >= 1) printf(fmt_1005);
++ if(iprint >= 1) printf("%s", fmt_1005);
+ info = 0;
+ col = 0;
+ head = 1;
+@@ -3968,7 +3968,7 @@ namespace raw {
+ if (info != 0) {
+ // singular triangular system detected;
+ // refresh the lbfgs memory and restart the iteration.
+- if(iprint >= 1) printf(fmt_1005);
++ if(iprint >= 1) printf("%s", fmt_1005);
+ info = 0;
+ col = 0;
+ head = 1;
diff --git a/sci-libs/cctbx/files/2010.03.29.2334-gcc-4.6.patch b/sci-libs/cctbx/files/2010.03.29.2334-gcc-4.6.patch
new file mode 100644
index 00000000000..e54cfa16838
--- /dev/null
+++ b/sci-libs/cctbx/files/2010.03.29.2334-gcc-4.6.patch
@@ -0,0 +1,29 @@
+ cctbx_sources/scitbx/array_family/detail/misc.h | 1 +
+ .../scitbx/fortran_io/details/istream_scanner.h | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/cctbx_sources/scitbx/array_family/detail/misc.h b/cctbx_sources/scitbx/array_family/detail/misc.h
+index 6ed881e..d7f7f52 100644
+--- a/cctbx_sources/scitbx/array_family/detail/misc.h
++++ b/cctbx_sources/scitbx/array_family/detail/misc.h
+@@ -2,6 +2,7 @@
+ #define SCITBX_ARRAY_FAMILY_MISC_H
+
+ #include <scitbx/array_family/type_traits.h>
++#include <memory>
+
+ namespace scitbx { namespace af {
+
+diff --git a/cctbx_sources/scitbx/fortran_io/details/istream_scanner.h b/cctbx_sources/scitbx/fortran_io/details/istream_scanner.h
+index 8a0ac25..03a0e20 100644
+--- a/cctbx_sources/scitbx/fortran_io/details/istream_scanner.h
++++ b/cctbx_sources/scitbx/fortran_io/details/istream_scanner.h
+@@ -32,7 +32,7 @@ class istream_scanner
+ }
+
+ private:
+- mutable std::basic_istream<CharType> &input;
++ std::basic_istream<CharType> &input;
+ mutable value_t current;
+ };
+
diff --git a/sci-libs/cctbx/files/2010.03.29.2334-gcc-4.7.patch b/sci-libs/cctbx/files/2010.03.29.2334-gcc-4.7.patch
new file mode 100644
index 00000000000..96cb21531bb
--- /dev/null
+++ b/sci-libs/cctbx/files/2010.03.29.2334-gcc-4.7.patch
@@ -0,0 +1,154 @@
+ .../scitbx/math/boost_python/distributions.cpp | 60 +++++++++++++------
+ cctbx_sources/scitbx/rigid_body/spatial_lib.h | 1 +
+ cctbx_sources/scitbx/rigid_body/tardy.h | 4 +-
+ .../refinement/boost_python/weighting_schemes.cpp | 4 +-
+ .../smtbx/structure_factors/direct/standard_xray.h | 4 +-
+ 5 files changed, 48 insertions(+), 25 deletions(-)
+
+diff --git a/cctbx_sources/scitbx/math/boost_python/distributions.cpp b/cctbx_sources/scitbx/math/boost_python/distributions.cpp
+index a676798..68818e7 100644
+--- a/cctbx_sources/scitbx/math/boost_python/distributions.cpp
++++ b/cctbx_sources/scitbx/math/boost_python/distributions.cpp
+@@ -59,29 +59,51 @@ namespace {
+ {
+ typedef Distribution wt;
+
++ #define NEW_MEMBER(name) \
++ static FloatType name(wt const &self) { \
++ return boost::math::name(self); \
++ }
++
++ NEW_MEMBER(mean);
++ NEW_MEMBER(median);
++ NEW_MEMBER(mode);
++ NEW_MEMBER(variance);
++ NEW_MEMBER(standard_deviation);
++ NEW_MEMBER(skewness);
++ NEW_MEMBER(kurtosis);
++
++ #undef NEW_MEMBER
++
++ #define NEW_MEMBER(name) \
++ static FloatType name(wt const &self, FloatType arg) { \
++ return boost::math::name(self, arg); \
++ }
++
++ NEW_MEMBER(pdf);
++ NEW_MEMBER(cdf);
++ NEW_MEMBER(quantile);
++
++ #undef NEW_MEMBER
++
++ static scitbx::af::shared<FloatType> quantiles(wt const &self, std::size_t n) {
++ return scitbx::math::quantiles<FloatType>(self, n);
++ }
++
+ static void
+ wrap()
+ {
+ using namespace boost::python;
+- def("mean", (FloatType(*)(wt const&)) boost::math::mean);
+- def("median", (FloatType(*)(wt const&)) boost::math::median);
+- def("mode", (FloatType(*)(wt const&)) boost::math::mode);
+- def("variance", (FloatType(*)(wt const&)) boost::math::variance);
+- def("standard_deviation",
+- (FloatType(*)(wt const&)) boost::math::standard_deviation);
+- def("skewness", (FloatType(*)(wt const&)) boost::math::skewness);
+- def("kurtosis", (FloatType(*)(wt const&)) boost::math::kurtosis);
+- def("pdf", (FloatType(*)(wt const&, FloatType const&)) boost::math::pdf);
+- def("cdf", (FloatType(*)(wt const&, FloatType const&)) boost::math::cdf);
+- def("quantile", (FloatType(*)(wt const&, FloatType const&))
+- boost::math::quantile);
+- def("quantiles",
+-#if BOOST_WORKAROUND(__EDG_VERSION__, BOOST_TESTED_AT(306))
+- (scitbx::af::shared<FloatType>(*)(wt const&, std::size_t)) quantiles
+-#else
+- quantiles<FloatType, wt>
+-#endif
+- );
++ def("mean" , mean);
++ def("median" , median);
++ def("mode" , mode);
++ def("variance" , variance);
++ def("standard_deviation", standard_deviation);
++ def("skewness" , skewness);
++ def("kurtosis" , kurtosis);
++ def("pdf" , pdf);
++ def("cdf" , cdf);
++ def("quantile" , quantile);
++ def("quantiles" , quantiles);
+ }
+ };
+
+diff --git a/cctbx_sources/scitbx/rigid_body/spatial_lib.h b/cctbx_sources/scitbx/rigid_body/spatial_lib.h
+index a084f0f..e377292 100755
+--- a/cctbx_sources/scitbx/rigid_body/spatial_lib.h
++++ b/cctbx_sources/scitbx/rigid_body/spatial_lib.h
+@@ -2,6 +2,7 @@
+ #define SCITBX_RIGID_BODY_SPATIAL_LIB_H
+
+ #include <scitbx/rotr3.h>
++#include <scitbx/rigid_body/matrix_helpers.h>
+ #include <scitbx/array_family/versa_matrix.h>
+
+ namespace scitbx { namespace rigid_body {
+diff --git a/cctbx_sources/scitbx/rigid_body/tardy.h b/cctbx_sources/scitbx/rigid_body/tardy.h
+index 104f16b..a8f76cc 100755
+--- a/cctbx_sources/scitbx/rigid_body/tardy.h
++++ b/cctbx_sources/scitbx/rigid_body/tardy.h
+@@ -346,7 +346,7 @@ namespace tardy {
+ unsigned nb = this->bodies_size();
+ af::shared<af::small<ft, 7> > result((af::reserve(nb)));
+ af::shared<af::small<ft, 6> >
+- tau_array = f_ext_as_tau(f_ext_array().const_ref());
++ tau_array = this->f_ext_as_tau(f_ext_array().const_ref());
+ for(unsigned ib=0;ib<nb;ib++) {
+ result.push_back(
+ this->bodies[ib]->joint->tau_as_d_e_pot_d_q(tau_array[ib]));
+@@ -379,7 +379,7 @@ namespace tardy {
+ qdd_array()
+ {
+ if (!qdd_array_) {
+- qdd_array_ = forward_dynamics_ab(
++ qdd_array_ = this->forward_dynamics_ab(
+ /*tau_array*/ af::const_ref<af::small<ft, 6> >(0, 0),
+ f_ext_array().const_ref(),
+ /*grav_accn*/ af::const_ref<ft>(0, 0));
+diff --git a/cctbx_sources/smtbx/refinement/boost_python/weighting_schemes.cpp b/cctbx_sources/smtbx/refinement/boost_python/weighting_schemes.cpp
+index ce0c27b..904e8d7 100644
+--- a/cctbx_sources/smtbx/refinement/boost_python/weighting_schemes.cpp
++++ b/cctbx_sources/smtbx/refinement/boost_python/weighting_schemes.cpp
+@@ -25,9 +25,9 @@ namespace smtbx { namespace refinement { namespace least_squares {
+ : base_t(name, boost::python::no_init)
+ {
+ using namespace boost::python;
+- def("__call__", &wt::operator(),
++ this->def("__call__", &wt::operator(),
+ (arg("fo_sq"), arg("sigma"), arg("fc_sq")));
+- def("__call__", weights,
++ this->def("__call__", weights,
+ (arg("fo_sq"), arg("sigmas"), arg("fc_sq")));
+ }
+ };
+diff --git a/cctbx_sources/smtbx/structure_factors/direct/standard_xray.h b/cctbx_sources/smtbx/structure_factors/direct/standard_xray.h
+index 5e2df76..911bfde 100644
+--- a/cctbx_sources/smtbx/structure_factors/direct/standard_xray.h
++++ b/cctbx_sources/smtbx/structure_factors/direct/standard_xray.h
+@@ -161,7 +161,7 @@ namespace smtbx { namespace structure_factors { namespace direct {
+ for (int k=0; k < hr_ht.groups.size(); ++k) {
+ hr_ht_group<float_type> const &g = hr_ht.groups[k];
+ float_type hrx = g.hr * scatterer.site;
+- complex_type f = exp_i_2pi(hrx + g.ht);
++ complex_type f = this->exp_i_2pi(hrx + g.ht);
+ if (scatterer.flags.use_u_aniso()) {
+ float_type dw = debye_waller_factor_u_star(g.hr, scatterer.u_star);
+ f *= dw;
+@@ -336,7 +336,7 @@ namespace smtbx { namespace structure_factors { namespace direct {
+ for (int k=0; k < hr_ht.groups.size(); ++k) {
+ hr_ht_group<float_type> const &g = hr_ht.groups[k];
+ float_type hrx = g.hr * scatterer.site;
+- complex_type f = exp_i_2pi(hrx + g.ht);
++ complex_type f = this->exp_i_2pi(hrx + g.ht);
+ float_type fa = f.real(), fb = f.imag();
+ if (scatterer.flags.use_u_aniso()) {
+ float_type dw = debye_waller_factor_u_star(g.hr, scatterer.u_star);
diff --git a/sci-libs/cctbx/files/2010.03.29.2334-soname.patch b/sci-libs/cctbx/files/2010.03.29.2334-soname.patch
new file mode 100644
index 00000000000..2c0efcabeb1
--- /dev/null
+++ b/sci-libs/cctbx/files/2010.03.29.2334-soname.patch
@@ -0,0 +1,123 @@
+diff --git a/cctbx_sources/ccp4io_adaptbx/SConscript b/cctbx_sources/ccp4io_adaptbx/SConscript
+index 4ff2232..2ee3991 100644
+--- a/cctbx_sources/ccp4io_adaptbx/SConscript
++++ b/cctbx_sources/ccp4io_adaptbx/SConscript
+@@ -40,6 +40,7 @@ def replace_printf(file_name):
+
+ env = env_base.Clone(
+ SHLINKFLAGS=env_etc.shlinkflags)
++env.Append(SHLINKFLAGS=["-Wl,-soname,libccp4io.so.0.0"])
+ env.Append(CCFLAGS=env_etc.ccp4io_defines)
+ env.Append(SHCCFLAGS=env_etc.ccp4io_defines)
+ env_etc.include_registry.append(
+diff --git a/cctbx_sources/cctbx/SConscript b/cctbx_sources/cctbx/SConscript
+index 6ec7c93..7f2e788 100644
+--- a/cctbx_sources/cctbx/SConscript
++++ b/cctbx_sources/cctbx/SConscript
+@@ -15,6 +15,7 @@ env_etc.cctbx_common_includes = [
+
+ env = env_base.Clone(
+ SHLINKFLAGS=env_etc.shlinkflags)
++env.Append(SHLINKFLAGS=["-Wl,-soname,libcctbx.so.0.0"])
+ env_etc.include_registry.append(
+ env=env,
+ paths=env_etc.cctbx_common_includes)
+diff --git a/cctbx_sources/iotbx/mtz/SConscript b/cctbx_sources/iotbx/mtz/SConscript
+index c0a4bb0..d3c1e45 100644
+--- a/cctbx_sources/iotbx/mtz/SConscript
++++ b/cctbx_sources/iotbx/mtz/SConscript
+@@ -6,6 +6,7 @@ ccp4io_lib = getattr(env_etc, "ccp4io_lib", "cmtz")
+ env.Prepend(LIBS=["cctbx", ccp4io_lib]+env_etc.libm)
+ env.Append(CXXFLAGS=env_etc.ccp4io_defines)
+ env.Append(SHCXXFLAGS=env_etc.ccp4io_defines)
++env.Append(SHLINKFLAGS=["-Wl,-soname,libiotbx_mtz.so.0.0"])
+ env_etc.enable_more_warnings(env=env)
+ if (env_etc.static_libraries): builder = env.StaticLibrary
+ else: builder = env.SharedLibrary
+diff --git a/cctbx_sources/iotbx/pdb/SConscript b/cctbx_sources/iotbx/pdb/SConscript
+index c1415c8..9e1af8d 100644
+--- a/cctbx_sources/iotbx/pdb/SConscript
++++ b/cctbx_sources/iotbx/pdb/SConscript
+@@ -2,6 +2,7 @@ Import("env_base", "env_etc")
+
+ env = env_base.Clone(
+ SHLINKFLAGS=env_etc.shlinkflags)
++env.Append(SHLINKFLAGS=["-Wl,-soname,libiotbx_pdb.so.0.0"])
+ env_etc.enable_more_warnings(env=env)
+ env_etc.include_registry.append(
+ env=env,
+diff --git a/cctbx_sources/mmtbx/masks/SConscript b/cctbx_sources/mmtbx/masks/SConscript
+index e70ab3c..cf2f530 100755
+--- a/cctbx_sources/mmtbx/masks/SConscript
++++ b/cctbx_sources/mmtbx/masks/SConscript
+@@ -17,7 +17,9 @@ builder(
+ target="#lib/mmtbx_masks",
+ source=lib_sources)
+
+-env = env.Clone()
++env = env.Clone(
++ SHLINKFLAGS=env_etc.shlinkflags)
++env.Append(SHLINKFLAGS=["-Wl,-soname,libmmtbx_masks.so.0.0"])
+ env.Prepend(LIBS=["mmtbx_masks", "iotbx_pdb", "cctbx_sgtbx_asu"])
+ env.Program( target = "tst_mask", source="tst_mask.cpp")
+
+diff --git a/cctbx_sources/omptbx/SConscript b/cctbx_sources/omptbx/SConscript
+index 43aac91..ce4b4f3 100644
+--- a/cctbx_sources/omptbx/SConscript
++++ b/cctbx_sources/omptbx/SConscript
+@@ -7,6 +7,7 @@ env_etc.omptbx_include = os.path.dirname(env_etc.omptbx_dist)
+
+ env = env_base.Clone(
+ SHLINKFLAGS=env_etc.shlinkflags)
++env.Append(SHLINKFLAGS=["-Wl,-soname,libomptbx.so.0.0"])
+ env_etc.include_registry.append(
+ env=env,
+ paths=[env_etc.omptbx_include])
+diff --git a/cctbx_sources/rstbx/SConscript b/cctbx_sources/rstbx/SConscript
+index 2213c2f..cae7542 100644
+--- a/cctbx_sources/rstbx/SConscript
++++ b/cctbx_sources/rstbx/SConscript
+@@ -15,6 +15,7 @@ env_etc.rstbx_common_includes = [
+ ]
+
+ env = env_base.Clone(SHLINKFLAGS=env_etc.shlinkflags)
++env.Append(SHLINKFLAGS=["-Wl,-soname,librstbx.so.0.0"])
+ env.Append(LIBS=["cctbx"] + env_etc.libm)
+ env_etc.include_registry.append(
+ env=env,
+diff --git a/cctbx_sources/scitbx/boost_python/SConscript b/cctbx_sources/scitbx/boost_python/SConscript
+index 6f221d0..c4698d8 100644
+--- a/cctbx_sources/scitbx/boost_python/SConscript
++++ b/cctbx_sources/scitbx/boost_python/SConscript
+@@ -4,6 +4,7 @@ Import("env_scitbx_boost_python_ext")
+ env = env_base.Clone(
+ SHLINKFLAGS=env_etc.shlinkflags)
+ env_etc.enable_more_warnings(env=env)
++env.Append(SHLINKFLAGS=["-Wl,-soname,libscitbx_boost_python.so.0.0"])
+ env.Append(CXXFLAGS=env_etc.cxxflags_bpl_defines_base)
+ env.Append(SHCXXFLAGS=env_etc.cxxflags_bpl_defines_base)
+ env.Append(LIBS=["boost_python"])
+diff --git a/cctbx_sources/scitbx/minpack/SConscript b/cctbx_sources/scitbx/minpack/SConscript
+index 7c325cb..cc23a04 100644
+--- a/cctbx_sources/scitbx/minpack/SConscript
++++ b/cctbx_sources/scitbx/minpack/SConscript
+@@ -3,6 +3,7 @@ Import("env_base", "env_etc")
+ env = env_base.Clone(
+ SHLINKFLAGS=env_etc.shlinkflags)
+ env_etc.enable_more_warnings(env=env)
++env.Append(SHLINKFLAGS=["-Wl,-soname,libscitbx_minipack.so.0.0"])
+ env_etc.include_registry.append(
+ env=env,
+ paths=env_etc.scitbx_common_includes)
+diff --git a/cctbx_sources/scitbx/slatec/SConscript b/cctbx_sources/scitbx/slatec/SConscript
+index ca9b6da..9c79d47 100644
+--- a/cctbx_sources/scitbx/slatec/SConscript
++++ b/cctbx_sources/scitbx/slatec/SConscript
+@@ -3,6 +3,7 @@ Import("env_base", "env_etc")
+ env = env_base.Clone(
+ SHLINKFLAGS=env_etc.shlinkflags)
+ env_etc.enable_more_warnings(env=env)
++env.Append(SHLINKFLAGS=["-Wl,-soname,libscitbx_slatec.so.0.0"])
+ env.Append(LIBS=env_etc.libm)
+ if (env_etc.static_libraries): builder = env.StaticLibrary
+ else: builder = env.SharedLibrary
diff --git a/sci-libs/cctbx/files/2010.03.29.2334-tst_server.py.patch b/sci-libs/cctbx/files/2010.03.29.2334-tst_server.py.patch
new file mode 100644
index 00000000000..f6509260d31
--- /dev/null
+++ b/sci-libs/cctbx/files/2010.03.29.2334-tst_server.py.patch
@@ -0,0 +1,15 @@
+diff --git a/mmtbx/monomer_library/tst_server.py b/mmtbx/monomer_library/tst_server.py
+index 519d203..91ba783 100644
+--- cctbx_sources/mmtbx/monomer_library/tst_server.py
++++ cctbx_sources/mmtbx/monomer_library/tst_server.py
+@@ -86,8 +86,8 @@ def exercise():
+ for base_code in ["A", "C", "G"]:
+ rna_atoms = srv.get_comp_comp_id_direct(base_code+"r").atom_dict()
+ dna_atoms = srv.get_comp_comp_id_direct(base_code+"d").atom_dict()
+- for as,bs,c in [(rna_atoms,dna_atoms,"d"), (dna_atoms,rna_atoms,"r")]:
+- for a in as.keys():
++ for as_,bs,c in [(rna_atoms,dna_atoms,"d"), (dna_atoms,rna_atoms,"r")]:
++ for a in as_.keys():
+ b = bs.get(a, None)
+ if (b is None):
+ print "Not in %s: %s" % (base_code+c, a)
diff --git a/sci-libs/cctbx/metadata.xml b/sci-libs/cctbx/metadata.xml
new file mode 100644
index 00000000000..a259ded7c02
--- /dev/null
+++ b/sci-libs/cctbx/metadata.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <herd>sci-chemistry</herd>
+ <maintainer>
+ <email>jlec@gentoo.org</email>
+ <name>Justin Lecher (jlec)</name>
+ </maintainer>
+ <longdescription>
+ The Computational Crystallography Toolbox (cctbx) is being developed
+ as the open source component of the PHENIX system. The goal of
+ the PHENIX project is to advance automation of macromolecular structure
+ determination. PHENIX depends on the cctbx, but not vice versa. This
+ hierarchical approach enforces a clean design as a reusable library.
+ The cctbx is therefore also useful for small-molecule crystallography
+ and even general scientific applications.
+ </longdescription>
+</pkgmetadata>