Gentoo Archives: gentoo-commits

From: Alexey Shvetsov <alexxy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-chemistry/ambertools/
Date: Thu, 28 Jul 2011 12:03:21
Message-Id: af2d23a6e79abd8092230d1045f9f689a776589b.alexxy@gentoo
1 commit: af2d23a6e79abd8092230d1045f9f689a776589b
2 Author: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jul 28 12:02:48 2011 +0000
4 Commit: Alexey Shvetsov <alexxy <AT> gentoo <DOT> org>
5 CommitDate: Thu Jul 28 12:02:48 2011 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=af2d23a6
7
8 [sci-chemistry/ambertools] Updates for ambertools and gcc-4.6
9
10 (Portage version: 2.2.0_alpha47/git/Linux x86_64, signed Manifest commit with key F82F92E6)
11
12 ---
13 sci-chemistry/ambertools/ambertools-1.5-r1.ebuild | 140 +++++++++++++++++++++
14 1 files changed, 140 insertions(+), 0 deletions(-)
15
16 diff --git a/sci-chemistry/ambertools/ambertools-1.5-r1.ebuild b/sci-chemistry/ambertools/ambertools-1.5-r1.ebuild
17 new file mode 100644
18 index 0000000..bebe615
19 --- /dev/null
20 +++ b/sci-chemistry/ambertools/ambertools-1.5-r1.ebuild
21 @@ -0,0 +1,140 @@
22 +# Copyright 1999-2011 Gentoo Foundation
23 +# Distributed under the terms of the GNU General Public License v2
24 +# $Header: $
25 +
26 +EAPI=4
27 +
28 +inherit eutils fortran-2 toolchain-funcs
29 +
30 +DESCRIPTION="A suite for carrying out complete molecular mechanics investigations"
31 +HOMEPAGE="http://ambermd.org/#AmberTools"
32 +SRC_URI="
33 + AmberTools-${PV}.tar.bz2
34 + mirror://gentoo/${P}-bugfix_1-10.patch.xz"
35 +
36 +LICENSE="GPL-2"
37 +SLOT="0"
38 +KEYWORDS="~amd64 ~x86"
39 +IUSE="mpi openmp X"
40 +
41 +RESTRICT="fetch"
42 +
43 +RDEPEND="
44 + virtual/cblas
45 + virtual/lapack
46 + sci-libs/clapack
47 + sci-libs/arpack
48 + sci-libs/cifparse-obj
49 + sci-chemistry/mopac7
50 + sci-libs/netcdf
51 + sci-libs/fftw:2.1
52 + sci-chemistry/reduce
53 + virtual/fortran"
54 +DEPEND="${RDEPEND}
55 + dev-util/byacc
56 + dev-libs/libf2c
57 + sys-devel/ucpp"
58 +S="${WORKDIR}/amber11"
59 +
60 +pkg_nofetch() {
61 + einfo "Go to ${HOMEPAGE} and get ${A}"
62 + einfo "Place it in ${DISTDIR}"
63 +}
64 +
65 +pkg_setup() {
66 + fortran-2_pkg_setup
67 + if use openmp; then
68 + tc-has-openmp || \
69 + die "Please select an openmp capable compiler like gcc[openmp]"
70 + fi
71 + AMBERHOME="${S}"
72 +}
73 +
74 +src_prepare() {
75 + epatch \
76 + "${WORKDIR}/${P}-bugfix_1-3.patch" \
77 + "${FILESDIR}/${P}-gentoo.patch"
78 + cd AmberTools/src
79 + rm -r arpack blas lapack fftw-2.1.5 c9x-complex cifparse netcdf pnetcdf reduce ucpp-1.3 || die
80 +}
81 +
82 +src_configure() {
83 + cd AmberTools/src
84 + sed -e "s:\\\\\$(LIBDIR)/arpack.a:-larpack:g" \
85 + -e "s:\\\\\$(LIBDIR)/lapack.a:$(pkg-config lapack --libs) -lclapack:g" \
86 + -e "s:\\\\\$(LIBDIR)/blas.a:$(pkg-config blas cblas --libs):g" \
87 + -e "s:\\\\\$(LIBDIR)/libdrfftw.a:${EPREFIX}/usr/$(get_libdir)/libdrfftw.a:g" \
88 + -e "s:\\\\\$(LIBDIR)/libdfftw.a:${EPREFIX}/usr/$(get_libdir)/libdrfftw.a:g" \
89 + -e "s:CFLAGS=:CFLAGS=${CFLAGS} -DBINTRAJ :g" \
90 + -e "s:FFLAGS=:FFLAGS=${FFLAGS} :g" \
91 + -e "s:LDFLAGS=$ldflags:LDFLAGS=${LDFLAGS}:g" \
92 + -e "s:fc=g77:fc=$(tc-getFC):g" \
93 + -e "s:\$netcdflib:$(pkg-config netcdf --libs):g" \
94 + -e "s:NETCDF=\$netcdf:NETCDF=netcdf.mod:g" \
95 + -e "s:-O3::g" \
96 + -i configure || die
97 + sed -e "s:arsecond_:arscnd_:g" \
98 + -i sff/time.c \
99 + -i sff/sff.h \
100 + -i sff/sff.c || die
101 + sed -e "s:\$(NAB):\$(NAB) -lrfftw:g" \
102 + -i nss/Makefile || die
103 +
104 + local myconf
105 +
106 + use X || myconf="${myconf} -noX11"
107 +
108 + for x in mpi openmp; do
109 + use ${x} && myconf="${myconf} -${x}"
110 + done
111 +
112 + ./configure \
113 + ${myconf} \
114 + -nobintraj \
115 + -nomdgx \
116 + -nopython \
117 + -nomtkpp \
118 + gnu
119 +# $(expr match "$(tc-getCC)" '.*\([a-z]cc\)')
120 +}
121 +
122 +src_compile() {
123 + cd AmberTools/src
124 + emake || die
125 +}
126 +
127 +src_install() {
128 + rm -r bin/chemistry bin/MMPBSA_mods
129 + rm bin/ante-MMPBSA.py bin/extractFrcmod.py
130 + for x in bin/*
131 + do dobin ${x} || die
132 + done
133 + rm "${ED}/usr/bin/yacc"
134 + dobin AmberTools/src/antechamber/mopac.sh
135 + sed -e "s:\$AMBERHOME/bin/mopac:mopac7:g" \
136 + -i "${ED}/usr/bin/mopac.sh" || die
137 + # Make symlinks untill binpath for amber will be fixed
138 + dodir /usr/share/${PN}/bin
139 + cd "${ED}/usr/bin"
140 + for x in *
141 + do dosym /usr/bin/${x} /usr/share/${PN}/bin/${x}
142 + done
143 + cd "${S}"
144 +# sed -e "s:\$AMBERHOME/dat:\$AMBERHOME/share/ambertools/dat:g" \
145 +# -i "${ED}/usr/bin/xleap" \
146 +# -i "${ED}/usr/bin/tleap" || die
147 + dodoc doc/AmberTools.pdf doc/leap_pg.pdf
148 + dolib.a lib/*
149 + insinto /usr/include/${PN}
150 + doins include/*
151 + insinto /usr/share/${PN}
152 + doins -r dat
153 + cd AmberTools
154 + doins -r benchmarks
155 + doins -r examples
156 + doins -r test
157 + cat >> "${T}"/99ambertools <<- EOF
158 + AMBERHOME="${EPREFIX}/usr/share/ambertools"
159 + EOF
160 + doenvd "${T}"/99ambertools
161 +}