namd-2.9-r1.ebuild 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. # Copyright 1999-2015 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils multilib toolchain-funcs flag-o-matic
  5. DESCRIPTION="A powerful and highly parallelized molecular dynamics code"
  6. LICENSE="namd"
  7. HOMEPAGE="http://www.ks.uiuc.edu/Research/namd/"
  8. MY_PN="NAMD"
  9. SRC_URI="${MY_PN}_${PV}_Source.tar.gz"
  10. SLOT="0"
  11. KEYWORDS="~amd64"
  12. IUSE=""
  13. RESTRICT="fetch"
  14. RDEPEND="
  15. >=sys-cluster/charm-6.5.1-r2
  16. sci-libs/fftw:3.0
  17. dev-lang/tcl:0="
  18. DEPEND="${RDEPEND}
  19. app-shells/tcsh"
  20. NAMD_ARCH="Linux-x86_64-g++"
  21. NAMD_DOWNLOAD="http://www.ks.uiuc.edu/Development/Download/download.cgi?PackageName=NAMD"
  22. S="${WORKDIR}/${MY_PN}_${PV}_Source"
  23. pkg_nofetch() {
  24. echo
  25. einfo "Please download ${MY_PN}_${PV}_Source.tar.gz from"
  26. einfo "${NAMD_DOWNLOAD}"
  27. einfo "after agreeing to the license and then move it to"
  28. einfo "${DISTDIR}"
  29. einfo "Be sure to select the ${PV} version!"
  30. echo
  31. }
  32. src_prepare() {
  33. CHARM_VERSION=$(best_version sys-cluster/charm | cut -d- -f3)
  34. # apply a few small fixes to make NAMD compile and
  35. # link to the proper libraries
  36. epatch "${FILESDIR}"/namd-2.9-gentoo.patch
  37. epatch "${FILESDIR}"/namd-2.7-iml-dec.patch
  38. sed \
  39. -e "s:charm-.\+:charm-${CHARM_VERSION}:" \
  40. -i Make.charm || die
  41. # Remove charm distribution. We don't need it.
  42. rm -f charm-6.4.0.tar || die
  43. # proper compiler and cflags
  44. sed \
  45. -e "s/g++.*/$(tc-getCXX)/" \
  46. -e "s/gcc.*/$(tc-getCC)/" \
  47. -e "s/CXXOPTS = .*/CXXOPTS = ${CXXFLAGS} ${LDFLAGS}/" \
  48. -e "s/COPTS = .*/COPTS = ${CFLAGS} ${LDFLAGS}/" \
  49. -i arch/${NAMD_ARCH}.arch || die
  50. sed \
  51. -e "s/gentoo-libdir/$(get_libdir)/g" \
  52. -e "s/gentoo-charm/charm-${CHARM_VERSION}/g" \
  53. -i Makefile || die "Failed gentooizing Makefile."
  54. sed -e "s@/lib@/$(get_libdir)@g" -e '/FFTDIR=/s@=.*@=/usr@' -i arch/Linux-x86_64.fftw3 || die
  55. sed -e "s/gentoo-libdir/$(get_libdir)/g" -i arch/Linux-x86_64.tcl || die
  56. }
  57. src_configure() {
  58. # configure
  59. ./config ${NAMD_ARCH} --with-fftw3 --charm-arch . || die
  60. }
  61. src_compile() {
  62. # build namd
  63. cd "${S}/${NAMD_ARCH}"
  64. emake
  65. }
  66. src_install() {
  67. dodoc announce.txt license.txt notes.txt
  68. cd "${S}/${NAMD_ARCH}"
  69. # the binaries
  70. dobin ${PN}2 psfgen flipbinpdb flipdcd
  71. }
  72. pkg_postinst() {
  73. echo
  74. einfo "For detailed instructions on how to run and configure"
  75. einfo "NAMD please consults the extensive documentation at"
  76. einfo "http://www.ks.uiuc.edu/Research/namd/"
  77. einfo "and the NAMD tutorials available at"
  78. einfo "http://www.ks.uiuc.edu/Training/Tutorials/"
  79. einfo "Have fun :)"
  80. echo
  81. }