/[gentoo-x86]/sci-libs/ccp4-libs/ccp4-libs-6.1.3-r16.ebuild
Gentoo

Contents of /sci-libs/ccp4-libs/ccp4-libs-6.1.3-r16.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Fri Jul 31 08:19:51 2015 UTC (4 years, 5 months ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +19 -16 lines
Allow lib only installation

(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key E9402A79B03529A2!)

1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sci-libs/ccp4-libs/ccp4-libs-6.1.3-r16.ebuild,v 1.5 2015/03/28 21:30:27 ago Exp $
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python2_7 )
8
9 inherit autotools eutils fortran-2 gnuconfig multilib python-single-r1 toolchain-funcs
10
11 SRC="ftp://ftp.ccp4.ac.uk/ccp4"
12
13 #UPDATE="04_03_09"
14 #PATCHDATE="090511"
15
16 MY_P="${P/-libs}"
17
18 PATCH_TOT="0"
19
20 DESCRIPTION="Protein X-ray crystallography toolkit - Libraries"
21 HOMEPAGE="http://www.ccp4.ac.uk/"
22 SRC_URI="${SRC}/${PV}/${MY_P}-core-src.tar.gz"
23 # patch tarball from upstream
24 [[ -n ${UPDATE} ]] && SRC_URI="${SRC_URI} ${SRC}/${PV}/updates/${P}-src-patch-${UPDATE}.tar.gz"
25 # patches created by us
26 [[ -n ${PATCHDATE} ]] && SRC_URI="${SRC_URI} http://dev.gentoo.org/~jlec/science-dist/${PV}-${PATCHDATE}-updates.patch.bz2"
27
28 for i in $(seq $PATCH_TOT); do
29 NAME="PATCH${i}[1]"
30 SRC_URI="${SRC_URI}
31 ${SRC}/${PV}/patches/${!NAME}"
32 done
33
34 LICENSE="ccp4"
35 SLOT="0"
36 KEYWORDS="amd64 ppc x86 ~amd64-linux ~x86-linux"
37 IUSE="minimal"
38
39 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
40
41 RDEPEND="
42 ${PYTHON_DEPS}
43 !<sci-chemistry/ccp4-6.1.3
44 !<sci-chemistry/ccp4-apps-${PV}-r10
45 app-shells/tcsh
46 dev-lang/tcl:0
47 >=sci-libs/cbflib-0.9.2.2
48 sci-libs/fftw:2.1
49 sci-libs/mmdb:0
50 sci-libs/monomer-db
51 sci-libs/ssm
52 virtual/jpeg:0=
53 virtual/lapack
54 virtual/blas"
55 DEPEND="${RDEPEND}
56 virtual/pkgconfig"
57
58 S="${WORKDIR}/${MY_P}"
59
60 MAKEOPTS+=" -j1"
61
62 pkg_setup() {
63 fortran-2_pkg_setup
64 python-single-r1_pkg_setup
65 }
66
67 src_prepare() {
68 tc-export PKG_CONFIG RANLIB AR
69
70 sed \
71 -e "/^AR/s:ar:$(tc-getAR):g" \
72 -i lib/src/Makefile.in src/Makefile.in src/ccp4mapwish_/Makefile.in lib/ccif/Makefile.in || die
73
74 einfo "Applying upstream patches ..."
75 for patch in $(seq $PATCH_TOT); do
76 base="PATCH${patch}"
77 dir=$(eval echo \${${base}[0]})
78 p=$(eval echo \${${base}[1]})
79 pushd "${dir}" >& /dev/null
80 ccp_patch "${DISTDIR}/${p}"
81 popd >& /dev/null
82 done
83 einfo "Done."
84 echo
85
86 [[ -n ${PATCHDATE} ]] && epatch "${WORKDIR}"/${PV}-${PATCHDATE}-updates.patch
87
88 einfo "Applying Gentoo patches ..."
89 # fix buffer overflows wrt bug 339706
90 ccp_patch "${FILESDIR}"/${PV}-overflows.patch
91
92 # it tries to create libdir, bindir etc on live system in configure
93 ccp_patch "${FILESDIR}"/${PV}-dont-make-dirs-in-configure.patch
94
95 # gerror_ gets defined twice on ppc if you're using gfortran/g95
96 ccp_patch "${FILESDIR}"/6.0.2-ppc-double-define-gerror.patch
97
98 # make creation of libccif.so smooth
99 ccp_patch "${FILESDIR}"/${PV}-ccif-shared.patch
100
101 # lets try to build libmmdb seperatly
102 ccp_patch "${FILESDIR}"/${PV}-dont-build-mmdb.patch
103
104 # unbundle libjpeg and cbflib
105 ccp_patch "${FILESDIR}"/${PV}-unbundle-libs-ng2.patch
106
107 # Fix missing DESTIDR
108 # not installing during build
109 ccp_patch "${FILESDIR}"/${PV}-noinstall.patch
110 sed \
111 -e '/SHARE_INST/s:$(libdir):$(DESTDIR)/$(libdir):g' \
112 -i configure || die
113
114 # Fix upstreams code
115 ccp_patch "${FILESDIR}"/${PV}-impl-dec.patch
116
117 # use pkg-config to detect BLAS/LAPACK
118 ccp_patch "${FILESDIR}"/${PV}-lapack.patch
119
120 # proto type changing in version 0.9.2.2
121 ccp_patch "${FILESDIR}"/${PV}-cbf.patch
122
123 # proto type changing in version 0.9.2.2
124 ccp_patch "${FILESDIR}"/${PV}-no-pypath.patch
125
126 ccp_patch "${FILESDIR}"/${P}-force.patch
127
128 ccp_patch "${FILESDIR}"/${P}-format-security.patch
129
130 einfo "Done." # done applying Gentoo patches
131 echo
132
133 # not needed, we have it extra
134 rm -rf src/rapper/{libxml2,gc7.0} || die
135
136 sed \
137 -e "s:/usr:${EPREFIX}/usr:g" \
138 -e 's:-Wl,-rpath,$CLIB::g' \
139 -e 's: -rpath $CLIB::g' \
140 -e 's: -I${srcdir}/include/cpp_c_headers::g' \
141 -e 's:sleep 1:sleep .2:g' \
142 -i configure || die
143
144 gnuconfig_update
145
146 for i in lib/DiffractionImage src/rapper src/pisa; do
147 pushd ${i} > /dev/null
148 sed 's:-g::g' -i configure* || die
149 [[ -f configure.in ]] && mv configure.{in,ac}
150 eautoreconf
151 popd > /dev/null
152 done
153
154 ## unbundle libssm
155 sed -e '/libdir/s:ssm::g' -i Makefile.in || die
156 find ./lib/src/mmdb ./lib/ssm ./lib/clipper ./lib/fftw lib/lapack -delete || die
157 }
158
159 src_configure() {
160 rm -rf lib/DiffractionImage/{jpg,CBFlib} || die
161
162 # Build system is broken if we set LDFLAGS
163 userldflags="${LDFLAGS}"
164 export SHARED_LIB_FLAGS="${LDFLAGS}"
165 unset LDFLAGS
166
167 # GENTOO_OSNAME can be one of:
168 # irix irix64 sunos sunos64 aix hpux osf1 linux freebsd
169 # linux_compaq_compilers linux_intel_compilers generic Darwin
170 # ia64_linux_intel Darwin_ibm_compilers linux_ibm_compilers
171 if [[ "$(tc-getFC)" = "ifort" ]]; then
172 if use ia64; then
173 GENTOO_OSNAME="ia64_linux_intel"
174 else
175 # Should be valid for x86, maybe amd64
176 GENTOO_OSNAME="linux_intel_compilers"
177 fi
178 else
179 # Should be valid for x86 and amd64, at least
180 GENTOO_OSNAME="linux"
181 fi
182
183 # Sets up env
184 ln -s \
185 ccp4.setup-bash \
186 "${S}"/include/ccp4.setup || die
187
188 # We agree to the license by emerging this, set in LICENSE
189 sed -i \
190 -e "s~^\(^agreed=\).*~\1yes~g" \
191 "${S}"/configure || die
192
193 # Fix up variables -- need to reset CCP4_MASTER at install-time
194 sed -i \
195 -e "s~^\(setenv CCP4_MASTER.*\)/.*~\1${WORKDIR}~g" \
196 -e "s~^\(export CCP4_MASTER.*\)/.*~\1${WORKDIR}~g" \
197 -e "s~^\(.*export CBIN=.*\)\$CCP4.*~\1\$CCP4/libexec/ccp4/bin/~g" \
198 -e "s~^\(.*setenv CBIN .*\)\$CCP4.*~\1\$CCP4/libexec/ccp4/bin/~g" \
199 -e "s~^\(setenv CCP4I_TCLTK.*\)/usr/local/bin~\1${EPREFIX}/usr/bin~g" \
200 "${S}"/include/ccp4.setup* || die
201
202 # Set up variables for build
203 source "${S}"/include/ccp4.setup-sh
204
205 export CC=$(tc-getCC)
206 export CXX=$(tc-getCXX)
207 export COPTIM=${CFLAGS}
208 export CXXOPTIM=${CXXFLAGS}
209 # Default to -O2 if FFLAGS is unset
210 export FC=$(tc-getFC)
211 export FOPTIM=${FFLAGS:- -O2}
212
213 export SHARE_LIB="\
214 $(tc-getCC) ${userldflags} -shared -Wl,-soname,libccp4c.so -o libccp4c.so \${CORELIBOBJS} \${CGENERALOBJS} \${CUCOBJS} \${CMTZOBJS} \${CMAPOBJS} \${CSYMOBJS} -L../ccif/ -lccif $(gcc-config -L | awk -F: '{for(i=1; i<=NF; i++) printf " -L%s", $i}') -lm && \
215 $(tc-getFC) ${userldflags} -shared -Wl,-soname,libccp4f.so -o libccp4f.so \${FORTRANLOBJS} \${FINTERFACEOBJS} -L../ccif/ -lccif -L. -lccp4c $($(tc-getPKG_CONFIG) --libs mmdb) $(gcc-config -L | awk -F: '{for(i=1; i<=NF; i++) printf " -L%s", $i}') -lstdc++ -lgfortran -lm"
216
217 # Can't use econf, configure rejects unknown options like --prefix
218 ./configure \
219 --onlylibs \
220 --with-shared-libs \
221 --with-fftw="${EPREFIX}/usr" \
222 --with-warnings \
223 --disable-cctbx \
224 --disable-clipper \
225 --disable-ssm \
226 --tmpdir="${TMPDIR}" \
227 --bindir="${EPREFIX}/usr/libexec/ccp4/bin/" \
228 --libdir="${EPREFIX}/usr/$(get_libdir)" \
229 ${GENTOO_OSNAME} || die "configure failed"
230 }
231
232 src_compile() {
233 emake DESTDIR="${D}" onlylib
234 }
235
236 src_install() {
237 # Set up variables for build
238 source "${S}"/include/ccp4.setup-sh
239
240 emake \
241 DESTDIR="${D}" \
242 includedir="${EPREFIX}/usr/include" \
243 library_includedir="${EPREFIX}/usr/include" \
244 install
245
246 sed \
247 -e "330,1000d" \
248 -i "${S}"/include/ccp4.setup-sh || die
249
250 sed \
251 -e "378,1000d" \
252 -i "${S}"/include/ccp4.setup-csh || die
253
254 sed \
255 -e "s:-${PV/-r*/}::g" \
256 -e "s:^\(.*export CCP4_MASTER=\).*:\1${EPREFIX}/usr:g" \
257 -e "s:^\(.*setenv CCP4_MASTER\).*:\1 ${EPREFIX}/usr:g" \
258 -e "s:^\(.*export CCP4=\).*CCP4_MASTER.*:\1${EPREFIX}/usr:g" \
259 -e "s:^\(.*setenv CCP4\).*CCP4_MASTER.*:\1 ${EPREFIX}/usr:g" \
260 -e "s:^\(.*export CCP4_SCR=\).*:\1${EPREFIX}/tmp:g" \
261 -e "s:^\(.*setenv CCP4_SCR \).*:\1${EPREFIX}/tmp:g" \
262 -e "s:^\(.*export BINSORT_SCR=\).*:\1${EPREFIX}/tmp:g" \
263 -e "s:^\(.*setenv BINSORT_SCR \).*:\1${EPREFIX}/tmp:g" \
264 -e "s:^\(.*export CCP4I_TOP=\).*:\1${EPREFIX}/usr/$(get_libdir)/ccp4/ccp4i:g" \
265 -e "s:^\(.*setenv CCP4I_TOP \).*:\1${EPREFIX}/usr/$(get_libdir)/ccp4/ccp4i:g" \
266 -e "s:^\(.*export CCP4I_TCLTK=\).*:\1${EPREFIX}/usr/bin:g" \
267 -e "s:^\(.*setenv CCP4I_TCLTK \).*:\1${EPREFIX}/usr/bin:g" \
268 -e "s:^\(.*export CCP4I_HELP=\).*:\1${EPREFIX}/usr/$(get_libdir)/ccp4/ccp4i/help:g" \
269 -e "s:^\(.*setenv CCP4I_HELP \).*:\1${EPREFIX}/usr/$(get_libdir)/ccp4/ccp4i/help:g" \
270 -e "s:^\(.*export CBIN=\).*:\1${EPREFIX}/usr/libexec/ccp4/bin:g" \
271 -e "s:^\(.*setenv CBIN \).*:\1${EPREFIX}/usr/libexec/ccp4/bin:g" \
272 -e "s:^\(.*export CCP4_BIN=\).*:\1${EPREFIX}/usr/libexec/ccp4/bin:g" \
273 -e "s:^\(.*setenv CCP4_BIN \).*:\1${EPREFIX}/usr/libexec/ccp4/bin:g" \
274 -e "s:^\(.*export CLIBD_MON=\).*:\1${EPREFIX}/usr/share/ccp4/data/monomers/:g" \
275 -e "s:^\(.*setenv CLIBD_MON \).*:\1${EPREFIX}/usr/share/ccp4/data/monomers/:g" \
276 -e "s:^\(.*export CLIBD=\).*:\1${EPREFIX}/usr/share/ccp4/data:g" \
277 -e "s:^\(.*setenv CLIBD \).*:\1${EPREFIX}/usr/share/ccp4/data:g" \
278 -e "s:^\(.*export CCP4_LIB=\).*:\1${EPREFIX}/usr/$(get_libdir):g" \
279 -e "s:^\(.*setenv CCP4_LIB \).*:\1${EPREFIX}/usr/$(get_libdir):g" \
280 -e "s:^\(.*export CCP4_BROWSER=\).*:\1firefox:g" \
281 -e "s:^\(.*setenv CCP4_BROWSER \).*:\1firefox:g" \
282 -e "s:^\(.*export MANPATH=\).*:\1\${MANPATH}:g" \
283 -e "s:^\(.*setenv MANPATH \).*:\1\${MANPATH}:g" \
284 -e "s:^\(.*export DBCCP4I_TOP=\).*:\1${EPREFIX}/usr/share/ccp4/dbccp4i:g" \
285 -e "s:^\(.*setenv DBCCP4I_TOP \).*:\1${EPREFIX}/usr/share/ccp4/dbccp4i:g" \
286 -e "s:^\(.*export MOLREPLIB=\).*:\1${EPREFIX}/usr/share/ccp4/data/monomers/:g" \
287 -e "s:^\(.*setenv MOLREPLIB \).*:\1${EPREFIX}/usr/share/ccp4/data/monomers/:g" \
288 -e "s:^\(.*export CDOC=\).*:\1${EPREFIX}/usr/share/doc:g" \
289 -e "s:^\(.*setenv CDOC \).*:\1${EPREFIX}/usr/share/doc:g" \
290 -e "s:^\(.*export CEXAM=\).*:\1${EPREFIX}/usr/share/doc/examples:g" \
291 -e "s:^\(.*setenv CEXAM \).*:\1${EPREFIX}/usr/share/doc/examples:g" \
292 -e "s:^\(.*export CINCL=\).*:\1${EPREFIX}/usr/share/ccp4/include:g" \
293 -e "s:^\(.*setenv CINCL \).*:\1${EPREFIX}/usr/share/ccp4/include:g" \
294 -e "s:\$CLIB/font84.dat:\"${EPREFIX}/usr/$(get_libdir)/font84.dat\":g" \
295 -e "s:\$CLIB/cif_mmdic.lib:\"${EPREFIX}/usr/$(get_libdir)/cif_mmdic.lib\":g" \
296 -e '/# .*LD_LIBRARY_PATH specifies/,/^$/d' \
297 -e '/CLIB=/d' \
298 -e '/CLIB /d' \
299 -e '/CLIBS=/d' \
300 -e '/CLIBS /d' \
301 -e "/alias/d" \
302 -e "/CCP4_HELPDIR/d" \
303 -e "/IMOSFLM_VERSION/d" \
304 -i "${S}"/include/ccp4.setup* || die
305
306 # Don't check for updates on every sourcing of /etc/profile
307 sed -i \
308 -e "s:\(eval python.*\):#\1:g" \
309 "${S}"/include/ccp4.setup* || die
310
311 # Libs
312 for file in "${S}"/lib/*; do
313 if [[ -d ${file} ]]; then
314 continue
315 elif [[ -x ${file} ]]; then
316 dolib.so ${file}
317 else
318 insinto /usr/$(get_libdir)
319 doins ${file}
320 fi
321 done
322
323 prune_libtool_files
324
325 sed \
326 -e 's:test "LD_LIBRARY_PATH":test "$LD_LIBRARY_PATH":g' \
327 -i "${S}"/include/ccp4.setup-sh || die
328
329 if ! use minimal; then
330 # Setup scripts
331 insinto /etc/profile.d
332 newins "${S}"/include/ccp4.setup-csh 40ccp4.setup.csh
333 newins "${S}"/include/ccp4.setup-sh 40ccp4.setup.sh
334
335 # Data
336 insinto /usr/share/ccp4/data/
337 doins -r "${S}"/lib/data/{*.PARM,*.prt,*.lib,*.dic,*.idl,*.cif,*.resource,*.york,*.hist,fraglib,reference_structures}
338
339 # Environment files, setup scripts, etc.
340 rm -rf "${S}"/include/{ccp4.setup*,COPYING,cpp_c_headers} || die
341 insinto /usr/share/ccp4/
342 doins -r "${S}"/include
343 fi
344
345 rm -f "${S}"/include/ccp4.setup* || die
346
347 dodoc "${S}"/lib/data/*.doc
348 newdoc "${S}"/lib/data/README DATA-README
349 }
350
351 pkg_postinst() {
352 einfo "The Web browser defaults to firefox. Change CCP4_BROWSER"
353 einfo "in ${EPREFIX}/etc/profile.d/40ccp4.setup* to modify this."
354 }
355
356 # Epatch wrapper for bulk patching
357 ccp_patch() {
358 EPATCH_SINGLE_MSG=" ${1##*/} ..." epatch ${1}
359 }

  ViewVC Help
Powered by ViewVC 1.1.20