--- /dev/null
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+AUX phaser-2.1.4-chmod.patch 555 RMD160 97aac303973819050a02e7513f7d5b05edf0b4ce SHA1 6e3514e29e68f3e82797655edaeeb08e5d103dae SHA256 7dbdf50a096448283400e5026b5e3366420e7d124f8a4f85396604bb43d7a3be
+DIST ccp4-6.1.13-phaser-cctbx-src.tar.gz 22021353 RMD160 7523142c284815d407da9ae99b8ca122f8bcb25c SHA1 4f56b3fd9b44eb4a88af9f00527a2739cb3c62a0 SHA256 e6c4365cb34da5ce2dd5f1e74b8927258064016194446163418c8a3139a4b804
+EBUILD phaser-2.1.4.ebuild 2842 RMD160 9fac6ff28f167e4030e07ccf5d757e0d07b06496 SHA1 21481f4386f80964dd24a50e7b47fd196091a0b4 SHA256 3d748afea18bf6a71bcb841e8ca1f8afc45964a8f570e53704cfe9ea8bb078a6
+MISC ChangeLog 379 RMD160 42b4dcd9999d720114cefe7b95a136dbc95bbc1b SHA1 34473d8829b678d2abfa6372168b2bd18fdd63b7 SHA256 47ea6906d510e3b42ed326e3afac0f34e1c3d560d3e8ad9812fa520ccadcb626
+MISC metadata.xml 200 RMD160 89d5a5da0eb89f1fcf71ccf61190c871f369f322 SHA1 859c9d3058407bbf3a2a8d468f73e2ce7debe539 SHA256 939542523093a72e36d31bcd538511217b8695021f9c3099c8ddb43132845e66
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v2.0.15 (GNU/Linux)
+
+iEYEARECAAYFAkwvO/4ACgkQgAnW8HDreRasXwCeMKMWIJNORghRN2ietaYMYgg5
+7nEAoJVHgzsY+icBbZxlPnsc6m60c7Q7
+=LcqX
+-----END PGP SIGNATURE-----
--- /dev/null
+diff --git a/lib/cctbx/cctbx_sources/libtbx/libtbx/config.py b/lib/cctbx/cctbx_sources/libtbx/libtbx/config.py
+index 3b1bd3a..8939a74 100755
+--- a/lib/cctbx/cctbx_sources/libtbx/libtbx/config.py
++++ b/lib/cctbx/cctbx_sources/libtbx/libtbx/config.py
+@@ -802,8 +802,6 @@ class environment:
+ else:
+ action = self.write_bin_sh_dispatcher
+ ext = ""
+- try: os.chmod(source_file, 0755)
+- except OSError: pass
+ target_file_ext = target_file + ext
+ remove_or_rename(target_file_ext)
+ try: action(source_file, target_file_ext)
--- /dev/null
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/phaser/phaser-2.1.4.ebuild,v 1.1 2010/07/03 13:32:41 jlec Exp $
+
+EAPI="3"
+
+PYTHON_DEPEND="2"
+
+inherit base flag-o-matic python
+
+CCP4VER="6.1.13"
+
+DESCRIPTION="A program for phasing macromolecular crystal structures"
+HOMEPAGE="http://www-structmed.cimr.cam.ac.uk/phaser"
+SRC_URI="ftp://ftp.ccp4.ac.uk/ccp4/${CCP4VER}/ccp4-${CCP4VER}-${PN}-cctbx-src.tar.gz"
+
+LICENSE="|| ( phaser phaser-com ccp4 )"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="openmp"
+
+RDEPEND=""
+DEPEND="${RDEPEND}
+ app-shells/tcsh"
+
+S="${WORKDIR}"/ccp4-${CCP4VER}
+
+PATCHES=(
+ "${FILESDIR}"/phaser-2.1.4-chmod.patch
+ "${FILESDIR}"/phaser-2.1.4-ldflags.patch
+ )
+
+pkg_setup() {
+ python_set_active_version 2
+}
+
+src_prepare() {
+ base_src_prepare
+
+ use openmp && append-flags -fopenmp
+
+ for i in ${CXXFLAGS}; do
+ OPTS="${OPTS} \"${i}\","
+ done
+
+ OPTS=${OPTS%,}
+
+ sed -i \
+ -e "s:opts = \[.*\]$:opts = \[${OPTS}\]:g" \
+ "${S}"/lib/cctbx/cctbx_sources/libtbx/SConscript || die
+
+ for i in ${LDFLAGS}; do
+ OPTSLD="${OPTSLD} \"${i}\","
+ done
+
+ sed -i \
+ -e "s:env_etc.shlinkflags .* \"-shared\":env_etc.shlinkflags = \[ ${OPTSLD} \"-shared\"\]:g" \
+ -e "s:\[\"-static:\[${OPTSLD} \"-static:g" \
+ "${S}"/lib/cctbx/cctbx_sources/libtbx/SConscript || die
+
+}
+
+src_configure() {
+ local compiler
+ local mtype
+ local mversion
+ local nproc
+
+ # Valid compilers are win32_cl, sunos_CC, unix_gcc, unix_ecc,
+ # unix_icc, unix_icpc, tru64_cxx, hp_ux11_aCC, irix_CC,
+ # darwin_c++, darwin_gcc. The build systems seems to prepend
+ # unix_ all by itself. Can this be derived from $(tc-getCC)?
+ compiler=$(expr match "$(tc-getCC)" '.*\([a-z]cc\)')
+
+ # Breaks cross compilation.
+ mtype=$(src/${PN}/bin/machine_type)
+ mversion=$(src/${PN}/bin/machine_version)
+
+ einfo "Creating build directory"
+ mkdir build
+ cd build
+ ln -sf "${S}/lib/cctbx/cctbx_sources/scons" scons
+ ln -sf "${S}/lib/cctbx/cctbx_sources/libtbx" libtbx
+
+ einfo "Configuring phaser components"
+ $(PYTHON) "libtbx/configure.py" \
+ --build=release \
+ --compiler=${compiler} \
+ --repository="${S}"/src/${PN}/source \
+ --repository="${S}"/lib/cctbx/cctbx_sources \
+ --static_libraries \
+ ccp4io="${S}" \
+ mmtbx \
+ phaser || die "configure.py failed"
+}
+
+src_compile() {
+ nproc=`echo "-j1 ${MAKEOPTS}" \
+ | sed -e "s/.*\(-j\s*\|--jobs=\)\([0-9]\+\).*/\2/"`
+
+ cd build
+ einfo "Setting up build environment"
+ source setpaths.sh
+
+ einfo "Compiling phaser components"
+ libtbx.scons -j ${nproc} || die "libtbx.scons failed"
+}
+
+src_install() {
+ dobin build/exe/phaser || die
+
+ cat >> "${T}"/53${PN} <<- EOF
+ PHASER="${EPREFIX}/usr/bin"
+ PHASER_ENVIRONMENT="1"
+ PHASER_MTYPE="${mtype}"
+ PHASER_MVERSION="${mversion}"
+ PHASER_VERSION="${PV}"
+ EOF
+
+ doenvd "${T}"/53${PN} || die
+}