aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Lecher (jlec) <jlec@j-schmitz.net>2009-11-08 14:35:29 +0100
committerJustin Lecher (jlec) <jlec@j-schmitz.net>2009-11-08 14:35:39 +0100
commit3766397473793494a605892e9c0f0e8a448fcd4e (patch)
treed691905d14305708d0479c03d0c0b9c03bd93112
parentsci-chemistry/coot bumped to bills latest stable release (diff)
downloadsci-3766397473793494a605892e9c0f0e8a448fcd4e.tar.gz
sci-3766397473793494a605892e9c0f0e8a448fcd4e.tar.bz2
sci-3766397473793494a605892e9c0f0e8a448fcd4e.zip
sci-libs/cctbx version bump
fixes boost <-> python-2.6.4 issues (Portage version: 2.2_rc48/git/Linux x86_64) (Unsigned Manifest commit)
-rw-r--r--sci-libs/cctbx/ChangeLog9
-rw-r--r--sci-libs/cctbx/Manifest18
-rw-r--r--sci-libs/cctbx/cctbx-2009.09.28.1034.ebuild2
-rw-r--r--sci-libs/cctbx/cctbx-2009.11.01.0123-r1.ebuild204
-rw-r--r--sci-libs/cctbx/cctbx-2009.11.01.0123.ebuild196
-rw-r--r--sci-libs/cctbx/files/fix-scons.patch13
6 files changed, 429 insertions, 13 deletions
diff --git a/sci-libs/cctbx/ChangeLog b/sci-libs/cctbx/ChangeLog
index ac45d4201..c863d4e8f 100644
--- a/sci-libs/cctbx/ChangeLog
+++ b/sci-libs/cctbx/ChangeLog
@@ -2,6 +2,15 @@
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+*cctbx-2009.11.01.0123-r1 (08 Nov 2009)
+*cctbx-2009.11.01.0123 (08 Nov 2009)
+
+ 08 Nov 2009; Justin Lecher (jlec) <jlec@j-schmitz.net>
+ cctbx-2009.09.28.1034.ebuild, +cctbx-2009.11.01.0123.ebuild,
+ +cctbx-2009.11.01.0123-r1.ebuild, +files/fix-scons.patch:
+ version bump which fixes boost <-> python-2.6.2 issues
+ QA review
+
28 Oct 2009; Justin Lecher (jlec) <jlec@j-schmitz.net>
cctbx-2009.09.28.1034.ebuild:
fix for bug 289032
diff --git a/sci-libs/cctbx/Manifest b/sci-libs/cctbx/Manifest
index 15bb3ab4e..dee1d9292 100644
--- a/sci-libs/cctbx/Manifest
+++ b/sci-libs/cctbx/Manifest
@@ -1,18 +1,12 @@
------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
AUX 2009.02.15.2320-sandbox-violations-chmod.patch 467 RMD160 11a55d71c9a238cf8c40f1760344c27c65a53922 SHA1 03ce887b4ddaf72310986d97c8add9a7a73c6fb0 SHA256 1c79b9f3bb0215dca39def9b6ba0bdb678022b51345da1567d0f4952951bdcd1
+AUX fix-scons.patch 426 RMD160 130650ccaa32d0c981b2bf8c17cd7d430c5afa9f SHA1 f9f0dec5f5041c3d3b9cbfeb37a1d229c0a4ca2b SHA256 bcb19bc144507ad7f1829f88277c41248a0ed2382ce131d6579fe61e9fa9ba84
DIST cctbx-2009.02.15.2320.tar.gz 12800622 RMD160 8d95db0054e8ba9378e46e9d5d2d7b333418eeb4 SHA1 1d3e5aad9d1c4fd6617295fc3346c079e7c758d9 SHA256 336946867246ed3cf7f697dc9bf0cc21443b7fb9600b24696b4d8d3cb5773200
DIST cctbx-2009.09.28.1034.tar.gz 14359425 RMD160 04b932f6dd2665ffd2aa1a21462993ddf0f2e9c4 SHA1 47a529fa596eddc04c93673da16a688617ce07dd SHA256 1714c7a7985c1709baa9786e12dcc24f0073b76e020d194be24fbbf5b4c8504e
+DIST cctbx-2009.11.01.0123.tar.gz 14604079 RMD160 77cc84d4b9e35e7a87f807d8669efb939b2e82ce SHA1 7db71a62786b82f47999919a9411938b123d5b4d SHA256 31e7f79424360f963c6eae528a9d289db4b53c1f7fe4aa9de71201e9d14bc5af
EBUILD cctbx-2009.02.15.2320-r2.ebuild 4644 RMD160 6ea87345c030c9c2ec512ac8be9b8c580cb2caa9 SHA1 614dce37aee6ac67b689e50a510dccd3bb81fe59 SHA256 7977fcdf1cac193e7b236ad771dfb047ecf4c2ef77b34aab18d0f1fc894ddeec
EBUILD cctbx-2009.02.15.2320-r3.ebuild 5686 RMD160 7ccf97179ee2540a89052200750675e588075e77 SHA1 8e77b701ab656793b704dc747cf6555b39b34257 SHA256 9d987f67fa1fa2eec9a2b0dfa2784170afe871c97bc94eb3ef1bd600ef0c3d3b
-EBUILD cctbx-2009.09.28.1034.ebuild 5777 RMD160 b13fdb88c4d32d0f393a1f9a61a74ae73aa98d0a SHA1 75adbb573431c23e4e96dd3ef3eca7a3d93abd20 SHA256 88640e98694c2bc554bb0ffd18b4120dcfff6e3167bc5b7063765be9d07f69ea
-MISC ChangeLog 1918 RMD160 9d599a132e5d8aaa8bb772d12d284fd5b53c16ce SHA1 e24f79df0bb14b39cd631493297dc16e722772e4 SHA256 5db999ba5abcaa642e58cfa3d8497279186e0091e019c33e9190d4f1134565d0
+EBUILD cctbx-2009.09.28.1034.ebuild 5783 RMD160 eb0d11521e3c210a2dae87256622129f4911fcab SHA1 23f050fa48ef4e144e178e278d58ce2fe0706ba8 SHA256 94a78d9f0e4d2bc83a48ede16abc4af63f432ceb4eb05b2f96016ee598cb8866
+EBUILD cctbx-2009.11.01.0123-r1.ebuild 5838 RMD160 748804da49dc5a500db33212235b7ed40ddb5fa2 SHA1 7672b2bbe38f3c21aa796a1a24cc4a0e035c57d8 SHA256 38c0f6ceb17e9ae9cac2cc7b7838eaeb0063e4657b5b2a36ed5c0567c87b43a8
+EBUILD cctbx-2009.11.01.0123.ebuild 5783 RMD160 eb0d11521e3c210a2dae87256622129f4911fcab SHA1 23f050fa48ef4e144e178e278d58ce2fe0706ba8 SHA256 94a78d9f0e4d2bc83a48ede16abc4af63f432ceb4eb05b2f96016ee598cb8866
+MISC ChangeLog 2246 RMD160 b4399b64d28d8e3466c2ed849a07a3323f60e0e8 SHA1 288df3586935eccf4488d4b85fcf576efeefec33 SHA256 00b24d80452dc434bfbd4477e4cbc271f8b96063ded3152ed22db95dc337f7bf
MISC metadata.xml 438 RMD160 79ad38c94abc71ba32abccdcd670f2f6802c2df3 SHA1 1ebbff28f7e4d135b26b951b6111f6803f78413c SHA256 94d589a2836bffe732cdf993e9b38afc1cde4683a5e5669c44daf6b69595e8da
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.11 (GNU/Linux)
-
-iEYEARECAAYFAkroqvYACgkQgAnW8HDreRa6sQCdFnYjCFPF6vk/G/LkGfVbpsbg
-d5QAoItsV9u70uG5WUNl4BZ2bZ4l1xLm
-=Wqjg
------END PGP SIGNATURE-----
diff --git a/sci-libs/cctbx/cctbx-2009.09.28.1034.ebuild b/sci-libs/cctbx/cctbx-2009.09.28.1034.ebuild
index bd63fb9b3..a2c3eb6fd 100644
--- a/sci-libs/cctbx/cctbx-2009.09.28.1034.ebuild
+++ b/sci-libs/cctbx/cctbx-2009.09.28.1034.ebuild
@@ -121,7 +121,7 @@ src_compile() {
src_test(){
source "${MY_B}"/setpaths_all.sh
- libtbx.python $(libtbx.show_dist_paths boost_adaptbx)/tst_rational.py && \
+ 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"
diff --git a/sci-libs/cctbx/cctbx-2009.11.01.0123-r1.ebuild b/sci-libs/cctbx/cctbx-2009.11.01.0123-r1.ebuild
new file mode 100644
index 000000000..96f56ba06
--- /dev/null
+++ b/sci-libs/cctbx/cctbx-2009.11.01.0123-r1.ebuild
@@ -0,0 +1,204 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+inherit toolchain-funcs python eutils
+
+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="~x86 ~amd64"
+IUSE="minimal openmp threads"
+
+RDEPEND="!minimal? ( sci-chemistry/cns
+ sci-chemistry/shelx )"
+DEPEND="${RDEPEND}
+ >=dev-util/scons-1.2"
+
+S="${WORKDIR}"
+MY_S="${WORKDIR}"/cctbx_sources
+MY_B="${WORKDIR}"/cctbx_build
+
+pkg_setup() {
+ python_version
+ if use openmp &&
+ [[ $(tc-getCC)$ == *gcc* ]] &&
+ ( [[ $(gcc-major-version)$(gcc-minor-version) -lt 42 ]] ||
+ ! built_with_use sys-devel/gcc openmp )
+ then
+ ewarn "You are using gcc and OpenMP is only available with gcc >= 4.2 "
+ ewarn "If you want to build fftw with OpenMP, abort now,"
+ ewarn "and switch CC to an OpenMP capable compiler"
+ fi
+}
+
+src_prepare() {
+ python_version
+
+ local opts
+ local optsld
+
+ # Wants to chmod /usr/bin/python
+# epatch "${FILESDIR}"/${PV}-sandbox-violations-chmod.patch
+
+ rm -rf "${MY_S}/scons" # "${MY_S}/boost" ## needs boost 1.39
+
+ mkdir -p "${MY_S}"/scons/src/ "${MY_S}/boost"
+
+ ln -sf /usr/$(get_libdir)/scons-1.2.0 "${MY_S}"/scons/src/engine || die
+# ln -sf /usr/include/boost "${MY_S}/boost/"
+
+ # Get CXXFLAGS in format suitable for substitition into SConscript
+ for i in ${CXXFLAGS}; do
+ opts="${opts} \"${i}\","
+ done
+
+ # Strip off the last comma
+ opts=${opts%,}
+
+ # Fix CXXFLAGS
+ sed -i \
+ -e "s:\"-O3\", \"-ffast-math\":${opts}:g" \
+ ${MY_S}/libtbx/SConscript
+
+ # Get LDFLAGS in format suitable for substitition into SConscript
+ for i in ${LDFLAGS}; do
+ optsld="${optsld} \"${i}\","
+ done
+
+ optsld=${optsld%,}
+
+ # Fix LDFLAGS which should be as-needed ready
+ sed -i \
+ -e "s:\"-shared\":\"-shared\", ${optsld}:g" \
+ ${MY_S}/libtbx/SConscript
+}
+
+src_configure() {
+ local compiler
+ local myconf
+
+ myconf="${MY_S}/libtbx/configure.py"
+
+ # Get compiler in the right way
+ compiler=$(expr match "$(tc-getCC)" '.*\([a-z]cc\)')
+ myconf="${myconf} --compiler=${compiler}"
+
+ # Precompiling python scripts. It is done in upstreams install script. Perhaps use python_mod_compile,
+ # but as this script works we should stick to it.
+ ${python} "${MY_S}/libtbx/command_line/py_compile_all.py"
+
+ # Additional USE flag usage
+ check_use openmp
+ myconf="${myconf} --enable-openmp-if-possible=${USE_openmp}"
+
+ use threads && USEthreads="--enable-boost-threads" && \
+ ewarn "If using boost threads openmp support is disabled"
+
+ myconf="${myconf} ${USE_threads} --scan-boost"
+
+ mkdir "${MY_B}" && myconf="${myconf} --current_working_directory=${MY_B}"
+ cd "${MY_B}"
+
+ myconf="${myconf} --build=release fftw3tbx rstbx smtbx mmtbx clipper"
+ einfo "configuring with ${python} ${myconf}"
+
+ ${python} ${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(){
+ # This is what Bill Scott does in the fink package. Do we need this as well?
+# -e "s:prepend:append:g" \
+
+ find cctbx_build/ -type f \( -name "*.py" -o -name "*sh" \) -exec \
+ sed -e "s:${MY_S}:/usr/$(get_libdir)/cctbx/cctbx_sources:g" \
+ -e "s:${MY_B}:/usr/$(get_libdir)/cctbx/cctbx_build:g" \
+ -i '{}' \; || die "Fail to correct path"
+
+ ebegin "removing unnessary files"
+ rm -r "${S}"/cctbx_sources/scons || die "failed to remove uneeded scons"
+ find "${S}" -type f -name "*conftest*" -exec rm -f '{}' \; || die "failed to remove uneeded *.o"
+ find "${S}" -type f -name "*.o" -exec rm -f '{}' \; || die "failed to remove uneeded *.o"
+ find "${S}" -type f -name "*.c" -exec rm -f '{}' \; || die "failed to remove uneeded *.c"
+ find "${S}" -type f -name "*.cpp" -exec rm -f '{}' \; || die "failed to remove uneeded *.cpp"
+ find "${S}" -type f -name "*.pyc" -exec rm -f '{}' \; || die "failed to remove uneeded *.pyc"
+ eend
+
+ insinto /usr/$(get_libdir)/${PN}
+ doins -r cctbx_sources cctbx_build || die
+
+# fperms cannot handle wildcards
+ chmod 775 "${D}"/usr/$(get_libdir)/${PN}/cctbx_build/*sh && \
+ chmod 775 "${D}"/usr/$(get_libdir)/${PN}/cctbx_build/lib/* && \
+ chmod 775 "${D}"/usr/$(get_libdir)/${PN}/cctbx_build/scitbx/array_family/* && \
+ chmod 775 "${D}"/usr/$(get_libdir)/${PN}/cctbx_build/scitbx/serialization/* && \
+ chmod 775 "${D}"/usr/$(get_libdir)/${PN}/cctbx_build/scitbx/error/* && \
+ chmod 775 "${D}"/usr/$(get_libdir)/${PN}/cctbx_build/scitbx/fftpack/timing/* && \
+ chmod 775 "${D}"/usr/$(get_libdir)/${PN}/cctbx_build/scitbx/lbfgs/* && \
+ chmod 775 "${D}"/usr/$(get_libdir)/${PN}/cctbx_build/chiltbx/handle_test && \
+ chmod 775 "${D}"/usr/$(get_libdir)/${PN}/cctbx_build/bin/* || \
+ die
+
+ insinto /etc/profile.d/
+ newins "${MY_B}"/setpaths.sh 30cctbx.sh && \
+ newins "${MY_B}"/setpaths.csh 30cctbx.csh || \
+ die
+
+ sed \
+ -e "s:python${PYVER}:python:g"\
+ -i "${MY_B}"/setpaths* || die
+
+ cat >> "${T}"/30cctbx <<- EOF
+ LDPATH="/usr/$(get_libdir)/${PN}/cctbx_build/lib"
+ EOF
+
+ doenvd "${T}"/30cctbx || die
+}
+
+pkg_postinst () {
+ python_mod_optimize /usr/$(get_libdir)/${PN}/cctbx_sources
+}
+
+pkg_postrm () {
+ python_mod_cleanup /usr/$(get_libdir)/${PN}/cctbx_sources
+}
+
+check_use() {
+ for var in $@; do
+ if use ${var}; then
+ printf -v "USE_$var" True
+ else
+ printf -v "USE_$var" False
+ fi
+ shift
+ done
+}
diff --git a/sci-libs/cctbx/cctbx-2009.11.01.0123.ebuild b/sci-libs/cctbx/cctbx-2009.11.01.0123.ebuild
new file mode 100644
index 000000000..a2c3eb6fd
--- /dev/null
+++ b/sci-libs/cctbx/cctbx-2009.11.01.0123.ebuild
@@ -0,0 +1,196 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+inherit toolchain-funcs python eutils
+
+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="~x86 ~amd64"
+IUSE="minimal openmp threads"
+
+RDEPEND="!minimal? ( sci-chemistry/cns
+ sci-chemistry/shelx )"
+DEPEND="${RDEPEND}
+ >=dev-util/scons-1.2"
+
+S="${WORKDIR}"
+MY_S="${WORKDIR}"/cctbx_sources
+MY_B="${WORKDIR}"/cctbx_build
+
+pkg_setup() {
+ python_version
+ if use openmp &&
+ [[ $(tc-getCC)$ == *gcc* ]] &&
+ ( [[ $(gcc-major-version)$(gcc-minor-version) -lt 42 ]] ||
+ ! built_with_use sys-devel/gcc openmp )
+ then
+ ewarn "You are using gcc and OpenMP is only available with gcc >= 4.2 "
+ ewarn "If you want to build fftw with OpenMP, abort now,"
+ ewarn "and switch CC to an OpenMP capable compiler"
+ fi
+}
+
+src_prepare() {
+ # Wants to chmod /usr/bin/python
+# epatch "${FILESDIR}"/${PV}-sandbox-violations-chmod.patch
+
+ rm -rf "${MY_S}/scons" # "${MY_S}/boost" ## needs boost 1.39
+
+ mkdir -p "${MY_S}"/scons/src/ "${MY_S}/boost"
+
+ ln -sf /usr/$(get_libdir)/scons-1.2.0 "${MY_S}"/scons/src/engine || die
+# ln -sf /usr/include/boost "${MY_S}/boost/"
+}
+
+src_compile() {
+ python_version
+
+ local MYCONF
+ local MAKEOPTS_EXP
+ local OPTS
+ local OPTSLD
+
+ MYCONF="${MY_S}/libtbx/configure.py"
+
+ MAKEOPTS_EXP=${MAKEOPTS/j/j }
+ MAKEOPTS_EXP=${MAKEOPTS_EXP%-l[0-9]*}
+
+ # Get CXXFLAGS in format suitable for substitition into SConscript
+ for i in ${CXXFLAGS}; do
+ OPTS="${OPTS} \"${i}\","
+ done
+
+ # Strip off the last comma
+ OPTS=${OPTS%,}
+
+ # Fix CXXFLAGS
+ sed -i \
+ -e "s:\"-O3\", \"-ffast-math\":${OPTS}:g" \
+ ${MY_S}/libtbx/SConscript
+
+ # Get LDFLAGS in format suitable for substitition into SConscript
+ for i in ${LDFLAGS}; do
+ OPTSLD="${OPTSLD} \"${i}\","
+ done
+
+ OPTSLD=${OPTSLD%,}
+
+ # Fix LDFLAGS which should be as-needed ready
+ sed -i \
+ -e "s:\"-shared\":\"-shared\", ${OPTSLD}:g" \
+ ${MY_S}/libtbx/SConscript
+
+ # Get compiler in the right way
+ COMPILER=$(expr match "$(tc-getCC)" '.*\([a-z]cc\)')
+ MYCONF="${MYCONF} --compiler=${COMPILER}"
+
+ # Precompiling python scripts. It is done in upstreams install script. Perhaps use python_mod_compile,
+ # but as this script works we should stick to it.
+ ${python} "${MY_S}/libtbx/command_line/py_compile_all.py"
+
+ # Additional USE flag usage
+ check_use openmp
+ MYCONF="${MYCONF} --enable-openmp-if-possible=${USE_openmp}"
+ use threads && USEthreads="--enable-boost-threads" && \
+ ewarn "If using boost threads openmp support is disabled"
+
+ MYCONF="${MYCONF} ${USE_threads} --scan-boost"
+
+ mkdir "${MY_B}" && MYCONF="${MYCONF} --current_working_directory=${MY_B}"
+ cd "${MY_B}"
+
+ MYCONF="${MYCONF} --build=release fftw3tbx rstbx smtbx mmtbx clipper"
+ einfo "configuring with ${python} ${MYCONF}"
+
+ ${python} ${MYCONF} \
+ || die "configure failed"
+
+ 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(){
+ # This is what Bill Scott does in the fink package. Do we need this as well?
+# -e "s:prepend:append:g" \
+
+ find cctbx_build/ -type f \( -name "*.py" -o -name "*sh" \) -exec \
+ sed -e "s:${MY_S}:/usr/$(get_libdir)/cctbx/cctbx_sources:g" \
+ -e "s:${MY_B}:/usr/$(get_libdir)/cctbx/cctbx_build:g" \
+ -i '{}' \; || die "Fail to correct path"
+
+ ebegin "removing unnessary files"
+ rm -r "${S}"/cctbx_sources/scons || die "failed to remove uneeded scons"
+ find "${S}" -type f -name "*conftest*" -exec rm -f '{}' \; || die "failed to remove uneeded *.o"
+ find "${S}" -type f -name "*.o" -exec rm -f '{}' \; || die "failed to remove uneeded *.o"
+ find "${S}" -type f -name "*.c" -exec rm -f '{}' \; || die "failed to remove uneeded *.c"
+ find "${S}" -type f -name "*.cpp" -exec rm -f '{}' \; || die "failed to remove uneeded *.cpp"
+ find "${S}" -type f -name "*.pyc" -exec rm -f '{}' \; || die "failed to remove uneeded *.pyc"
+ eend
+
+ insinto /usr/$(get_libdir)/${PN}
+ doins -r cctbx_sources cctbx_build || die
+
+# fperms cannot handle wildcards
+ chmod 775 "${D}"/usr/$(get_libdir)/${PN}/cctbx_build/*sh && \
+ chmod 775 "${D}"/usr/$(get_libdir)/${PN}/cctbx_build/lib/* && \
+ chmod 775 "${D}"/usr/$(get_libdir)/${PN}/cctbx_build/scitbx/array_family/* && \
+ chmod 775 "${D}"/usr/$(get_libdir)/${PN}/cctbx_build/scitbx/serialization/* && \
+ chmod 775 "${D}"/usr/$(get_libdir)/${PN}/cctbx_build/scitbx/error/* && \
+ chmod 775 "${D}"/usr/$(get_libdir)/${PN}/cctbx_build/scitbx/fftpack/timing/* && \
+ chmod 775 "${D}"/usr/$(get_libdir)/${PN}/cctbx_build/scitbx/lbfgs/* && \
+ chmod 775 "${D}"/usr/$(get_libdir)/${PN}/cctbx_build/chiltbx/handle_test && \
+ chmod 775 "${D}"/usr/$(get_libdir)/${PN}/cctbx_build/bin/* || \
+ die
+
+ insinto /etc/profile.d/
+ newins "${MY_B}"/setpaths.sh 30cctbx.sh && \
+ newins "${MY_B}"/setpaths.csh 30cctbx.csh || \
+ die
+
+ sed \
+ -e "s:python${PYVER}:python:g"\
+ -i "${MY_B}"/setpaths* || die
+
+ cat >> "${T}"/30cctbx <<- EOF
+ LDPATH="/usr/$(get_libdir)/${PN}/cctbx_build/lib"
+ EOF
+
+ doenvd "${T}"/30cctbx || die
+}
+
+pkg_postinst () {
+ python_mod_optimize /usr/$(get_libdir)/${PN}/cctbx_sources
+}
+
+pkg_postrm () {
+ python_mod_cleanup /usr/$(get_libdir)/${PN}/cctbx_sources
+}
+
+check_use() {
+ for var in $@; do
+ if use ${var}; then
+ printf -v "USE_$var" True
+ else
+ printf -v "USE_$var" False
+ fi
+ shift
+ done
+}
diff --git a/sci-libs/cctbx/files/fix-scons.patch b/sci-libs/cctbx/files/fix-scons.patch
new file mode 100644
index 000000000..945b02087
--- /dev/null
+++ b/sci-libs/cctbx/files/fix-scons.patch
@@ -0,0 +1,13 @@
+diff --git a/libtbx/command_line/scons.py b/libtbx/command_line/scons.py
+index dee278e..71837ad 100755
+--- a/libtbx/command_line/scons.py
++++ b/libtbx/command_line/scons.py
+@@ -23,7 +23,7 @@ def dummy_fetch_win32_parallel_msg():
+ pass
+
+ def run():
+- engine_path = find_scons_engine_path()
++ engine_path = "/usr/lib/scons-1.2.0"
+ if (engine_path is not None):
+ sys.path.insert(0, engine_path)
+ try: import SCons