summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Lecher <jlec@gentoo.org>2011-01-11 13:47:21 +0000
committerJustin Lecher <jlec@gentoo.org>2011-01-11 13:47:21 +0000
commitd3df7a451dfcf1f15f8eee44500a946e8c6e5d9a (patch)
tree4a16cae49aa1a00c60cc2fd25289ecd5d42a4ac1 /sci-chemistry/ccp4-apps
parentSpeedup configure by reducing the sleep periods (diff)
downloadhistorical-d3df7a451dfcf1f15f8eee44500a946e8c6e5d9a.tar.gz
historical-d3df7a451dfcf1f15f8eee44500a946e8c6e5d9a.tar.bz2
historical-d3df7a451dfcf1f15f8eee44500a946e8c6e5d9a.zip
Removed unnessesary rpath, Speedup configure by reducing sleep periods, Respect LDFLAGS and as-needed, fix more implicit declarations
Package-Manager: portage-2.2.0_alpha14/cvs/Linux x86_64
Diffstat (limited to 'sci-chemistry/ccp4-apps')
-rw-r--r--sci-chemistry/ccp4-apps/ChangeLog9
-rw-r--r--sci-chemistry/ccp4-apps/Manifest11
-rw-r--r--sci-chemistry/ccp4-apps/ccp4-apps-6.1.3-r8.ebuild403
-rw-r--r--sci-chemistry/ccp4-apps/files/6.1.3-impl-dec.patch116
4 files changed, 533 insertions, 6 deletions
diff --git a/sci-chemistry/ccp4-apps/ChangeLog b/sci-chemistry/ccp4-apps/ChangeLog
index 034d3285dcfb..9bc4351c409f 100644
--- a/sci-chemistry/ccp4-apps/ChangeLog
+++ b/sci-chemistry/ccp4-apps/ChangeLog
@@ -1,6 +1,13 @@
# ChangeLog for sci-chemistry/ccp4-apps
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/ccp4-apps/ChangeLog,v 1.20 2011/01/10 21:06:26 jlec Exp $
+# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/ccp4-apps/ChangeLog,v 1.21 2011/01/11 13:47:20 jlec Exp $
+
+*ccp4-apps-6.1.3-r8 (11 Jan 2011)
+
+ 11 Jan 2011; Justin Lecher <jlec@gentoo.org> files/6.1.3-impl-dec.patch,
+ +ccp4-apps-6.1.3-r8.ebuild:
+ Removed unnessesary rpath, Speedup configure by reducing sleep periods,
+ Respect LDFLAGS and as-needed, fix more implicit declarations
*ccp4-apps-6.1.3-r7 (10 Jan 2011)
diff --git a/sci-chemistry/ccp4-apps/Manifest b/sci-chemistry/ccp4-apps/Manifest
index eddf553fa6a9..842827f83d4f 100644
--- a/sci-chemistry/ccp4-apps/Manifest
+++ b/sci-chemistry/ccp4-apps/Manifest
@@ -13,7 +13,7 @@ AUX 6.1.3-dont-build-xia.patch 712 RMD160 dd3f8bcf309b7d84c31bf4cf829d1d9f95618d
AUX 6.1.3-dont-configure.patch 4592 RMD160 301eeb912704ff01ab7e324e951c2d5770739f88 SHA1 66e61f7d2979cfd6d304238ae665d4e114368279 SHA256 817e37a623a74cc06017c5cd7b10fc5afb75242a519820825610c09ad4c91741
AUX 6.1.3-dont-make-dirs-in-configure.patch 2866 RMD160 ba49e45ab609a42a2d93b96f55af913bf9625610 SHA1 36c9329c3768c08687ef062c9ab649d32833b422 SHA256 1b5997f17526a4fd60ffa9eccf4b765aadf3a78c9394657000e0454f364240ca
AUX 6.1.3-fix-setup-bash-incompatibility.patch 422 RMD160 e7e886ab030cf3324302c8fd0c866b48eeb34f8c SHA1 4e549abcd3ced1e6ecf9d3f2bddfed70425d61aa SHA256 109a0e806f9c0e1b8bf5e5f0c58be6f1dae06396b62ee4dae9f579ff7dcb5a01
-AUX 6.1.3-impl-dec.patch 1032 RMD160 c9713c6ffbf6d74db9c5f97312901dab79ad37d2 SHA1 febc6a4d139c0a9647ecbbd4130d276504e11207 SHA256 17022ad8856778e7222dc864b36b2f1327130e6f61fb4198df738677f5816db0
+AUX 6.1.3-impl-dec.patch 4302 RMD160 2b69341db71699504e4444d18db7db1d4fc10ddd SHA1 b3a9b71355063fbe34b0d3db4163d7e3689cb0a1 SHA256 73c3137ab8e20c25d1dfcfc65011a055f90eb902eede697c7dfbc5f37948eb18
AUX 6.1.3-pisa.patch 714 RMD160 9923901ec82dc0c7cd2a13f1eb6362a11576abd8 SHA1 8d7e0b730b9969d2d59a6b9441b7c3709b397e16 SHA256 42a581d2a9747239c1b129dbeffc76a2532de320629dd58112a42ffde669bf12
AUX 6.1.3-pythonpath.patch 2716 RMD160 f46963e6c4c48cfab76062aaff8d58189f9d590b SHA1 24f6c9a051f97d9e5db5c4fb9ef457114fa7a951 SHA256 41ca8ed3fc1701caa18b30f44af7475d49fc0042ee058bae3d8c8617a6d9bcc2
AUX 6.1.3-rename-rapper.patch 2856 RMD160 37504bed3cb4e1858d88331305deef6564616b02 SHA1 31f513c987e1408b868f8c9de4aaa9f2c35cb378 SHA256 d9fed1ec65089c4130358aeed771b32c1253e48a73e90f0ce7b92bd0abbb0c2b
@@ -22,12 +22,13 @@ AUX 6.1.3-setup.patch 12338 RMD160 2107d599dfe477863710d6b8098b3ca43b8cd22d SHA1
DIST 6.1.3-oasis4.0.patch.bz2 946 RMD160 b448376114ba41e6999d533929fdb79812476f87 SHA1 7667aca14d28cec01bfa7d2eee9cbce11624f4fa SHA256 12d7c5965e0c46b0f482514d9083d6be94d65eeb14ba29c17d507d5f9669f84b
DIST ccp4-6.1.3-core-src.tar.gz 242134076 RMD160 e9b7deb0766fb95d5e8946881f20e086f0896fe9 SHA1 ee5ada892694db5dc9b2d7d2330b4ac694f56580 SHA256 1e529c660e7f390ec0feca9d45caa00a2813d23156c10a2747c427117293c324
EBUILD ccp4-apps-6.1.3-r7.ebuild 10227 RMD160 e72ef3c788c421eb2dc6de8072654760fce9ef0d SHA1 af541801f140d76fd24a473a229cef5493044b75 SHA256 d99a3f229ba8811d6c245d358c67af73b2810829b9db2b048010211a42b8a0d2
-MISC ChangeLog 3716 RMD160 e672c3407886a0063de61c4b336628050ba61d77 SHA1 0fe2aa7bb57f5d970240e12ac547d2e08231a7b5 SHA256 4715f33b7b9dd9470df7a51a4a723cc2547fbb850c1976ebf218ae7b1c14e5ea
+EBUILD ccp4-apps-6.1.3-r8.ebuild 10652 RMD160 0ed7b604fc30ea6dfb8e890672c8aad3815705c1 SHA1 2ddabdf7b6b8eda42d950842b7827c59e6ce0486 SHA256 f1a6e812ca1e3cbe67bea55a9e90d888a0802a4e4873389c141f6803410e2264
+MISC ChangeLog 3995 RMD160 3af1b84e3371363d1d629ff98de26e24fd5c8449 SHA1 949ce9be1f9267c2ed1b86f019eec3a7f6878b67 SHA256 b572cd2ede77e0c1157a5d1b1fb3dd61aa32e0080515aa1eb1c6d38ece613f82
MISC metadata.xml 166 RMD160 4452298fd03e7c9395d1182bfe69d60a14144af6 SHA1 cb0b513473c0348f4f6f6cd9a132e4884155fddb SHA256 84c92b49702daf95eace8d2765215cbd8650da4ef776f9f700b5ce3785dec852
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
-iEYEARECAAYFAk0rdNgACgkQgAnW8HDreRbGmACeKXbYA7uxXAIlFjHunPSKDCIf
-gTkAnRK8oNKMqLiIGDf777AxBYMIzcHa
-=7BxN
+iEYEARECAAYFAk0sXz4ACgkQgAnW8HDreRY8gACfTADOpAbT5yc+v6gtRK0JdlX9
+NKkAoKqyYo26MyjSVbCc0WllCljmLMn3
+=jl33
-----END PGP SIGNATURE-----
diff --git a/sci-chemistry/ccp4-apps/ccp4-apps-6.1.3-r8.ebuild b/sci-chemistry/ccp4-apps/ccp4-apps-6.1.3-r8.ebuild
new file mode 100644
index 000000000000..8eb23301eec2
--- /dev/null
+++ b/sci-chemistry/ccp4-apps/ccp4-apps-6.1.3-r8.ebuild
@@ -0,0 +1,403 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/ccp4-apps/ccp4-apps-6.1.3-r8.ebuild,v 1.1 2011/01/11 13:47:20 jlec Exp $
+
+EAPI="3"
+
+PYTHON_DEPEND="2"
+
+inherit autotools eutils flag-o-matic gnuconfig python toolchain-funcs
+
+MY_P="${PN/-apps}-${PV}"
+
+SRC="ftp://ftp.ccp4.ac.uk/ccp4"
+
+#UPDATE="04_03_09"
+#PATCHDATE="090511"
+
+PATCH_TOT="0"
+# Here's a little scriptlet to generate this list from the provided
+# index.patches file
+#
+# i=1; while read -a line; do [[ ${line//#} != ${line} ]] && continue;
+# echo "PATCH${i}=( ${line[1]}"; echo "${line[0]} )"; (( i++ )); done <
+# index.patches
+#PATCH1=( src/topp_
+#topp.f-r1.16.2.5-r1.16.2.6.diff )
+#PATCH2=( .
+#configure-r1.372.2.18-r1.372.2.19.diff )
+
+DESCRIPTION="Protein X-ray crystallography toolkit"
+HOMEPAGE="http://www.ccp4.ac.uk/"
+RESTRICT="mirror"
+SRC_URI="
+ ${SRC}/${PV}/${MY_P}-core-src.tar.gz
+ http://dev.gentooexperimental.org/~jlec/distfiles/${PV}-oasis4.0.patch.bz2"
+# patch tarball from upstream
+ [[ -n ${UPDATE} ]] && SRC_URI="${SRC_URI} ${SRC}/${PV}/updates/${P}-src-patch-${UPDATE}.tar.gz"
+# patches created by us
+ [[ -n ${PATCHDATE} ]] && SRC_URI="${SRC_URI} http://dev.gentooexperimental.org/~jlec/science-dist/${PV}-${PATCHDATE}-updates.patch.bz2"
+
+for i in $(seq $PATCH_TOT); do
+ NAME="PATCH${i}[1]"
+ SRC_URI="${SRC_URI}
+ ${SRC}/${PV}/patches/${!NAME}"
+done
+
+LICENSE="ccp4"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="examples X"
+
+X11DEPS="
+ x11-libs/libX11
+ x11-libs/libXaw
+ x11-libs/libXt
+ x11-libs/libxdl_view"
+
+TKDEPS="
+ >=dev-lang/tk-8.3
+ >=dev-tcltk/blt-2.4
+ dev-tcltk/iwidgets
+ dev-tcltk/itcl
+ dev-tcltk/itk
+ >=dev-tcltk/tdom-0.8
+ dev-tcltk/tkimg
+ dev-tcltk/tktreectrl"
+
+SCILIBS="
+ ~sci-libs/ccp4-libs-${PV}
+ >=sci-libs/ccp4-libs-${PV}-r7
+ sci-libs/clipper
+ sci-libs/fftw:2.1
+ sci-libs/mmdb
+ virtual/blas
+ virtual/lapack"
+
+SCIAPPS="
+ sci-chemistry/pdb-extract
+ sci-chemistry/pymol
+ sci-chemistry/rasmol
+ >=sci-chemistry/oasis-4.0-r1"
+
+RDEPEND="
+ ${TKDEPS}
+ ${SCILIBS}
+ app-shells/tcsh
+ dev-python/pyxml
+ dev-libs/libxml2
+ dev-libs/libjwc_c
+ dev-libs/libjwc_f
+ dev-libs/boehm-gc
+ !app-office/sc
+ !<sci-chemistry/ccp4-6.1.3
+ X? ( ${X11DEPS} )"
+DEPEND="${RDEPEND}
+ X? (
+ x11-misc/imake
+ x11-proto/inputproto
+ x11-proto/xextproto
+ )"
+PDEPEND="${SCIAPPS}"
+
+S="${WORKDIR}/${MY_P}"
+
+pkg_setup() {
+ python_set_active_version 2
+}
+
+src_prepare() {
+ einfo "Applying upstream patches ..."
+ for patch in $(seq $PATCH_TOT); do
+ base="PATCH${patch}"
+ dir=$(eval echo \${${base}[0]})
+ p=$(eval echo \${${base}[1]})
+ pushd "${dir}" >& /dev/null
+ ccp_patch "${DISTDIR}/${p}"
+ popd >& /dev/null
+ done
+ einfo "Done."
+ echo
+
+ [[ -n ${PATCHDATE} ]] && epatch "${WORKDIR}"/${PV}-${PATCHDATE}-updates.patch
+
+ einfo "Applying Gentoo patches ..."
+
+ # it tries to create libdir, bindir etc on live system in configure
+ ccp_patch "${FILESDIR}"/${PV}-dont-make-dirs-in-configure.patch
+
+ # We already have sci-chemistry/rasmol
+ # Also remember to create the bindir.
+ ccp_patch "${FILESDIR}"/${PV}-dont-build-double-and-make-bindir.patch
+
+ # libraries come from sci-libs/ccp4-libs
+ ccp_patch "${FILESDIR}"/${PV}-dont-build-libs.patch
+
+ # coreutils installs a binary called truncate
+# ccp_patch "${FILESDIR}"/${PV}-rename-truncate.patch
+# mv ./doc/truncate.doc ./doc/ftruncate.doc || die
+# mv ./html/truncate.html ./html/ftruncate.html || die
+
+ # conflicts with media-libs/raptor
+# ccp_patch "${FILESDIR}"/${PV}-rename-rapper.patch
+# mv ./doc/rapper.doc ./doc/rappermc.doc || die
+# mv ./html/rapper.html ./html/rappermc.html || die
+
+ # We have seperate ebuilds for those
+ for bin in molref xia scala imosflm balbes; do
+ ccp_patch "${FILESDIR}"/${PV}-dont-build-${bin}.patch
+ done
+
+ # don't configure what is not build
+ ccp_patch "${FILESDIR}"/${PV}-dont-configure.patch
+
+ # Set python paths correctly
+ ccp_patch "${FILESDIR}"/${PV}-pythonpath.patch
+
+ # Set python paths correctly
+ ccp_patch "${FILESDIR}"/${PV}-pisa.patch
+
+ # Set python paths correctly
+ ccp_patch "${FILESDIR}"/${PV}-clipper-template.patch
+
+ # Fix upstreams code
+ ccp_patch "${FILESDIR}"/${PV}-impl-dec.patch
+
+ # Update things for oasis 4 usage
+ epatch "${WORKDIR}"/${PV}-oasis4.0.patch
+ sed 's: oasis : :g' -i src/Makefile.in || die
+
+ einfo "Done." # done applying Gentoo patches
+ echo
+
+ sed \
+ -e "s:/usr:${EPREFIX}/usr:g" \
+ -e 's:-Wl,-rpath,$CLIB::g' \
+ -e 's: -rpath $CLIB::g' \
+ -e 's: -I${srcdir}/include/cpp_c_headers::g' \
+ -e 's:sleep 1:sleep .2:g' \
+ -i configure || die
+
+ find "${S}" -name "Makefile.*" \
+ -exec sed -e 's|_FLAGS-|_FLAGS:-|g' -e "s:\(eval \$([[:alnum:]]*)\):\1 \$(GENTOOLDFLAGS):g" -i '{}' \;
+
+ # Don't build refmac, sfcheck, balbes, molrep binaries; available from the standalone version
+ sed -i -e "/^REFMACTARGETS/s:^.*:REFMACTARGETS="":g" configure
+
+ # Rapper bundles libxml2 and boehm-gc. Don't build, use or install those.
+ pushd src/rapper 2>/dev/null
+ sed -i \
+ -e '/^AC_CONFIG_SUBDIRS(\[gc7.0 libxml2\])/d' \
+ configure.ac
+ sed -i \
+ -e '/^SUBDIRS/s:libxml2 gc7.0::g' \
+ Makefile.am
+ sed -i \
+ -e '/^rapper_LDADD/s:../gc7.0/libgc.la ../libxml2/libxml2.la:-lgc -lxml2:g' \
+ LOOP/Makefile.am
+ sed -i \
+ -e "/^INCLUDES/s:-I../gc7.0/include -I../libxml2/include:-I${EPREFIX}/usr/include/gc -I${EPREFIX}/usr/include/libxml2:g" \
+ LOOP/Makefile.am
+ eautoreconf
+ popd 2>/dev/null
+
+ gnuconfig_update
+
+ python_convert_shebangs $(python_get_version) src/ccp4_pipeline_simple.py ./share/smartie/*.py
+}
+
+src_configure() {
+ # Build system is broken if we set LDFLAGS
+ export GENTOOLDFLAGS="${LDFLAGS}"
+ unset LDFLAGS
+
+ # These are broken with ./src/procheck/ps.f
+ filter-flags "-floop-*"
+
+ # GENTOO_OSNAME can be one of:
+ # irix irix64 sunos sunos64 aix hpux osf1 linux freebsd
+ # linux_compaq_compilers linux_intel_compilers generic Darwin
+ # ia64_linux_intel Darwin_ibm_compilers linux_ibm_compilers
+ if [[ "$(tc-getFC)" = "ifort" ]]; then
+ if use ia64; then
+ GENTOO_OSNAME="ia64_linux_intel"
+ else
+ # Should be valid for x86, maybe amd64
+ GENTOO_OSNAME="linux_intel_compilers"
+ fi
+ else
+ # Should be valid for x86 and amd64, at least
+ GENTOO_OSNAME="linux"
+ fi
+
+ # Sets up env
+ ln -s \
+ ccp4.setup-bash \
+ "${S}"/include/ccp4.setup
+
+ # We agree to the license by emerging this, set in LICENSE
+ sed -i \
+ -e "s~^\(^agreed=\).*~\1yes~g" \
+ "${S}"/configure
+
+ # Fix up variables -- need to reset CCP4_MASTER at install-time
+ sed -i \
+ -e "s~^\(setenv CCP4_MASTER.*\)/.*~\1${WORKDIR}~g" \
+ -e "s~^\(export CCP4_MASTER.*\)/.*~\1${WORKDIR}~g" \
+ -e "s~^\(.*export CBIN=.*\)\$CCP4.*~\1\$CCP4/libexec/ccp4/bin/~g" \
+ -e "s~^\(.*setenv CBIN .*\)\$CCP4.*~\1\$CCP4/libexec/ccp4/bin/~g" \
+ -e "s~^\(setenv CCP4I_TCLTK.*\)/usr/local/bin~\1${EPREFIX}/usr/bin~g" \
+ "${S}"/include/ccp4.setup*
+
+ # Set up variables for build
+ source "${S}"/include/ccp4.setup-sh
+
+ export CC=$(tc-getCC)
+ export CXX=$(tc-getCXX)
+ export COPTIM=${CFLAGS}
+ export CXXOPTIM=${CXXFLAGS}
+ # Default to -O2 if FFLAGS is unset
+ export FC=$(tc-getFC)
+ export FOPTIM=${FFLAGS:- -O2}
+ export BINSORT_SCR="${T}"
+ export CCP4_MASTER="${WORKDIR}"
+ export CCP4I_TCLTK="${EPREFIX}/usr/bin"
+ export MAKE="make ${MAKEOPTS} ${EXTRA_EMAKE}"
+
+ # Can't use econf, configure rejects unknown options like --prefix
+ ./configure \
+ $(use_enable X x) \
+ --with-shared-libs \
+ --with-fftw="${EPREFIX}/usr" \
+ --with-warnings \
+ --disable-pdb_extract \
+ --disable-cctbx \
+ --disable-phaser \
+ --disable-diffractionImg \
+ --disable-clipper \
+ --disable-mosflm \
+ --disable-mrbump \
+ --tmpdir="${TMPDIR}" \
+ ${GENTOO_OSNAME} || die "econf failed"
+
+ # We do this manually, since disabling the clipper libraries also
+ # disables the clipper programs
+ pushd src/clipper_progs 2>/dev/null
+ econf \
+ --prefix="${S}" \
+ --bindir="${ED}"/usr/libexec/ccp4/bin \
+ --with-ccp4="${S}" \
+ --with-clipper="${EPREFIX}/usr" \
+ --with-fftw="${EPREFIX}/usr" \
+ --with-mmdb="${EPREFIX}/usr" \
+ CXX=$(tc-getCXX)
+ popd 2>/dev/null
+}
+
+src_compile() {
+ # fsplit is required for the programs
+ pushd lib/src 2>/dev/null
+ emake fsplit -j1 || die
+ popd 2>/dev/null
+
+ # We do this manually, since disabling the clipper libraries also
+ # disables the clipper programs
+ pushd src/clipper_progs 2>/dev/null
+ emake || die
+ popd 2>/dev/null
+
+ emake -j1 || die "emake failed"
+}
+
+src_install() {
+ # Set up variables for build
+ source "${S}"/include/ccp4.setup-sh
+
+ # if we don't make this, a ton of programs fail to install
+ mkdir "${S}"/bin || die
+
+ # We do this manually, since disabling the clipper libraries also
+ # disables the clipper programs
+ pushd "${S}"/src/clipper_progs 2>/dev/null
+ emake install || die
+ popd 2>/dev/null
+
+ einstall || die "install failed"
+
+ # Collision with sci-chemistry/mrbump
+ rm -f "${S}"/bin/{mrbump,pydbviewer} || die
+
+ # Bins
+ exeinto /usr/libexec/ccp4/bin/
+ doexe "${S}"/bin/* || die
+
+ # Libs
+ for file in "${S}"/lib/*; do
+ if [[ -d ${file} ]]; then
+ continue
+ elif [[ -x ${file} ]]; then
+ dolib.so ${file} || die
+ else
+ insinto /usr/$(get_libdir)
+ doins ${file} || die
+ fi
+ done
+
+ rm -f "${S}"/include/ccp4.setup*
+
+ # smartie -- log parsing
+ insinto /usr/share/ccp4
+ doins -r "${S}"/share/smartie || die
+
+ # Install docs and examples
+ doman "${S}"/man/cat1/*
+
+ mv "${S}"/manual/README "${S}"/manual/README-manual
+ dodoc manual/* README CHANGES doc/* examples/README || die
+
+ rm "${ED}"/usr/share/doc/${PF}/GNUmakefile.*
+ rm "${ED}"/usr/share/doc/${PF}/COPYING.*
+
+ dohtml -r "${S}"/html/*
+
+ if use examples; then
+ for i in data rnase toxd; do
+ docinto examples/${i}
+ dodoc "${S}"/examples/${i}/*
+ done
+
+ docinto examples/tutorial
+ dohtml -r "${S}"/examples/tutorial/html examples/tutorial/tut.css
+ for i in data results; do
+ docinto examples/tutorial/${i}
+ dodoc "${S}"/examples/tutorial/${i}/*
+ done
+
+ for i in non-runnable runnable; do
+ docinto examples/unix/${i}
+ dodoc "${S}"/examples/unix/${i}/*
+ done
+ fi
+ # Needed for ccp4i docs to work
+ dosym ../../share/doc/${PF}/examples /usr/$(get_libdir)/ccp4/examples || die
+ dosym ../../share/doc/${PF}/html /usr/$(get_libdir)/ccp4/html || die
+
+ # Fix overlaps with other packages
+ rm -f "${ED}"/usr/share/man/man1/rasmol.1* "${ED}"/usr/lib/font84.dat || die
+ mv "${ED}"/usr/share/man/man1/truncate{,-ccp4}.1 || die
+ mv "${ED}"/usr/share/man/man1/rapper{,-ccp4}.1 || die
+ mv "${ED}"/usr/share/man/man1/sc{,-ccp4}.1 || die
+
+ cat >> "${T}"/baubles <<- EOF
+ #!${EPREFIX}/bin/bash
+ exec $(PYTHON) \${CCP4}/share/ccp4/smartie/baubles.py
+ EOF
+
+ exeinto /usr/libexec/ccp4/bin/
+ doexe "${T}"/baubles || die
+}
+
+# Epatch wrapper for bulk patching
+ccp_patch() {
+ EPATCH_SINGLE_MSG=" ${1##*/} ..." epatch ${1}
+}
diff --git a/sci-chemistry/ccp4-apps/files/6.1.3-impl-dec.patch b/sci-chemistry/ccp4-apps/files/6.1.3-impl-dec.patch
index 7529ea5de593..db8236063043 100644
--- a/sci-chemistry/ccp4-apps/files/6.1.3-impl-dec.patch
+++ b/sci-chemistry/ccp4-apps/files/6.1.3-impl-dec.patch
@@ -1,3 +1,107 @@
+diff --git a/lib/DiffractionImage/Bruker/FRM_LIB.c b/lib/DiffractionImage/Bruker/FRM_LIB.c
+index bfda882..f821e04 100755
+--- a/lib/DiffractionImage/Bruker/FRM_LIB.c
++++ b/lib/DiffractionImage/Bruker/FRM_LIB.c
+@@ -38,6 +38,8 @@ FRM_LIB: Routines for reading, writing, and handling frame files.
+ #include "sys/types.h" /* _open, etc. */
+ #include "sys/stat.h" /* _open, etc. */
+
++#include <unistd.h>
++
+ #ifndef _MSC_VER
+ int min(int a, int b)
+ {
+diff --git a/lib/DiffractionImage/MAR/mar300_header.c b/lib/DiffractionImage/MAR/mar300_header.c
+index 1a933de..1c40c32 100755
+--- a/lib/DiffractionImage/MAR/mar300_header.c
++++ b/lib/DiffractionImage/MAR/mar300_header.c
+@@ -23,6 +23,9 @@
+ */
+ #include "mar300_header.h"
+
++#include <sys/types.h>
++#include <unistd.h>
++
+ /*
+ * Local functions
+ */
+diff --git a/lib/DiffractionImage/MAR/mar345_header.c b/lib/DiffractionImage/MAR/mar345_header.c
+index a8351ea..16d0f7b 100755
+--- a/lib/DiffractionImage/MAR/mar345_header.c
++++ b/lib/DiffractionImage/MAR/mar345_header.c
+@@ -32,6 +32,9 @@
+ */
+ #include "mar345_header.h"
+
++#include <sys/types.h>
++#include <unistd.h>
++
+ /*
+ * Definitions
+ */
+diff --git a/lib/DiffractionImage/MAR/nb_header.c b/lib/DiffractionImage/MAR/nb_header.c
+index 07f2741..6364ca4 100755
+--- a/lib/DiffractionImage/MAR/nb_header.c
++++ b/lib/DiffractionImage/MAR/nb_header.c
+@@ -20,6 +20,8 @@
+ #include <io.h>
+ #endif
+
++#include <sys/types.h>
++#include <unistd.h>
+ /*
+ * mar software include files
+ */
+diff --git a/lib/DiffractionImage/MAR/swap.c b/lib/DiffractionImage/MAR/swap.c
+index 443bb8c..0d96b3f 100755
+--- a/lib/DiffractionImage/MAR/swap.c
++++ b/lib/DiffractionImage/MAR/swap.c
+@@ -10,6 +10,9 @@
+ *
+ **********************************************************************/
+
++#define _XOPEN_SOURCE
++#include <unistd.h>
++
+ void swaplong();
+ void swapshort();
+
+diff --git a/lib/ccif/f_interface.c b/lib/ccif/f_interface.c
+index 0f6a6b7..a09dc48 100755
+--- a/lib/ccif/f_interface.c
++++ b/lib/ccif/f_interface.c
+@@ -25,6 +25,7 @@
+ ********************************************************************/
+
+ #include "stdpccts.h"
++#include <sys/mman.h>
+
+ /* This file is terribly organised, and badly needs re-doing. There is probably
+ * scope for splitting this into three modules:
+diff --git a/lib/src/ccp4_general_f.c b/lib/src/ccp4_general_f.c
+index 8b5d04f..74ee3f7 100755
+--- a/lib/src/ccp4_general_f.c
++++ b/lib/src/ccp4_general_f.c
+@@ -26,6 +26,7 @@
+ #include <string.h>
+ #include <stdlib.h>
+ #include <math.h>
++#include <time.h>
+ #include "ccp4_errno.h"
+ #include "ccp4_fortran.h"
+ #include "ccp4_parser.h"
+diff --git a/lib/src/ccp4_program.c b/lib/src/ccp4_program.c
+index 3e83d4d..bb3e975 100755
+--- a/lib/src/ccp4_program.c
++++ b/lib/src/ccp4_program.c
+@@ -25,6 +25,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <time.h>
+ #include "ccp4_program.h"
+ #include "ccp4_parser.h"
+ #include "ccp4_utils.h"
diff --git a/lib/src/fsplit.c b/lib/src/fsplit.c
index ee8af24..c6fb3cd 100755
--- a/lib/src/fsplit.c
@@ -34,3 +138,15 @@ index e224430..c7b82f4 100755
#include "csymlib.h"
#include "mtz2cif_lib.h"
+diff --git a/x-windows/XCCPJIFFY/xplot84driver.c b/x-windows/XCCPJIFFY/xplot84driver.c
+index 67e0bf1..76526ab 100755
+--- a/x-windows/XCCPJIFFY/xplot84driver.c
++++ b/x-windows/XCCPJIFFY/xplot84driver.c
+@@ -11,6 +11,7 @@
+
+ #include <stdio.h>
+ #include <sys/types.h>
++#include <stdlib.h>
+
+ #include <X11/StringDefs.h>
+ #include <X11/Intrinsic.h>