aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sci-chemistry/gromacs/ChangeLog9
-rw-r--r--sci-chemistry/gromacs/Manifest26
-rw-r--r--sci-chemistry/gromacs/files/gromacs-4.0.4-configure-gfortran.patch17
-rw-r--r--sci-chemistry/gromacs/gromacs-3.3.9999.ebuild234
-rw-r--r--sci-chemistry/gromacs/gromacs-4.0.9999.ebuild234
-rw-r--r--sci-chemistry/gromacs/gromacs-9999.ebuild233
-rw-r--r--sci-chemistry/gromacs/metadata.xml7
7 files changed, 743 insertions, 17 deletions
diff --git a/sci-chemistry/gromacs/ChangeLog b/sci-chemistry/gromacs/ChangeLog
index baa781fc9..3d9feb298 100644
--- a/sci-chemistry/gromacs/ChangeLog
+++ b/sci-chemistry/gromacs/ChangeLog
@@ -2,6 +2,15 @@
# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+*gromacs-9999 (21 Jun 2009)
+*gromacs-4.0.9999 (21 Jun 2009)
+*gromacs-3.3.9999 (21 Jun 2009)
+
+ 21 Jun 2009; Christoph Junghans <kleiner_otti@gmx.de>
+ +gromacs-3.3.9999.ebuild, +files/gromacs-4.0.4-configure-gfortran.patch,
+ +gromacs-4.0.9999.ebuild, +gromacs-9999.ebuild, metadata.xml:
+ added live ebuilds for old, stable, experimental branch
+
21 Jun 2009; Christoph Junghans <kleiner_otti@gmx.de>
gromacs-4.0.4.ebuild:
Fixed some repoman errors
diff --git a/sci-chemistry/gromacs/Manifest b/sci-chemistry/gromacs/Manifest
index 5d3bcbf9f..d7527769a 100644
--- a/sci-chemistry/gromacs/Manifest
+++ b/sci-chemistry/gromacs/Manifest
@@ -1,24 +1,20 @@
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-- -----BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
+AUX gromacs-4.0.4-configure-gfortran.patch 731 RMD160 1ccea4fafd6837461114fc36bc31db4f9390fc08 SHA1 0ec79e9ab691cbae5f116adaa3245ef0b123a598 SHA256 5b902eac127bc84e188224fbfe0182ab3fa3b03c200325ada9cd628bb913b479
+DIST gmxtest-4.0.4.tgz 14845017 RMD160 c7c583415438bdef4c9996da9064254e9460cf16 SHA1 998179aa2bfbc4f80514f10ed774762f85c854c3 SHA256 6a7f787f4bb7cbecb688115ff0854a5ffd2ef33487d7bce4b031e63848b6f361
DIST gromacs-4.0.4.tar.gz 8443779 RMD160 f90327814170c26a43d99fe7587357a46989fdec SHA1 9466f3ab95d60c0aba8916b1fcc70129cb4e4d72 SHA256 8aefd03cd3269e85c84427f05ceea6d3e16874cd4a90bf3f6fec2b2be24c426f
+DIST manual-4.0.pdf 2135100 RMD160 b963642f8e1433f11328c3d0c4b1645c9de506da SHA1 8ae951ee15b2a7dc626331fce36511bc8766144c SHA256 646f810477eee2d710de6019c52056550413d0ba77baf9680195c835ddafe80a
+EBUILD gromacs-3.3.9999.ebuild 6640 RMD160 e0a39da394ae160584d394bcac9cae89d001d229 SHA1 4be6d054002faf7c4a853f1ee7aad09b2da86b1d SHA256 be6ff76414e9569fc0b160e2e591d749c2e46ae975535ec34332e2d6072b2a46
EBUILD gromacs-4.0.4.ebuild 6899 RMD160 ea01958dddb6e8874410e01df9171c5e081d1856 SHA1 7e1f7e37a88ecea0840e58d3687d6b00d70b0e0f SHA256 ff452e5d24885bc5ec40fc3ca29fe1f5f6997c499667bf62ebfb6b6a23532a07
-MISC ChangeLog 945 RMD160 9a4333ed2c72bfc56045a59f8ee00b836eeeb8d0 SHA1 404d663411bb93df647c190cf4e374bd8aa50f53 SHA256 3757b6370a226899b2192b5ee5a5d55ba1c1d11018d2bb2254e70ab4c41374db
-MISC metadata.xml 409 RMD160 484a62d0e282b28dcfb9992c6162deb368d90e26 SHA1 55b541c7d9581092982d1abe2da4a15f84c0fda9 SHA256 08e3609f4b9bb3002843f042cb6156c7e769c4796946a129e5886dab79e61358
-- -----BEGIN PGP SIGNATURE-----
-Version: GnuPG v2.0.11 (GNU/Linux)
-
-iEYEARECAAYFAko+g0kACgkQy0OE/ans1/mOoACferIO9tF56CjAI4WOAHZDBUUY
-8QAAn0OI7MFUUZDZIpo/cTQHaH59qwGy
-=ChDg
-- -----END PGP SIGNATURE-----
+EBUILD gromacs-4.0.9999.ebuild 6640 RMD160 c48a23acd60c4943b466cbfe36cc1a10ca5d2327 SHA1 137f0801ffb4fe3a87e3881fa95d432eb3e1041b SHA256 a1a81ae8997d31d956b7aaacc00b8988d6d95c8267c82a5110656856d982441b
+EBUILD gromacs-9999.ebuild 6606 RMD160 c25d3da0f931cee5cd29b7b698025b024b8c33f5 SHA1 3ede827e2fcc2b73ce709af9ff9e5af496c754d8 SHA256 07b3051e743d20b94c2f0df4360d00abad900a1baaad9a76c2924c0a373878fa
+MISC ChangeLog 1292 RMD160 559051475c2bfaf9dce39fbcbab489b72aec7eaf SHA1 cac028136a6ff6c4a4597105e89913d87e368a8b SHA256 8eefd2a64bdc8ed19dfff3088deb89f5cb3fc29faae162e2c6d8fdfe09de02d5
+MISC metadata.xml 642 RMD160 885e11bdae2d4e79b5fd7b48113f44d987c62b19 SHA1 ab77d33e2f7a8e8d6aa8a997e9247fd61bd17a74 SHA256 6e3242563fd78de425260bf28a07a017afb294898a80e02bacef59ec4a83064c
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.11 (GNU/Linux)
-iEYEARECAAYFAko+hDcACgkQy0OE/ans1/mfBgCfR3z5GcTCjKJ5njkyaw0l2Xxr
-ccoAn1dsoTM0XGC84LzBWYJu7xrPKRjL
-=iT7b
+iEYEARECAAYFAko+jIoACgkQy0OE/ans1/mAMACfShjgYsM9DvJdOLPIza3xNwSB
+shoAniWNBdT27i90sOnhyX/4vrCK39Wr
+=co6k
-----END PGP SIGNATURE-----
diff --git a/sci-chemistry/gromacs/files/gromacs-4.0.4-configure-gfortran.patch b/sci-chemistry/gromacs/files/gromacs-4.0.4-configure-gfortran.patch
new file mode 100644
index 000000000..c330fcaf0
--- /dev/null
+++ b/sci-chemistry/gromacs/files/gromacs-4.0.4-configure-gfortran.patch
@@ -0,0 +1,17 @@
+diff -Naur gromacs-4.0.4-orig/configure.ac gromacs-4.0.4/configure.ac
+--- gromacs-4.0.4-orig/configure.ac 2009-04-09 21:12:31.000000000 +0200
++++ gromacs-4.0.4/configure.ac 2009-04-09 21:13:38.000000000 +0200
+@@ -320,11 +320,11 @@
+ case "${host_cpu}-${host_os}" in
+ alpha*-linux*)
+ cc_names="ccc cc gcc"
+- f77_names="fort f77 g77"
++ f77_names="fort f77 g77 gfortran"
+ ;;
+ *)
+ cc_names="cc icc xlc gcc"
+- f77_names="f77 ifort xlf xlf77 cf77 fl32 g77 fort77 f90 xlf90 pgf77 cf77 fort fort77 pgf90"
++ f77_names="f77 ifort xlf xlf77 cf77 fl32 g77 fort77 f90 xlf90 pgf77 cf77 fort fort77 pgf90 gfortran"
+ ;;
+ esac
+ # the (non-mpi) c compiler, which is also used for programs executed during build stage
diff --git a/sci-chemistry/gromacs/gromacs-3.3.9999.ebuild b/sci-chemistry/gromacs/gromacs-3.3.9999.ebuild
new file mode 100644
index 000000000..8d354932d
--- /dev/null
+++ b/sci-chemistry/gromacs/gromacs-3.3.9999.ebuild
@@ -0,0 +1,234 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+LIBTOOLIZE="true"
+TEST_PV="4.0.4"
+
+inherit autotools bash-completion eutils fortran git multilib
+
+DESCRIPTION="The ultimate molecular dynamics simulation package"
+HOMEPAGE="http://www.gromacs.org/"
+SRC_URI="test? ( ftp://ftp.gromacs.org/pub/tests/gmxtest-${TEST_PV}.tgz )
+ doc? ( ftp://ftp.gromacs.org/pub/manual/manual-4.0.pdf )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc64 ~sparc ~x86"
+IUSE="X blas dmalloc doc -double-precision +fftw fkernels gsl lapack mpi +single-precision static test +xml zsh-completion"
+
+DEPEND="app-shells/tcsh
+ X? ( x11-libs/libX11 )
+ dmalloc? ( dev-libs/dmalloc )
+ blas? ( virtual/blas )
+ fftw? ( sci-libs/fftw:3.0 )
+ gsl? ( sci-libs/gsl )
+ lapack? ( virtual/lapack )
+ mpi? ( virtual/mpi )
+ xml? ( dev-libs/libxml2 )"
+
+RDEPEND="${DEPEND}"
+
+RESTRICT="test"
+
+EGIT_REPO_URI="git://git.gromacs.org/gromacs"
+EGIT_BRANCH="release-3-3-patches"
+
+src_prepare() {
+ # Fix typos in a couple of files.
+ sed -e "s:+0f:-f:" -i share/tutor/gmxdemo/demo \
+ || die "Failed to fixup demo script."
+
+ # Fix a sandbox violation that occurs when re-emerging with mpi.
+ sed "/libdir=\"\$(libdir)\"/ a\ temp_libdir=\"${D}usr/$( get_libdir )\" ; \\\\" \
+ -i src/tools/Makefile.am \
+ || die "sed tools/Makefile.am failed"
+
+ sed -e "s:\$\$libdir:\$temp_libdir:" \
+ -i src/tools/Makefile.am \
+ || die "sed tools/Makefile.am failed"
+
+ sed "/libdir=\"\$(libdir)\"/ a\ temp_libdir=\"${D}usr/$( get_libdir )\" ; \\\\" \
+ -i src/tools/Makefile.am \
+ || die "sed tools/Makefile.am failed"
+
+ sed -e "s:\$\$libdir:\$\$temp_libdir:" \
+ -i src/tools/Makefile.am \
+ || die "sed tools/Makefile.am failed"
+
+ use fkernels && epatch "${FILESDIR}/${PN}-4.0.4-configure-gfortran.patch"
+
+ eautoreconf
+
+ cd "${WORKDIR}"
+
+ use test && mv gmxtest "${P}"
+ mv "${P}" "${P}-single"
+ if ( use double-precision ) ; then
+ einfo "Moving sources for Multiprecision Build"
+ cp -prP "${P}-single" "${P}-double"
+ fi
+}
+
+src_configure() {
+ local myconf ;
+ local myconf_s ;
+ local myconf_d ;
+ local suffix_d ;
+
+ #leave all assembly options enabled mdrun is smart enough to deside itself
+ #there so no gentoo on bluegene!
+ myconf="${myconf} --disable-bluegene"
+
+ #from gromacs configure
+ if ! use fftw; then
+ ewarn "WARNING: The built-in FFTPACK routines are slow."
+ ewarn "Are you sure you don\'t want to use FFTW?"
+ ewarn "It is free and much faster..."
+ fi
+
+ if [[ $(gcc-version) == "4.1" ]]; then
+ ewarn "gcc 4.1 is not supported by gromacs"
+ ewarn "please run test suite"
+ fi
+
+ #fortran will gone in gromacs 4.1 anyway
+ #note for gentoo-PREFIX on aix, fortran (xlf) is still much faster
+ if use fkernels; then
+ ewarn "Fortran kernels are usually not faster than C kernels and assembly"
+ ewarn "I hope, you know what are you doing..."
+ FORTRAN="g77 gfortran ifc"
+ myconf="${myconf} --enable-fortran" && fortran_pkg_setup
+ else
+ myconf="${myconf} --disable-fortran"
+ fi
+
+ # if we need external blas
+ if use blas; then
+ export LIBS="${LIBS} -lblas"
+ myconf="${myconf} $(use_with blas external-blas)"
+ fi
+
+ # if we need external lapack
+ if use lapack; then
+ export LIBS="${LIBS} -llapack"
+ myconf="${myconf} $(use_with lapack external-lapack)"
+ fi
+
+ myconf="--datadir=/usr/share \
+ --bindir=/usr/bin \
+ --libdir=/usr/$(get_libdir) \
+ --docdir=/usr/share/doc/"${PF}" \
+ $(use_with dmalloc) \
+ $(use_with fftw fft fftw3) \
+ $(use_with gsl) \
+ $(use_enable mpi) \
+ $(use_with X x) \
+ $(use_with xml) \
+ $(use_enable static all-static) \
+ ${myconf}"
+
+ #if we build both double is suffixed
+ if ( use double-precision && use single-precision ); then
+ suffix_d="_d"
+ else
+ suffix_d=""
+ fi
+
+ if use double-precision ; then
+ #from gromacs manual
+ elog
+ elog "For most simulations single precision is accurate enough. In some"
+ elog "cases double precision is required to get reasonable results:"
+ elog
+ elog "-normal mode analysis, for the conjugate gradient or l-bfgs minimization"
+ elog " and the calculation and diagonalization of the Hessian "
+ elog "-calculation of the constraint force between two large groups of atoms"
+ elog "-energy conservation: this can only be done without temperature coupling and"
+ elog " without cutoffs"
+ elog
+ einfo "Configuring Double Precison Gromacs"
+ cd "${WORKDIR}"/"${P}"-double
+ myconf_d="${myconf} --enable-double --program-suffix='${suffix_d}'"
+ econf ${myconf_d} || die "Double Precision econf failed"
+ fi
+
+ if use single-precision ; then
+ einfo "Configuring Single Precison Gromacs"
+ cd "${WORKDIR}"/"${P}"-single
+ myconf_s="${myconf} --enable-float --program-suffix=''"
+ econf ${myconf_s} || die "configure failed"
+ fi
+}
+
+src_compile() {
+ if use double-precision ; then
+ einfo "Building Double Precison Gromacs"
+ cd "${WORKDIR}"/"${P}"-double
+ emake || die "Double Precision emake failed"
+ fi
+
+ if use single-precision ; then
+ einfo "Building Single Precison Gromacs"
+ cd "${WORKDIR}"/"${P}"-single
+ emake || die "Single Precision emake failed"
+ fi
+}
+
+src_test() {
+ if use single-precision ; then
+ export PATH="${WORKDIR}/${P}-single/src/kernel:${WORKDIR}/${P}-single/src/tools:$PATH"
+ cd "${WORKDIR}"/"${P}"-single
+ emake -j1 tests || die "Single Precision test failed"
+ fi
+
+ if use double-precision ; then
+ export PATH="${WORKDIR}/${P}-double/src/kernel:${WORKDIR}/${P}-double/src/tools:$PATH"
+ cd "${WORKDIR}"/"${P}"-double
+ emake -j1 tests || die "Double Precision test failed"
+ fi
+}
+
+src_install() {
+ if use single-precision ; then
+ einfo "Installing Single Precision"
+ cd "${WORKDIR}"/"${P}"-single
+ emake DESTDIR="${D}" install || die "Installing Single Precision failed"
+ fi
+
+ if use double-precision ; then
+ einfo "Installing Double Precision"
+ cd "${WORKDIR}"/"${P}"-double
+ emake DESTDIR="${D}" install || die "Installing Double Precision failed"
+ fi
+
+ sed -n -e '/^GMXBIN/,/^GMXDATA/p' "${D}"/usr/bin/GMXRC.bash > "${T}/80gromacs"
+ doenvd "${T}/80gromacs"
+ rm -f "${D}"/usr/bin/GMXRC*
+
+ dobashcompletion "${D}"/usr/bin/completion.bash ${PN}
+ if use zsh-completion ; then
+ insinto /usr/share/zsh/site-functions
+ newins "${D}"/usr/bin/completion.zsh _${PN}
+ fi
+ rm -r "${D}"/usr/bin/completion.*
+
+ dodoc AUTHORS INSTALL README
+ use doc && dodoc "${DISTDIR}"/manual-4.0.pdf
+}
+
+pkg_postinst() {
+ env-update && source /etc/profile
+ elog
+ elog "Please read and cite:"
+ elog "Gromacs 4, J. Chem. Theory Comput. 4, 435 \(2008\). "
+ elog "http://dx.doi.org/10.1021/ct700301q"
+ elog
+ bash-completion_pkg_postinst
+ elog
+ elog $(luck)
+ elog "For more Gromacs cool quotes \(gcq\) add luck to your .bashrc"
+ elog
+}
diff --git a/sci-chemistry/gromacs/gromacs-4.0.9999.ebuild b/sci-chemistry/gromacs/gromacs-4.0.9999.ebuild
new file mode 100644
index 000000000..63fd0da23
--- /dev/null
+++ b/sci-chemistry/gromacs/gromacs-4.0.9999.ebuild
@@ -0,0 +1,234 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+LIBTOOLIZE="true"
+TEST_PV="4.0.4"
+
+inherit autotools bash-completion eutils fortran git multilib
+
+DESCRIPTION="The ultimate molecular dynamics simulation package"
+HOMEPAGE="http://www.gromacs.org/"
+SRC_URI="test? ( ftp://ftp.gromacs.org/pub/tests/gmxtest-${TEST_PV}.tgz )
+ doc? ( ftp://ftp.gromacs.org/pub/manual/manual-4.0.pdf )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc64 ~sparc ~x86"
+IUSE="X blas dmalloc doc -double-precision +fftw fkernels gsl lapack mpi +single-precision static test +xml zsh-completion"
+
+DEPEND="app-shells/tcsh
+ X? ( x11-libs/libX11 )
+ dmalloc? ( dev-libs/dmalloc )
+ blas? ( virtual/blas )
+ fftw? ( sci-libs/fftw:3.0 )
+ gsl? ( sci-libs/gsl )
+ lapack? ( virtual/lapack )
+ mpi? ( virtual/mpi )
+ xml? ( dev-libs/libxml2 )"
+
+RDEPEND="${DEPEND}"
+
+RESTRICT="test"
+
+EGIT_REPO_URI="git://git.gromacs.org/gromacs"
+EGIT_BRANCH="release-4-0-patches"
+
+src_prepare() {
+ # Fix typos in a couple of files.
+ sed -e "s:+0f:-f:" -i share/tutor/gmxdemo/demo \
+ || die "Failed to fixup demo script."
+
+ # Fix a sandbox violation that occurs when re-emerging with mpi.
+ sed "/libdir=\"\$(libdir)\"/ a\ temp_libdir=\"${D}usr/$( get_libdir )\" ; \\\\" \
+ -i src/tools/Makefile.am \
+ || die "sed tools/Makefile.am failed"
+
+ sed -e "s:\$\$libdir:\$temp_libdir:" \
+ -i src/tools/Makefile.am \
+ || die "sed tools/Makefile.am failed"
+
+ sed "/libdir=\"\$(libdir)\"/ a\ temp_libdir=\"${D}usr/$( get_libdir )\" ; \\\\" \
+ -i src/tools/Makefile.am \
+ || die "sed tools/Makefile.am failed"
+
+ sed -e "s:\$\$libdir:\$\$temp_libdir:" \
+ -i src/tools/Makefile.am \
+ || die "sed tools/Makefile.am failed"
+
+ use fkernels && epatch "${FILESDIR}/${PN}-4.0.4-configure-gfortran.patch"
+
+ eautoreconf
+
+ cd "${WORKDIR}"
+
+ use test && mv gmxtest "${P}"
+ mv "${P}" "${P}-single"
+ if ( use double-precision ) ; then
+ einfo "Moving sources for Multiprecision Build"
+ cp -prP "${P}-single" "${P}-double"
+ fi
+}
+
+src_configure() {
+ local myconf ;
+ local myconf_s ;
+ local myconf_d ;
+ local suffix_d ;
+
+ #leave all assembly options enabled mdrun is smart enough to deside itself
+ #there so no gentoo on bluegene!
+ myconf="${myconf} --disable-bluegene"
+
+ #from gromacs configure
+ if ! use fftw; then
+ ewarn "WARNING: The built-in FFTPACK routines are slow."
+ ewarn "Are you sure you don\'t want to use FFTW?"
+ ewarn "It is free and much faster..."
+ fi
+
+ if [[ $(gcc-version) == "4.1" ]]; then
+ ewarn "gcc 4.1 is not supported by gromacs"
+ ewarn "please run test suite"
+ fi
+
+ #fortran will gone in gromacs 4.1 anyway
+ #note for gentoo-PREFIX on aix, fortran (xlf) is still much faster
+ if use fkernels; then
+ ewarn "Fortran kernels are usually not faster than C kernels and assembly"
+ ewarn "I hope, you know what are you doing..."
+ FORTRAN="g77 gfortran ifc"
+ myconf="${myconf} --enable-fortran" && fortran_pkg_setup
+ else
+ myconf="${myconf} --disable-fortran"
+ fi
+
+ # if we need external blas
+ if use blas; then
+ export LIBS="${LIBS} -lblas"
+ myconf="${myconf} $(use_with blas external-blas)"
+ fi
+
+ # if we need external lapack
+ if use lapack; then
+ export LIBS="${LIBS} -llapack"
+ myconf="${myconf} $(use_with lapack external-lapack)"
+ fi
+
+ myconf="--datadir=/usr/share \
+ --bindir=/usr/bin \
+ --libdir=/usr/$(get_libdir) \
+ --docdir=/usr/share/doc/"${PF}" \
+ $(use_with dmalloc) \
+ $(use_with fftw fft fftw3) \
+ $(use_with gsl) \
+ $(use_enable mpi) \
+ $(use_with X x) \
+ $(use_with xml) \
+ $(use_enable static all-static) \
+ ${myconf}"
+
+ #if we build both double is suffixed
+ if ( use double-precision && use single-precision ); then
+ suffix_d="_d"
+ else
+ suffix_d=""
+ fi
+
+ if use double-precision ; then
+ #from gromacs manual
+ elog
+ elog "For most simulations single precision is accurate enough. In some"
+ elog "cases double precision is required to get reasonable results:"
+ elog
+ elog "-normal mode analysis, for the conjugate gradient or l-bfgs minimization"
+ elog " and the calculation and diagonalization of the Hessian "
+ elog "-calculation of the constraint force between two large groups of atoms"
+ elog "-energy conservation: this can only be done without temperature coupling and"
+ elog " without cutoffs"
+ elog
+ einfo "Configuring Double Precison Gromacs"
+ cd "${WORKDIR}"/"${P}"-double
+ myconf_d="${myconf} --enable-double --program-suffix='${suffix_d}'"
+ econf ${myconf_d} || die "Double Precision econf failed"
+ fi
+
+ if use single-precision ; then
+ einfo "Configuring Single Precison Gromacs"
+ cd "${WORKDIR}"/"${P}"-single
+ myconf_s="${myconf} --enable-float --program-suffix=''"
+ econf ${myconf_s} || die "configure failed"
+ fi
+}
+
+src_compile() {
+ if use double-precision ; then
+ einfo "Building Double Precison Gromacs"
+ cd "${WORKDIR}"/"${P}"-double
+ emake || die "Double Precision emake failed"
+ fi
+
+ if use single-precision ; then
+ einfo "Building Single Precison Gromacs"
+ cd "${WORKDIR}"/"${P}"-single
+ emake || die "Single Precision emake failed"
+ fi
+}
+
+src_test() {
+ if use single-precision ; then
+ export PATH="${WORKDIR}/${P}-single/src/kernel:${WORKDIR}/${P}-single/src/tools:$PATH"
+ cd "${WORKDIR}"/"${P}"-single
+ emake -j1 tests || die "Single Precision test failed"
+ fi
+
+ if use double-precision ; then
+ export PATH="${WORKDIR}/${P}-double/src/kernel:${WORKDIR}/${P}-double/src/tools:$PATH"
+ cd "${WORKDIR}"/"${P}"-double
+ emake -j1 tests || die "Double Precision test failed"
+ fi
+}
+
+src_install() {
+ if use single-precision ; then
+ einfo "Installing Single Precision"
+ cd "${WORKDIR}"/"${P}"-single
+ emake DESTDIR="${D}" install || die "Installing Single Precision failed"
+ fi
+
+ if use double-precision ; then
+ einfo "Installing Double Precision"
+ cd "${WORKDIR}"/"${P}"-double
+ emake DESTDIR="${D}" install || die "Installing Double Precision failed"
+ fi
+
+ sed -n -e '/^GMXBIN/,/^GMXDATA/p' "${D}"/usr/bin/GMXRC.bash > "${T}/80gromacs"
+ doenvd "${T}/80gromacs"
+ rm -f "${D}"/usr/bin/GMXRC*
+
+ dobashcompletion "${D}"/usr/bin/completion.bash ${PN}
+ if use zsh-completion ; then
+ insinto /usr/share/zsh/site-functions
+ newins "${D}"/usr/bin/completion.zsh _${PN}
+ fi
+ rm -r "${D}"/usr/bin/completion.*
+
+ dodoc AUTHORS INSTALL README
+ use doc && dodoc "${DISTDIR}"/manual-4.0.pdf
+}
+
+pkg_postinst() {
+ env-update && source /etc/profile
+ elog
+ elog "Please read and cite:"
+ elog "Gromacs 4, J. Chem. Theory Comput. 4, 435 \(2008\). "
+ elog "http://dx.doi.org/10.1021/ct700301q"
+ elog
+ bash-completion_pkg_postinst
+ elog
+ elog $(luck)
+ elog "For more Gromacs cool quotes \(gcq\) add luck to your .bashrc"
+ elog
+}
diff --git a/sci-chemistry/gromacs/gromacs-9999.ebuild b/sci-chemistry/gromacs/gromacs-9999.ebuild
new file mode 100644
index 000000000..e8384fb66
--- /dev/null
+++ b/sci-chemistry/gromacs/gromacs-9999.ebuild
@@ -0,0 +1,233 @@
+# Copyright 1999-2009 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+LIBTOOLIZE="true"
+TEST_PV="4.0.4"
+
+inherit autotools bash-completion eutils fortran git multilib
+
+DESCRIPTION="The ultimate molecular dynamics simulation package"
+HOMEPAGE="http://www.gromacs.org/"
+SRC_URI="test? ( ftp://ftp.gromacs.org/pub/tests/gmxtest-${TEST_PV}.tgz )
+ doc? ( ftp://ftp.gromacs.org/pub/manual/manual-4.0.pdf )"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~ppc64 ~sparc ~x86"
+IUSE="X blas dmalloc doc -double-precision +fftw fkernels gsl lapack mpi +single-precision static test +xml zsh-completion"
+
+DEPEND="app-shells/tcsh
+ X? ( x11-libs/libX11 )
+ dmalloc? ( dev-libs/dmalloc )
+ blas? ( virtual/blas )
+ fftw? ( sci-libs/fftw:3.0 )
+ gsl? ( sci-libs/gsl )
+ lapack? ( virtual/lapack )
+ mpi? ( virtual/mpi )
+ xml? ( dev-libs/libxml2 )"
+
+RDEPEND="${DEPEND}"
+
+RESTRICT="test"
+
+EGIT_REPO_URI="git://git.gromacs.org/gromacs"
+
+src_prepare() {
+ # Fix typos in a couple of files.
+ sed -e "s:+0f:-f:" -i share/tutor/gmxdemo/demo \
+ || die "Failed to fixup demo script."
+
+ # Fix a sandbox violation that occurs when re-emerging with mpi.
+ sed "/libdir=\"\$(libdir)\"/ a\ temp_libdir=\"${D}usr/$( get_libdir )\" ; \\\\" \
+ -i src/tools/Makefile.am \
+ || die "sed tools/Makefile.am failed"
+
+ sed -e "s:\$\$libdir:\$temp_libdir:" \
+ -i src/tools/Makefile.am \
+ || die "sed tools/Makefile.am failed"
+
+ sed "/libdir=\"\$(libdir)\"/ a\ temp_libdir=\"${D}usr/$( get_libdir )\" ; \\\\" \
+ -i src/tools/Makefile.am \
+ || die "sed tools/Makefile.am failed"
+
+ sed -e "s:\$\$libdir:\$\$temp_libdir:" \
+ -i src/tools/Makefile.am \
+ || die "sed tools/Makefile.am failed"
+
+ use fkernels && epatch "${FILESDIR}/${PN}-4.0.4-configure-gfortran.patch"
+
+ eautoreconf
+
+ cd "${WORKDIR}"
+
+ use test && mv gmxtest "${P}"
+ mv "${P}" "${P}-single"
+ if ( use double-precision ) ; then
+ einfo "Moving sources for Multiprecision Build"
+ cp -prP "${P}-single" "${P}-double"
+ fi
+}
+
+src_configure() {
+ local myconf ;
+ local myconf_s ;
+ local myconf_d ;
+ local suffix_d ;
+
+ #leave all assembly options enabled mdrun is smart enough to deside itself
+ #there so no gentoo on bluegene!
+ myconf="${myconf} --disable-bluegene"
+
+ #from gromacs configure
+ if ! use fftw; then
+ ewarn "WARNING: The built-in FFTPACK routines are slow."
+ ewarn "Are you sure you don\'t want to use FFTW?"
+ ewarn "It is free and much faster..."
+ fi
+
+ if [[ $(gcc-version) == "4.1" ]]; then
+ ewarn "gcc 4.1 is not supported by gromacs"
+ ewarn "please run test suite"
+ fi
+
+ #fortran will gone in gromacs 4.1 anyway
+ #note for gentoo-PREFIX on aix, fortran (xlf) is still much faster
+ if use fkernels; then
+ ewarn "Fortran kernels are usually not faster than C kernels and assembly"
+ ewarn "I hope, you know what are you doing..."
+ FORTRAN="g77 gfortran ifc"
+ myconf="${myconf} --enable-fortran" && fortran_pkg_setup
+ else
+ myconf="${myconf} --disable-fortran"
+ fi
+
+ # if we need external blas
+ if use blas; then
+ export LIBS="${LIBS} -lblas"
+ myconf="${myconf} $(use_with blas external-blas)"
+ fi
+
+ # if we need external lapack
+ if use lapack; then
+ export LIBS="${LIBS} -llapack"
+ myconf="${myconf} $(use_with lapack external-lapack)"
+ fi
+
+ myconf="--datadir=/usr/share \
+ --bindir=/usr/bin \
+ --libdir=/usr/$(get_libdir) \
+ --docdir=/usr/share/doc/"${PF}" \
+ $(use_with dmalloc) \
+ $(use_with fftw fft fftw3) \
+ $(use_with gsl) \
+ $(use_enable mpi) \
+ $(use_with X x) \
+ $(use_with xml) \
+ $(use_enable static all-static) \
+ ${myconf}"
+
+ #if we build both double is suffixed
+ if ( use double-precision && use single-precision ); then
+ suffix_d="_d"
+ else
+ suffix_d=""
+ fi
+
+ if use double-precision ; then
+ #from gromacs manual
+ elog
+ elog "For most simulations single precision is accurate enough. In some"
+ elog "cases double precision is required to get reasonable results:"
+ elog
+ elog "-normal mode analysis, for the conjugate gradient or l-bfgs minimization"
+ elog " and the calculation and diagonalization of the Hessian "
+ elog "-calculation of the constraint force between two large groups of atoms"
+ elog "-energy conservation: this can only be done without temperature coupling and"
+ elog " without cutoffs"
+ elog
+ einfo "Configuring Double Precison Gromacs"
+ cd "${WORKDIR}"/"${P}"-double
+ myconf_d="${myconf} --enable-double --program-suffix='${suffix_d}'"
+ econf ${myconf_d} || die "Double Precision econf failed"
+ fi
+
+ if use single-precision ; then
+ einfo "Configuring Single Precison Gromacs"
+ cd "${WORKDIR}"/"${P}"-single
+ myconf_s="${myconf} --enable-float --program-suffix=''"
+ econf ${myconf_s} || die "configure failed"
+ fi
+}
+
+src_compile() {
+ if use double-precision ; then
+ einfo "Building Double Precison Gromacs"
+ cd "${WORKDIR}"/"${P}"-double
+ emake || die "Double Precision emake failed"
+ fi
+
+ if use single-precision ; then
+ einfo "Building Single Precison Gromacs"
+ cd "${WORKDIR}"/"${P}"-single
+ emake || die "Single Precision emake failed"
+ fi
+}
+
+src_test() {
+ if use single-precision ; then
+ export PATH="${WORKDIR}/${P}-single/src/kernel:${WORKDIR}/${P}-single/src/tools:$PATH"
+ cd "${WORKDIR}"/"${P}"-single
+ emake -j1 tests || die "Single Precision test failed"
+ fi
+
+ if use double-precision ; then
+ export PATH="${WORKDIR}/${P}-double/src/kernel:${WORKDIR}/${P}-double/src/tools:$PATH"
+ cd "${WORKDIR}"/"${P}"-double
+ emake -j1 tests || die "Double Precision test failed"
+ fi
+}
+
+src_install() {
+ if use single-precision ; then
+ einfo "Installing Single Precision"
+ cd "${WORKDIR}"/"${P}"-single
+ emake DESTDIR="${D}" install || die "Installing Single Precision failed"
+ fi
+
+ if use double-precision ; then
+ einfo "Installing Double Precision"
+ cd "${WORKDIR}"/"${P}"-double
+ emake DESTDIR="${D}" install || die "Installing Double Precision failed"
+ fi
+
+ sed -n -e '/^GMXBIN/,/^GMXDATA/p' "${D}"/usr/bin/GMXRC.bash > "${T}/80gromacs"
+ doenvd "${T}/80gromacs"
+ rm -f "${D}"/usr/bin/GMXRC*
+
+ dobashcompletion "${D}"/usr/bin/completion.bash ${PN}
+ if use zsh-completion ; then
+ insinto /usr/share/zsh/site-functions
+ newins "${D}"/usr/bin/completion.zsh _${PN}
+ fi
+ rm -r "${D}"/usr/bin/completion.*
+
+ dodoc AUTHORS INSTALL README
+ use doc && dodoc "${DISTDIR}"/manual-4.0.pdf
+}
+
+pkg_postinst() {
+ env-update && source /etc/profile
+ elog
+ elog "Please read and cite:"
+ elog "Gromacs 4, J. Chem. Theory Comput. 4, 435 \(2008\). "
+ elog "http://dx.doi.org/10.1021/ct700301q"
+ elog
+ bash-completion_pkg_postinst
+ elog
+ elog $(luck)
+ elog "For more Gromacs cool quotes \(gcq\) add luck to your .bashrc"
+ elog
+}
diff --git a/sci-chemistry/gromacs/metadata.xml b/sci-chemistry/gromacs/metadata.xml
index ab7d70798..8f140cfbf 100644
--- a/sci-chemistry/gromacs/metadata.xml
+++ b/sci-chemistry/gromacs/metadata.xml
@@ -3,9 +3,12 @@
<pkgmetadata>
<herd>sci-chemistry</herd>
<use>
- <flag name='double-precision'>More precise calculations at the expense of
- speed</flag>
+ <flag name='dmalloc'>Enable use of Debug Malloc</flag>
+ <flag name='double-precision'>More precise calculations at the expense of speed</flag>
+ <flag name='fkernels'>Enable building of Fortran Kernels for platforms
+ that dont have assembly loops</flag>
<flag name='single-precision'>Single precision version of gromacs</flag>
<flag name='gmxmopac7'>Support for QM/MM with mopac7</flag>
+ <flag name='zsh-completion'>Enable zsh completion support</flag>
</use>
</pkgmetadata>