/[gentoo-x86]/sci-chemistry/tinker/tinker-6.ebuild
Gentoo

Contents of /sci-chemistry/tinker/tinker-6.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Fri Oct 19 10:30:49 2012 UTC (2 years, 10 months ago) by jlec
Branch: MAIN
Changes since 1.5: +3 -4 lines
sci-chemistry/tinker: Remove virtual/fortran and always call fortran-2_pkg_setup as intend by the updated fortran-2.eclass

(Portage version: 2.2.0_alpha141/cvs/Linux x86_64, signed Manifest commit with key 70EB7916)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-chemistry/tinker/tinker-6.ebuild,v 1.5 2011/06/21 15:55:41 jlec Exp $
4
5 EAPI=2
6
7 inherit eutils flag-o-matic fortran-2 java-pkg-opt-2 toolchain-funcs
8
9 DESCRIPTION="Molecular modeling package that includes force fields, such as AMBER and CHARMM"
10 HOMEPAGE="http://dasher.wustl.edu/tinker/"
11 SRC_URI="http://dasher.wustl.edu/${PN}/downloads/${P}.tar.gz"
12
13 SLOT="0"
14 LICENSE="Tinker"
15 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
16 IUSE="examples"
17
18 DEPEND="
19 >=virtual/jdk-1.6"
20 RDEPEND="
21 >=sci-libs/fftw-3.2.2-r1[fortran,threads]
22 dev-libs/maloc
23 !dev-util/diffuse
24 >=virtual/jre-1.6"
25
26 RESTRICT="mirror"
27
28 S="${WORKDIR}"/${PN}${PV}/source
29
30 pkg_setup() {
31 fortran-2_pkg_setup
32 java-pkg-opt-2_pkg_setup
33 tc-has-openmp || die "Please use an openmp capable compiler like gcc[openmp]"
34 }
35
36 src_prepare() {
37 sed 's:strip:true:g' -i ../make/Makefile
38 [[ $(tc-getFC) =~ "ifort" ]] || epatch "${FILESDIR}"/${PV}-openmp.patch
39 }
40
41 src_compile() {
42 local javalib=
43 for i in $(java-config -g LDPATH | sed 's|:| |g'); do
44 [[ -f ${i}/libjvm.so ]] && javalib=${i}
45 done
46
47 # use dummy routines in pmpb.f instead of apbs calls
48 rm pmpb.c || die
49
50 if [[ $(tc-getFC) =~ "gfortran" ]]; then
51 append-flags -fopenmp
52 _omplib="-lgomp"
53 else
54 append-flags -openmp
55 _omplib="-liomp5"
56 fi
57
58 _fftwlib="$(pkg-config --libs fftw3 fftw3_threads)"
59
60 emake \
61 -f ../make/Makefile \
62 F77="$(tc-getFC)" \
63 CC="$(tc-getCC) -c" \
64 F77FLAGS=-c \
65 OPTFLAGS="${FFLAGS}" \
66 LINKFLAGS="${LDFLAGS} -Wl,-rpath ${javalib}" \
67 INCLUDEDIR="$(java-pkg_get-jni-cflags) -I${EPREFIX}/usr/include" \
68 LIBS="-lmaloc -L${javalib} -ljvm ${_omplib} ${_fftwlib}" \
69 all || die
70
71 mkdir "${S}"/../bin || die
72
73 emake \
74 -f ../make/Makefile \
75 BINDIR="${S}"/../bin \
76 rename || die
77 }
78
79 src_test() {
80 cd "${WORKDIR}"/${PN}${PV}/test/
81 for test in *.run; do
82 einfo "Testing ${test} ..."
83 bash ${test} || die
84 done
85 }
86
87 src_install() {
88 dobin "${WORKDIR}"/${PN}${PV}/perl/mdavg "${WORKDIR}"/${PN}${PV}/bin/* || die
89
90 insinto /usr/share/${PN}/
91 doins -r "${WORKDIR}"/${PN}${PV}/params || die
92
93 dodoc \
94 "${WORKDIR}"/${PN}${PV}/doc/{*.txt,announce/release-*,*.pdf,0README} || die
95
96 if use examples; then
97 insinto /usr/share/${P}
98 doins -r "${WORKDIR}"/${PN}${PV}/example || die
99
100 doins -r "${WORKDIR}"/${PN}${PV}/test || die
101 fi
102
103 }

  ViewVC Help
Powered by ViewVC 1.1.20