diff options
author | 2010-02-04 22:56:26 +0000 | |
---|---|---|
committer | 2010-02-04 22:56:26 +0000 | |
commit | 9528c43941bac1378bf7471e928b9352ed54a7b7 (patch) | |
tree | 46f0aa636c2978a6de5a2d0c1059cd6bd8c818d6 /sci-libs/cctbx | |
parent | cctbx-2.0 license added (diff) | |
download | historical-9528c43941bac1378bf7471e928b9352ed54a7b7.tar.gz historical-9528c43941bac1378bf7471e928b9352ed54a7b7.tar.bz2 historical-9528c43941bac1378bf7471e928b9352ed54a7b7.zip |
Computational Crystallography Toolbox
Initially written by dberkholz
Package-Manager: portage-2.2_rc62/cvs/Linux x86_64
Diffstat (limited to 'sci-libs/cctbx')
-rw-r--r-- | sci-libs/cctbx/ChangeLog | 10 | ||||
-rw-r--r-- | sci-libs/cctbx/Manifest | 14 | ||||
-rw-r--r-- | sci-libs/cctbx/cctbx-2009.11.01.0123.ebuild | 199 | ||||
-rw-r--r-- | sci-libs/cctbx/metadata.xml | 18 |
4 files changed, 241 insertions, 0 deletions
diff --git a/sci-libs/cctbx/ChangeLog b/sci-libs/cctbx/ChangeLog new file mode 100644 index 000000000000..29e98d81c5a8 --- /dev/null +++ b/sci-libs/cctbx/ChangeLog @@ -0,0 +1,10 @@ +# ChangeLog for sci-libs/cctbx +# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2 +# $Header: /var/cvsroot/gentoo-x86/sci-libs/cctbx/ChangeLog,v 1.1 2010/02/04 22:56:26 jlec Exp $ + +*cctbx-2009.11.01.0123 (04 Feb 2010) + + 04 Feb 2010; Justin Lecher (jlec) <jlec@gentoo.org> + +cctbx-2009.11.01.0123.ebuild, +metadata.xml: + New ebuild, initialy written by dberkholz + diff --git a/sci-libs/cctbx/Manifest b/sci-libs/cctbx/Manifest new file mode 100644 index 000000000000..fffa4885a3ef --- /dev/null +++ b/sci-libs/cctbx/Manifest @@ -0,0 +1,14 @@ +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +DIST cctbx-2009.11.01.0123.tar.gz 14604079 RMD160 77cc84d4b9e35e7a87f807d8669efb939b2e82ce SHA1 7db71a62786b82f47999919a9411938b123d5b4d SHA256 31e7f79424360f963c6eae528a9d289db4b53c1f7fe4aa9de71201e9d14bc5af +EBUILD cctbx-2009.11.01.0123.ebuild 5809 RMD160 dce578bd21bd49bcc205df65457d97066ac44955 SHA1 83245e05e828c408ef15172827d364a647569541 SHA256 96c81826c7aa8bf7f487d913d1c8414be1cfe7451f40e6ab60df72cb7764a980 +MISC ChangeLog 384 RMD160 82e9d22ad375d5b56b443cfeec31e13bbb1515e4 SHA1 e55ed476ec8a367a63e2ffb26caba23783858317 SHA256 e2ae75dc41f77c6981f1e7de985417079430ea58011d8cd40626854254e3c56e +MISC metadata.xml 767 RMD160 c2fc3bcc534e407e6066ee98beb6878d78a0f6e9 SHA1 a653677e160cf0726e1747b06b5d0cd95e51ac5f SHA256 ef36fc1a1d5d657ba67f88b303f08eef5a1a814d22a2091c07616dc16928e3fa +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v2.0.14 (GNU/Linux) + +iEYEARECAAYFAktrUJ8ACgkQgAnW8HDreRZx2ACdHHz3K5nzCqL9AXYvHhP/CL3L +V3IAoMZHC2D7uox21cqaWPcvNd8Oz8nq +=YvGu +-----END PGP SIGNATURE----- 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 000000000000..096c0892f755 --- /dev/null +++ b/sci-libs/cctbx/cctbx-2009.11.01.0123.ebuild @@ -0,0 +1,199 @@ +# Copyright 1999-2010 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sci-libs/cctbx/cctbx-2009.11.01.0123.ebuild,v 1.1 2010/02/04 22:56:26 jlec Exp $ + +EAPI="3" +PYTHON_DEPEND="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=" + >dev-libs/boost-1.39 + sci-libs/fftw + !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() { + 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 ${PN} with OpenMP, abort now," + ewarn "and switch CC to an OpenMP capable compiler" + fi +} + +src_prepare() { + local opts + local optsld + + rm -rf "${MY_S}/scons" + + mkdir -p "${MY_S}"/scons/src/ "${MY_S}/boost" + + ln -sf "${EPREFIX}"/usr/$(get_libdir)/scons-* "${MY_S}"/scons/src/engine || die + + # 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. + ${EPREFIX}/usr/bin/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}" + + ${EPREFIX}/usr/bin/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}:${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" + + 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 || die + newins "${MY_B}"/setpaths.csh 30cctbx.csh || die + + cat >> "${T}"/30cctbx <<- EOF + LDPATH="${EPREFIX}/usr/$(get_libdir)/${PN}/cctbx_build/lib" + EOF + + doenvd "${T}"/30cctbx || die +} + +pkg_postinst () { + python_need_rebuild + 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/metadata.xml b/sci-libs/cctbx/metadata.xml new file mode 100644 index 000000000000..4f0ff73f95b4 --- /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> |