/[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.5 - (hide annotations) (download)
Tue May 29 17:43:13 2012 UTC (4 years, 1 month ago) by jlec
Branch: MAIN
Changes since 1.4: +3 -6 lines
sci-libs/ccp4-libs: Drop la files

(Portage version: 2.2.0_alpha108/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20