Gentoo Archives: gentoo-commits

From: "Justin Lecher (jlec)" <jlec@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sci-chemistry/cns: cns-1.2.1-r4.ebuild ChangeLog
Date: Mon, 05 Apr 2010 21:15:37
Message-Id: 20100405211530.64BBA2C04A@corvid.gentoo.org
1 jlec 10/04/05 21:15:30
2
3 Modified: ChangeLog
4 Added: cns-1.2.1-r4.ebuild
5 Log:
6 Ifort support
7 (Portage version: 2.2_rc67/cvs/Linux x86_64)
8
9 Revision Changes Path
10 1.23 sci-chemistry/cns/ChangeLog
11
12 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-chemistry/cns/ChangeLog?rev=1.23&view=markup
13 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-chemistry/cns/ChangeLog?rev=1.23&content-type=text/plain
14 diff : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-chemistry/cns/ChangeLog?r1=1.22&r2=1.23
15
16 Index: ChangeLog
17 ===================================================================
18 RCS file: /var/cvsroot/gentoo-x86/sci-chemistry/cns/ChangeLog,v
19 retrieving revision 1.22
20 retrieving revision 1.23
21 diff -u -r1.22 -r1.23
22 --- ChangeLog 4 Apr 2010 07:08:14 -0000 1.22
23 +++ ChangeLog 5 Apr 2010 21:15:30 -0000 1.23
24 @@ -1,6 +1,12 @@
25 # ChangeLog for sci-chemistry/cns
26 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
27 -# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/cns/ChangeLog,v 1.22 2010/04/04 07:08:14 jlec Exp $
28 +# $Header: /var/cvsroot/gentoo-x86/sci-chemistry/cns/ChangeLog,v 1.23 2010/04/05 21:15:30 jlec Exp $
29 +
30 +*cns-1.2.1-r4 (05 Apr 2010)
31 +
32 + 05 Apr 2010; Justin Lecher <jlec@g.o> +files/1.2.1-ifort.patch,
33 + +cns-1.2.1-r4.ebuild:
34 + Ifort support
35
36 04 Apr 2010; Justin Lecher <jlec@g.o> Manifest:
37 distfile digest fix
38
39
40
41 1.1 sci-chemistry/cns/cns-1.2.1-r4.ebuild
42
43 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-chemistry/cns/cns-1.2.1-r4.ebuild?rev=1.1&view=markup
44 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-chemistry/cns/cns-1.2.1-r4.ebuild?rev=1.1&content-type=text/plain
45
46 Index: cns-1.2.1-r4.ebuild
47 ===================================================================
48 # Copyright 1999-2010 Gentoo Foundation
49 # Distributed under the terms of the GNU General Public License v2
50 # $Header: /var/cvsroot/gentoo-x86/sci-chemistry/cns/cns-1.2.1-r4.ebuild,v 1.1 2010/04/05 21:15:30 jlec Exp $
51
52 EAPI="3"
53
54 inherit eutils fortran toolchain-funcs versionator flag-o-matic
55
56 MY_PN="${PN}_solve"
57 MY_PV="$(delete_version_separator 2)"
58 MY_P="${MY_PN}_${MY_PV}"
59
60 DESCRIPTION="Crystallography and NMR System"
61 HOMEPAGE="http://cns.csb.yale.edu/"
62 SRC_URI="${MY_P}_all-mp.tar.gz
63 aria? ( aria2.3.1.tar.gz )"
64
65 SLOT="0"
66 LICENSE="cns"
67 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
68 IUSE="aria openmp"
69
70 RDEPEND="app-shells/tcsh
71 !app-text/dos2unix"
72 DEPEND="${RDEPEND}"
73 PDEPEND="aria? ( ~sci-chemistry/aria-2.3.1 )"
74
75 RESTRICT="fetch"
76 S="${WORKDIR}/${MY_P}"
77
78 FORTRAN="gfortran ifc"
79
80 pkg_nofetch() {
81 elog "Fill out the form at http://cns.csb.yale.edu/cns_request/"
82 use aria && elog "and http://aria.pasteur.fr/"
83 elog "and place these files:"
84 elog ${A}
85 elog "in ${DISTDIR}."
86 }
87
88 pkg_setup() {
89 fortran_pkg_setup
90
91 if [[ $(tc-getCC) == *gcc* ]] &&
92 ( [[ $(gcc-major-version)$(gcc-minor-version) -lt 42 ]] ||
93 ! built_with_use sys-devel/gcc openmp )
94 then
95 ewarn "You are using gcc and OpenMP is only available with gcc >= 4.2 "
96 ewarn "Switch CC to an OpenMP capable compiler"
97 fi
98 }
99
100 src_prepare() {
101 epatch "${FILESDIR}"/${PV}-gentoo.patch
102 epatch "${FILESDIR}"/${PV}-parallel.patch
103
104 if use aria; then
105 pushd "${WORKDIR}"/aria* >& /dev/null
106 # Update the cns sources in aria for version 1.2.1
107 epatch "${FILESDIR}"/1.2.1-aria2.3.patch
108
109 # Update the code with aria specific things
110 cp -rf cns/src/* "${S}"/source/
111 popd >& /dev/null
112 fi
113
114 # the code uses Intel-compiler-specific directives
115 if [[ ${FORTRANC} == gfortran ]]; then
116 epatch "${FILESDIR}"/${PV}-allow-gcc-openmp.patch
117 use openmp && \
118 OMPLIB="-lgomp" && append-flags -fopenmp
119 COMP="gfortran"
120 use amd64 && \
121 append-fflags -fdefault-integer-8
122 else
123 epatch "${FILESDIR}"/${PV}-ifort.patch
124 use openmp && OMPLIB="-lgomp" && \
125 append-flags -openmp && append-ldflags -openmp
126 COMP="ifort"
127 use amd64 && append-fflags -i8
128 append-fflags -Vaxlib
129 append-ldflags -Vaxlib
130 fi
131
132 use amd64 && \
133 append-cflags "-DINTEGER='long long int'"
134
135 # Set up location for the build directory
136 # Uses obsolete `sort` syntax, so we set _POSIX2_VERSION
137 cp "${FILESDIR}"/cns_solve_env_sh "${T}"/
138 sed -i \
139 -e "s:_CNSsolve_location_:${S}:g" \
140 -e "17 s:\(.*\):\1\nsetenv _POSIX2_VERSION 199209:g" \
141 "${S}"/cns_solve_env
142 sed -i \
143 -e "s:_CNSsolve_location_:${S}:g" \
144 -e "17 s:\(.*\):\1\nexport _POSIX2_VERSION; _POSIX2_VERSION=199209:g" \
145 "${T}"/cns_solve_env_sh
146
147 einfo "Fixing shebangs..."
148 find "${S}" -type f \
149 -exec sed "s:/bin/csh:${EPREFIX}/bin/csh:g" -i '{}' \; || die
150 }
151
152 src_compile() {
153 local GLOBALS
154 local MALIGN
155 if [[ ${FORTRANC} = g77 ]]; then
156 GLOBALS="-fno-globals"
157 MALIGN='\$(CNS_MALIGN_I86)'
158 fi
159
160 # Set up the compiler to use
161 pushd instlib/machine/unsupported/g77-unix 2>/dev/null
162 ln -s Makefile.header Makefile.header.${FORTRANC} || die
163 popd 2>/dev/null
164
165 # make install really means build, since it's expected to be used in-place
166 # -j1 doesn't mean we do no respect MAKEOPTS!
167 emake -j1 \
168 CC="$(tc-getCC)" \
169 F77="${FORTRANC}" \
170 LD="${FORTRANC}" \
171 CCFLAGS="${CFLAGS} -DCNS_ARCH_TYPE_\$(CNS_ARCH_TYPE) \$(EXT_CCFLAGS)" \
172 LDFLAGS="${LDFLAGS}" \
173 F77OPT="${FFLAGS:- -O2} ${MALIGN}" \
174 F77STD="${GLOBALS}" \
175 OMPLIB="${OMPLIB}" \
176 compiler="${COMP}" \
177 install \
178 || die "emake failed"
179
180 }
181
182 src_test() {
183 # We need to force on g77 manually, because we can't get aliases working
184 # when we source in a -c
185 einfo "Running tests ..."
186 sh -c \
187 "export CNS_G77=ON; source ${T}/cns_solve_env_sh; make run_tests" \
188 || die "tests failed"
189 einfo "Displaying test results ..."
190 cat "${S}"/*_g77/test/*.diff-test
191 }
192
193 src_install() {
194 # Install to locations resembling FHS
195 sed -i \
196 -e "s:${S}:usr:g" \
197 -e "s:^\(setenv CNS_SOLVE.*\):\1\nsetenv CNS_ROOT ${EPREFIX}/usr:g" \
198 -e "s:^\(setenv CNS_SOLVE.*\):\1\nsetenv CNS_DATA \$CNS_ROOT/share/cns:g" \
199 -e "s:^\(setenv CNS_SOLVE.*\):\1\nsetenv CNS_DOC \$CNS_ROOT/share/doc/${PF}:g" \
200 -e "s:CNS_LIB \$CNS_SOLVE/libraries:CNS_LIB \$CNS_DATA/libraries:g" \
201 -e "s:CNS_MODULE \$CNS_SOLVE/modules:CNS_MODULE \$CNS_DATA/modules:g" \
202 -e "s:CNS_HELPLIB \$CNS_SOLVE/helplib:CNS_HELPLIB \$CNS_DATA/helplib:g" \
203 -e "s:\$CNS_SOLVE/bin/cns_info:\$CNS_DATA/cns_info:g" \
204 "${S}"/cns_solve_env
205 # I don't entirely understand why the sh version requires a leading /
206 # for CNS_SOLVE and CNS_ROOT, but it does
207 sed -i \
208 -e "s:${S}:/usr:g" \
209 -e "s:^\(^[[:space:]]*CNS_SOLVE=.*\):\1\nexport CNS_ROOT=${EPREFIX}/usr:g" \
210 -e "s:^\(^[[:space:]]*CNS_SOLVE=.*\):\1\nexport CNS_DATA=\$CNS_ROOT/share/cns:g" \
211 -e "s:^\(^[[:space:]]*CNS_SOLVE=.*\):\1\nexport CNS_DOC=\$CNS_ROOT/share/doc/${PF}:g" \
212 -e "s:CNS_LIB=\$CNS_SOLVE/libraries:CNS_LIB=\$CNS_DATA/libraries:g" \
213 -e "s:CNS_MODULE=\$CNS_SOLVE/modules:CNS_MODULE=\$CNS_DATA/modules:g" \
214 -e "s:CNS_HELPLIB=\$CNS_SOLVE/helplib:CNS_HELPLIB=\$CNS_DATA/helplib:g" \
215 -e "s:\$CNS_SOLVE/bin/cns_info:\$CNS_DATA/cns_info:g" \
216 "${T}"/cns_solve_env_sh
217
218 # Get rid of setup stuff we don't need in the installed script
219 sed -i \
220 -e "83,$ d" \
221 -e "37,46 d" \
222 "${S}"/cns_solve_env
223 sed -i \
224 -e "84,$ d" \
225 -e "39,50 d" \
226 "${T}"/cns_solve_env_sh
227
228 newbin "${S}"/*linux*/bin/cns_solve* cns_solve \
229 || die "install cns_solve failed"
230
231 # Can be run by either cns_solve or cns
232 dosym cns_solve /usr/bin/cns
233
234 # Don't want to install this
235 rm -f "${S}"/*linux*/utils/Makefile
236
237 dobin "${S}"/*linux*/utils/* || die "install utils failed"
238
239 sed -i \
240 -e "s:\$CNS_SOLVE/doc/:\$CNS_SOLVE/share/doc/${PF}/:g" \
241 "${S}"/bin/cns_web || die
242
243 dobin "${S}"/bin/cns_{edit,header,transfer,web} || die "install bin failed"
244
245 insinto /usr/share/cns
246 doins -r "${S}"/libraries "${S}"/modules "${S}"/helplib || die
247 doins "${S}"/bin/cns_info || die
248
249 insinto /etc/profile.d
250 newins "${S}"/cns_solve_env cns_solve_env.csh || die
251 newins "${T}"/cns_solve_env_sh cns_solve_env.sh || die
252
253 dohtml \
254 -A iq,cgi,csh,cv,def,fm,gif,hkl,inp,jpeg,lib,link,list,mask,mtf,param,pdb,pdf,pl,ps,sc,sca,sdb,seq,tbl,top \
255 -f all_cns_info_template,omac,def \
256 -r doc/html/* || die
257 }
258
259 pkg_info() {
260 if use openmp; then
261 elog "Set OMP_NUM_THREADS to the number of threads you want."
262 elog "If you get segfaults on large structures, set the GOMP_STACKSIZE"
263 elog "variable if using gcc (16384 should be good)."
264 fi
265 }
266
267 pkg_postinst() {
268 pkg_info
269 }