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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (show annotations) (download)
Wed Feb 27 16:46:49 2013 UTC (16 months, 1 week ago) by jlec
Branch: MAIN
CVS Tags: HEAD
Changes since 1.9: +3 -1 lines
sci-libs/ccp4-libs: Use PKG_CONFIG instead of generic pkg-config

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

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

  ViewVC Help
Powered by ViewVC 1.1.20