Gentoo Archives: gentoo-commits

From: "Sebastien Fabbro (bicatali)" <bicatali@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sci-physics/root: ChangeLog root-5.32.02-r1.ebuild root-5.28.00h-r1.ebuild root-5.28.00h.ebuild root-5.32.01-r2.ebuild
Date: Tue, 03 Apr 2012 16:03:03
Message-Id: 20120403160252.447942004B@flycatcher.gentoo.org
1 bicatali 12/04/03 16:02:52
2
3 Modified: ChangeLog
4 Added: root-5.32.02-r1.ebuild root-5.28.00h-r1.ebuild
5 Removed: root-5.28.00h.ebuild root-5.32.01-r2.ebuild
6 Log:
7 Import from the sci overlay
8
9 (Portage version: 2.1.10.44/cvs/Linux x86_64)
10
11 Revision Changes Path
12 1.97 sci-physics/root/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-physics/root/ChangeLog?rev=1.97&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-physics/root/ChangeLog?rev=1.97&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-physics/root/ChangeLog?r1=1.96&r2=1.97
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/sci-physics/root/ChangeLog,v
21 retrieving revision 1.96
22 retrieving revision 1.97
23 diff -u -r1.96 -r1.97
24 --- ChangeLog 29 Mar 2012 18:21:49 -0000 1.96
25 +++ ChangeLog 3 Apr 2012 16:02:52 -0000 1.97
26 @@ -1,6 +1,26 @@
27 # ChangeLog for sci-physics/root
28 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/sci-physics/root/ChangeLog,v 1.96 2012/03/29 18:21:49 bicatali Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/sci-physics/root/ChangeLog,v 1.97 2012/04/03 16:02:52 bicatali Exp $
31 +
32 + 03 Apr 2012; Sébastien Fabbro <bicatali@g.o> -root-5.28.00h.ebuild,
33 + +root-5.28.00h-r1.ebuild, -root-5.32.01-r2.ebuild, +root-5.32.02-r1.ebuild:
34 + Import from the sci overlay
35 +
36 +*root-5.32.02-r1 (03 Apr 2012)
37 +*root-5.28.00h-r1 (03 Apr 2012)
38 +
39 + 03 Apr 2012; Andrew Savchenko <bircoph@×××××.com> -root-5.28.00h.ebuild,
40 + +root-5.28.00h-r1.ebuild, -root-5.32.02.ebuild, +root-5.32.02-r1.ebuild,
41 + root-9999.ebuild:
42 + Force format library dependencies on libafterimage and afterstep.
43 + This fixes bug 408987. Port to other versions, 5.26 branch is not
44 + affected.
45 +
46 +*root-5.32.02 (02 Apr 2012)
47 +
48 + 02 Apr 2012; Andrew Savchenko <bircoph@×××××.com> -root-5.32.01-r2.ebuild,
49 + +root-5.32.02.ebuild:
50 + Version bump for a new patch release.
51
52 29 Mar 2012; Sébastien Fabbro <bicatali@g.o>
53 +files/root-5.32.00-chklib64.patch, root-5.32.01-r2.ebuild:
54
55
56
57 1.1 sci-physics/root/root-5.32.02-r1.ebuild
58
59 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-physics/root/root-5.32.02-r1.ebuild?rev=1.1&view=markup
60 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-physics/root/root-5.32.02-r1.ebuild?rev=1.1&content-type=text/plain
61
62 Index: root-5.32.02-r1.ebuild
63 ===================================================================
64 # Copyright 1999-2012 Gentoo Foundation
65 # Distributed under the terms of the GNU General Public License v2
66 # $Header: /var/cvsroot/gentoo-x86/sci-physics/root/root-5.32.02-r1.ebuild,v 1.1 2012/04/03 16:02:52 bicatali Exp $
67
68 EAPI=4
69 PYTHON_DEPEND="python? 2"
70 inherit elisp-common eutils fdo-mime fortran-2 python toolchain-funcs
71
72 DOC_PV=5_26
73 ROOFIT_DOC_PV=2.91-33
74 TMVA_DOC_PV=4.03
75 PATCH_PV=5.28.00b
76 PATCH_PV2=5.32.00
77
78 DESCRIPTION="C++ data analysis framework and interpreter from CERN"
79 HOMEPAGE="http://root.cern.ch/"
80 SRC_URI="ftp://root.cern.ch/${PN}/${PN}_v${PV}.source.tar.gz
81 doc? ( ftp://root.cern.ch/${PN}/doc/Users_Guide_${DOC_PV}.pdf
82 math? (
83 ftp://root.cern.ch/${PN}/doc/RooFit_Users_Manual_${ROOFIT_DOC_PV}.pdf
84 http://tmva.sourceforge.net/docu/TMVAUsersGuide.pdf -> TMVAUsersGuide-v${TMVA_DOC_PV}.pdf ) )"
85
86 SLOT="0"
87 LICENSE="LGPL-2.1"
88 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
89 IUSE="+X afs avahi clarens doc emacs examples fits fftw graphviz kerberos ldap
90 +math mpi mysql odbc +opengl openmp oracle postgres prefix
91 pythia6 pythia8 python qt4 +reflex ruby ssl xft xinetd xml xrootd"
92
93 CDEPEND="
94 app-arch/xz-utils
95 >=dev-lang/cfortran-4.4-r2
96 dev-libs/libpcre
97 media-libs/freetype
98 media-libs/giflib
99 media-libs/libpng:0
100 media-libs/tiff:0
101 sys-libs/zlib
102 virtual/jpeg
103 virtual/shadow
104 X? (
105 media-libs/ftgl
106 media-libs/glew
107 x11-libs/libX11
108 x11-libs/libXext
109 x11-libs/libXpm
110 || (
111 >=media-libs/libafterimage-1.20[gif,jpeg,png,tiff]
112 >=x11-wm/afterstep-2.2.11[gif,jpeg,png,tiff]
113 )
114 opengl? ( virtual/opengl virtual/glu x11-libs/gl2ps )
115 qt4? (
116 x11-libs/qt-gui:4
117 x11-libs/qt-opengl:4
118 x11-libs/qt-qt3support:4
119 x11-libs/qt-svg:4
120 x11-libs/qt-webkit:4
121 x11-libs/qt-xmlpatterns:4 )
122 xft? ( x11-libs/libXft )
123 )
124 afs? ( net-fs/openafs )
125 avahi? ( net-dns/avahi )
126 clarens? ( dev-libs/xmlrpc-c[curl] )
127 emacs? ( virtual/emacs )
128 fits? ( sci-libs/cfitsio )
129 fftw? ( sci-libs/fftw:3.0 )
130 graphviz? ( media-gfx/graphviz )
131 kerberos? ( virtual/krb5 )
132 ldap? ( net-nds/openldap )
133 math? ( sci-libs/gsl sci-mathematics/unuran mpi? ( virtual/mpi ) )
134 mysql? ( virtual/mysql )
135 odbc? ( || ( dev-db/libiodbc dev-db/unixODBC ) )
136 oracle? ( dev-db/oracle-instantclient-basic )
137 postgres? ( dev-db/postgresql-base )
138 pythia6? ( sci-physics/pythia:6 )
139 pythia8? ( sci-physics/pythia:8 )
140 ruby? (
141 dev-lang/ruby
142 dev-ruby/rubygems )
143 ssl? ( dev-libs/openssl )
144 xml? ( dev-libs/libxml2 )
145 xrootd? ( net-libs/xrootd )"
146
147 DEPEND="${CDEPEND}
148 dev-util/pkgconfig"
149
150 RDEPEND="
151 virtual/fortran
152 ${CDEPEND}
153 reflex? ( dev-cpp/gccxml )
154 xinetd? ( sys-apps/xinetd )"
155
156 REQUIRED_USE="!X? ( !opengl !qt4 !xft )"
157
158 S="${WORKDIR}/${PN}"
159
160 pkg_setup() {
161 fortran-2_pkg_setup
162 python_pkg_setup
163 echo
164 elog "There are extra options on packages not yet in Gentoo:"
165 elog "AliEn, castor, Chirp, dCache, gfal, gLite, Globus,"
166 elog "HDFS, Monalisa, MaxDB/SapDB, SRP."
167 elog "You can use the env variable EXTRA_ECONF variable for this."
168 elog "For example, for SRP, you would set: "
169 elog "EXTRA_ECONF=\"--enable-srp --with-srp-libdir=/usr/$(get_libdir)\""
170 echo
171 enewgroup rootd
172 enewuser rootd -1 -1 /var/spool/rootd rootd
173
174 if use math; then
175 if use openmp && [[ $(tc-getCC)$ == *gcc* ]] && ! tc-has-openmp; then
176 ewarn "You are using gcc and OpenMP is available with gcc >= 4.2"
177 ewarn "If you want to build this package with OpenMP, abort now,"
178 ewarn "and set CC to an OpenMP capable compiler"
179 elif use openmp; then
180 export USE_OPENMP=1 USE_PARALLEL_MINUIT2=1
181 elif use mpi; then
182 export USE_MPI=1 USE_PARALLEL_MINUIT2=1
183 fi
184 fi
185 }
186
187 src_prepare() {
188 epatch \
189 "${FILESDIR}"/${PN}-${PATCH_PV}-prop-ldflags.patch \
190 "${FILESDIR}"/${PN}-${PATCH_PV}-asneeded.patch \
191 "${FILESDIR}"/${PN}-${PATCH_PV2}-nobyte-compile.patch \
192 "${FILESDIR}"/${PN}-${PATCH_PV}-glibc212.patch \
193 "${FILESDIR}"/${PN}-${PATCH_PV}-unuran.patch \
194 "${FILESDIR}"/${PN}-${PATCH_PV2}-afs.patch \
195 "${FILESDIR}"/${PN}-${PATCH_PV2}-cfitsio.patch \
196 "${FILESDIR}"/${PN}-${PATCH_PV2}-chklib64.patch \
197 "${FILESDIR}"/${PN}-${PATCH_PV2}-explicit-functions.patch
198
199 # make sure we use system libs and headers
200 rm montecarlo/eg/inc/cfortran.h README/cfortran.doc
201 rm -rf graf2d/asimage/src/libAfterImage
202 rm -rf graf3d/ftgl/{inc,src}
203 rm -rf graf2d/freetype/src
204 rm -rf graf3d/glew/{inc,src}
205 rm -rf core/pcre/src
206 rm -rf math/unuran/src/unuran-*.tar.gz
207 LANG=C LC_ALL=C find core/zip -type f -name "[a-z]*" | xargs rm
208 rm -rf core/lzma/src/*.tar.gz
209 rm graf3d/gl/{inc,src}/gl2ps.*
210 sed -i -e 's/^GLLIBS *:= .* $(OPENGLLIB)/& -lgl2ps/' graf3d/gl/Module.mk
211
212 # In Gentoo, libPythia6 is called libpythia6
213 # libungif is called libgif,
214 # iodbc is in /usr/include/iodbc
215 # pg_config.h is checked instead of libpq-fe.h
216 sed -i \
217 -e 's:libPythia6:libpythia6:g' \
218 -e 's:ungif:gif:g' \
219 -e 's:$ODBCINCDIR:$ODBCINCDIR /usr/include/iodbc:' \
220 -e 's:libpq-fe.h:pg_config.h:' \
221 configure || die "adjusting configure for Gentoo failed"
222
223 # prefixify the configure script
224 sed -i \
225 -e 's:/usr:${EPREFIX}/usr:g' \
226 configure || die "prefixify configure failed"
227
228 # QTDIR only used for qt3 in gentoo, and configure looks for it.
229 unset QTDIR
230 }
231
232 src_configure() {
233 # the configure script is not the standard autotools
234 ./configure \
235 --prefix="${EPREFIX}"/usr \
236 --etcdir="${EPREFIX}"/etc/root \
237 --libdir="${EPREFIX}"/usr/$(get_libdir)/${PN} \
238 --docdir="${EPREFIX}"/usr/share/doc/${PF} \
239 --tutdir="${EPREFIX}"/usr/share/doc/${PF}/examples/tutorials \
240 --testdir="${EPREFIX}"/usr/share/doc/${PF}/examples/tests \
241 --with-cc=$(tc-getCC) \
242 --with-cxx=$(tc-getCXX) \
243 --with-f77=$(tc-getFC) \
244 --with-afs-shared=yes \
245 --with-sys-iconpath="${EPREFIX}"/usr/share/pixmaps \
246 --disable-builtin-afterimage \
247 --disable-builtin-freetype \
248 --disable-builtin-ftgl \
249 --disable-builtin-glew \
250 --disable-builtin-pcre \
251 --disable-builtin-zlib \
252 --disable-builtin-lzma \
253 --disable-cling \
254 --enable-astiff \
255 --enable-exceptions \
256 --enable-explicitlink \
257 --enable-gdml \
258 --enable-memstat \
259 --enable-shadowpw \
260 --enable-shared \
261 --enable-soversion \
262 --enable-table \
263 --fail-on-missing \
264 $(use_enable X x11) \
265 $(use_enable X asimage) \
266 $(use_enable afs) \
267 $(use_enable avahi bonjour) \
268 $(use_enable clarens) \
269 $(use_enable clarens peac) \
270 $(use_enable fits fitsio) \
271 $(use_enable fftw fftw3) \
272 $(use_enable graphviz gviz) \
273 $(use_enable kerberos krb5) \
274 $(use_enable ldap) \
275 $(use_enable math gsl-shared) \
276 $(use_enable math genvector) \
277 $(use_enable math mathmore) \
278 $(use_enable math minuit2) \
279 $(use_enable math roofit) \
280 $(use_enable math tmva) \
281 $(use_enable math unuran) \
282 $(use_enable mysql) \
283 $(use_enable odbc) \
284 $(use_enable opengl) \
285 $(use_enable postgres pgsql) \
286 $(use_enable prefix rpath) \
287 $(use_enable pythia6) \
288 $(use_enable pythia8) \
289 $(use_enable python) \
290 $(use_enable qt4 qt) \
291 $(use_enable qt4 qtgsi) \
292 $(use_enable reflex cintex) \
293 $(use_enable reflex) \
294 $(use_enable ruby) \
295 $(use_enable ssl) \
296 $(use_enable xft) \
297 $(use_enable xml) \
298 $(use_enable xrootd) \
299 ${EXTRA_ECONF} \
300 || die "configure failed"
301 }
302
303 src_compile() {
304 emake OPT="${CFLAGS}" F77OPT="${FFLAGS}" || die "emake failed"
305 if use emacs; then
306 elisp-compile build/misc/*.el || die "elisp-compile failed"
307 fi
308 }
309
310 doc_install() {
311 cd "${S}"
312 if use doc; then
313 einfo "Installing user's guides"
314 dodoc "${DISTDIR}"/Users_Guide_${DOC_PV}.pdf
315 use math && dodoc \
316 "${DISTDIR}"/RooFit_Users_Manual_${ROOFIT_DOC_PV}.pdf \
317 "${DISTDIR}"/TMVAUsersGuide-v${TMVA_DOC_PV}.pdf
318 fi
319
320 if use examples; then
321 # these should really be taken care of by the root make install
322 insinto /usr/share/doc/${PF}/examples/tutorials/tmva
323 doins -r tmva/test
324 else
325 rm -rf "${ED}"/usr/share/doc/${PF}/examples
326 fi
327 }
328
329 daemon_install() {
330 cd "${S}"
331 local daemons="rootd proofd"
332 dodir /var/spool/rootd
333 fowners rootd:rootd /var/spool/rootd
334 dodir /var/spool/rootd/{pub,tmp}
335 fperms 1777 /var/spool/rootd/{pub,tmp}
336
337 for i in ${daemons}; do
338 newinitd "${FILESDIR}"/${i}.initd ${i}
339 newconfd "${FILESDIR}"/${i}.confd ${i}
340 done
341 if use xinetd; then
342 insinto /etc/xinetd
343 doins etc/daemons/{rootd,proofd}.xinetd
344 fi
345 }
346
347 desktop_install() {
348 cd "${S}"
349 sed -e 's,@prefix@,/usr,' \
350 build/package/debian/root-system-bin.desktop.in > root.desktop
351 domenu root.desktop
352 doicon "${S}"/build/package/debian/root-system-bin.png
353
354 insinto /usr/share/icons/hicolor/48x48/mimetypes
355 doins build/package/debian/application-x-root.png
356
357 insinto /usr/share/icons/hicolor/48x48/apps
358 doicon build/package/debian/root-system-bin.xpm
359 }
360
361 src_install() {
362 emake DESTDIR="${D}" install || die "emake install failed"
363
364 echo "LDPATH=${EPREFIX}/usr/$(get_libdir)/root" > 99root
365 use pythia8 && echo "PYTHIA8=${EPREFIX}/usr" >> 99root
366 use python && echo "PYTHONPATH=${EPREFIX}/usr/$(get_libdir)/root" >> 99root
367 use ruby && echo "RUBYLIB=${EPREFIX}/usr/$(get_libdir)/root" >> 99root
368 doenvd 99root || die "doenvd failed"
369
370 # The build system installs Emacs support unconditionally and in the wrong
371 # directory. Remove it and call elisp-install in case of USE=emacs.
372 rm -rf "${ED}"/usr/share/emacs
373 if use emacs; then
374 elisp-install ${PN} build/misc/*.{el,elc} || die "elisp-install failed"
375 fi
376
377 doc_install
378 daemon_install
379 desktop_install
380
381 # Cleanup of files either already distributed or unused on Gentoo
382 rm "${ED}"usr/share/doc/${PF}/{INSTALL,LICENSE,COPYING.CINT}
383 rm "${ED}"usr/share/root/fonts/LICENSE
384 pushd "${ED}"usr/$(get_libdir)/root/cint/cint/lib > /dev/null
385 rm -f posix/mktypes dll_stl/setup \
386 G__* dll_stl/G__* dll_stl/rootcint_* posix/exten.o
387 rm -f "${ED}"usr/$(get_libdir)/root/cint/cint/include/makehpib
388 rm -f "${ED}"/etc/root/proof/*.sample
389 rm -rf "${ED}"/etc/root/daemons
390 popd > /dev/null
391 # these should be in PATH
392 mv "${ED}"etc/root/proof/utils/pq2/pq2* \
393 "${ED}"usr/bin
394 }
395
396 pkg_postinst() {
397 fdo-mime_desktop_database_update
398 use python && python_mod_optimize /usr/$(get_libdir)/root
399 }
400
401 pkg_postrm() {
402 fdo-mime_desktop_database_update
403 use python && python_mod_cleanup /usr/$(get_libdir)/root
404 }
405
406
407
408 1.1 sci-physics/root/root-5.28.00h-r1.ebuild
409
410 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-physics/root/root-5.28.00h-r1.ebuild?rev=1.1&view=markup
411 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/sci-physics/root/root-5.28.00h-r1.ebuild?rev=1.1&content-type=text/plain
412
413 Index: root-5.28.00h-r1.ebuild
414 ===================================================================
415 # Copyright 1999-2012 Gentoo Foundation
416 # Distributed under the terms of the GNU General Public License v2
417 # $Header: /var/cvsroot/gentoo-x86/sci-physics/root/root-5.28.00h-r1.ebuild,v 1.1 2012/04/03 16:02:52 bicatali Exp $
418
419 EAPI=3
420
421 PYTHON_DEPEND="python? 2"
422
423 inherit elisp-common eutils fdo-mime fortran-2 python toolchain-funcs
424
425 DOC_PV=5_26
426 ROOFIT_DOC_PV=2.91-33
427 TMVA_DOC_PV=4.03
428 PATCH_PV=5.28.00b
429
430 DESCRIPTION="C++ data analysis framework and interpreter from CERN"
431 HOMEPAGE="http://root.cern.ch/"
432 SRC_URI="
433 ftp://root.cern.ch/${PN}/${PN}_v${PV}.source.tar.gz
434 http://dev.gentoo.org/~bicatali/${PN}-${PATCH_PV}-xrootd-prop-flags.patch.bz2
435 doc? ( ftp://root.cern.ch/${PN}/doc/Users_Guide_${DOC_PV}.pdf
436 math? (
437 ftp://root.cern.ch/${PN}/doc/RooFit_Users_Manual_${ROOFIT_DOC_PV}.pdf
438 http://tmva.sourceforge.net/docu/TMVAUsersGuide.pdf -> TMVAUsersGuide-v${TMVA_DOC_PV}.pdf ) )"
439
440 SLOT="0"
441 LICENSE="LGPL-2.1"
442 KEYWORDS="~amd64 ~x86"
443 IUSE="afs avahi clarens doc emacs examples fits fftw graphviz kerberos ldap
444 +math mpi mysql ncurses odbc +opengl openmp oracle postgres pythia6
445 pythia8 python qt4 +reflex ruby ssl xft xinetd xml xrootd"
446
447 CDEPEND="
448 >=dev-lang/cfortran-4.4-r2
449 dev-libs/libpcre
450 media-libs/ftgl
451 media-libs/giflib
452 media-libs/glew
453 media-libs/libpng:0
454 media-libs/tiff:0
455 virtual/shadow
456 virtual/jpeg
457 x11-libs/libX11
458 x11-libs/libXext
459 x11-libs/libXft
460 x11-libs/libXpm
461 || (
462 >=media-libs/libafterimage-1.20[gif,jpeg,png,tiff]
463 >=x11-wm/afterstep-2.2.11[gif,jpeg,png,tiff]
464 )
465 afs? ( net-fs/openafs )
466 avahi? ( net-dns/avahi )
467 clarens? ( dev-libs/xmlrpc-c )
468 emacs? ( virtual/emacs )
469 fits? ( sci-libs/cfitsio )
470 fftw? ( sci-libs/fftw:3.0 )
471 graphviz? ( media-gfx/graphviz )
472 kerberos? ( virtual/krb5 )
473 ldap? ( net-nds/openldap )
474 math? ( sci-libs/gsl sci-mathematics/unuran mpi? ( virtual/mpi ) )
475 mysql? ( virtual/mysql )
476 ncurses? ( sys-libs/ncurses )
477 odbc? ( || ( dev-db/libiodbc dev-db/unixODBC ) )
478 opengl? ( virtual/opengl virtual/glu x11-libs/gl2ps )
479 oracle? ( dev-db/oracle-instantclient-basic )
480 postgres? ( dev-db/postgresql-base )
481 pythia6? ( sci-physics/pythia:6 )
482 pythia8? ( sci-physics/pythia:8 )
483 qt4? (
484 x11-libs/qt-gui:4
485 x11-libs/qt-opengl:4
486 x11-libs/qt-qt3support:4
487 x11-libs/qt-svg:4
488 x11-libs/qt-webkit:4
489 x11-libs/qt-xmlpatterns:4 )
490 ruby? (
491 dev-lang/ruby
492 dev-ruby/rubygems )
493 ssl? ( dev-libs/openssl )
494 xml? ( dev-libs/libxml2:2 )"
495
496 DEPEND="${CDEPEND}
497 dev-util/pkgconfig"
498
499 RDEPEND="
500 virtual/fortran
501 ${CDEPEND}
502 reflex? ( dev-cpp/gccxml )
503 xinetd? ( sys-apps/xinetd )"
504
505 S="${WORKDIR}/${PN}"
506
507 pkg_setup() {
508 fortran-2_pkg_setup
509 echo
510 elog "There are extra options on packages not yet in Gentoo:"
511 elog "AliEn, castor, Chirp, dCache, gfal, gLite, Globus,"
512 elog "HDFS, Monalisa, MaxDB/SapDB, SRP."
513 elog "You can use the env variable EXTRA_ECONF variable for this."
514 elog "For example, for SRP, you would set: "
515 elog "EXTRA_ECONF=\"--enable-srp --with-srp-libdir=/usr/$(get_libdir)\""
516 echo
517 enewgroup rootd
518 enewuser rootd -1 -1 /var/spool/rootd rootd
519
520 if use math; then
521 if use openmp && [[ $(tc-getCC)$ == *gcc* ]] && ! tc-has-openmp; then
522 ewarn "You are using gcc and OpenMP is available with gcc >= 4.2"
523 ewarn "If you want to build this package with OpenMP, abort now,"
524 ewarn "and set CC to an OpenMP capable compiler"
525 elif use openmp; then
526 export USE_OPENMP=1 USE_PARALLEL_MINUIT2=1
527 elif use mpi; then
528 export USE_MPI=1 USE_PARALLEL_MINUIT2=1
529 fi
530 fi
531 }
532
533 src_prepare() {
534 epatch \
535 "${WORKDIR}"/${PN}-${PATCH_PV}-xrootd-prop-flags.patch \
536 "${FILESDIR}"/${PN}-${PATCH_PV}-prop-ldflags.patch \
537 "${FILESDIR}"/${PN}-${PATCH_PV}-asneeded.patch \
538 "${FILESDIR}"/${PN}-${PATCH_PV}-nobyte-compile.patch \
539 "${FILESDIR}"/${PN}-${PATCH_PV}-glibc212.patch \
540 "${FILESDIR}"/${PN}-${PATCH_PV}-unuran.patch \
541 "${FILESDIR}"/${P}-explicit-functions.patch
542
543 # make sure we use system libs and headers
544 rm montecarlo/eg/inc/cfortran.h README/cfortran.doc
545 rm -rf graf2d/asimage/src/libAfterImage
546 rm -rf graf3d/ftgl/{inc,src}
547 rm -rf graf2d/freetype/src
548 rm -rf graf3d/glew/{inc,src}
549 rm -rf core/pcre/src
550 rm -rf math/unuran/src/unuran-*.tar.gz
551 find core/zip -type f -name "[a-z]*" | xargs rm
552 rm graf3d/gl/{inc,src}/gl2ps.*
553 sed -i -e 's/^GLLIBS *:= .* $(OPENGLLIB)/& -lgl2ps/' graf3d/gl/Module.mk
554
555 # TODO: unbundle xrootd as a new package
556 #rm -rf net/xrootd/src
557 #sed -i \
558 # -e 's:-lXrdOuc:-lXrd &:' \
559 # -e 's:$(XROOTDDIRL)/lib\(Xrd\w*\).a:-l\1:g' \
560 # proof/proofd/Module.mk || die
561
562 # In Gentoo, libPythia6 is called libpythia6
563 # libungif is called libgif,
564 # iodbc is in /usr/include/iodbc
565 # pg_config.h is checked instead of libpq-fe.h
566 sed -i \
567 -e 's:libPythia6:libpythia6:g' \
568 -e 's:ungif:gif:g' \
569 -e 's:$ODBCINC:$ODBCINC /usr/include/iodbc:' \
570 -e 's:libpq-fe.h:pg_config.h:' \
571 configure || die "adjusting configure for Gentoo failed"
572
573 # prefixify the configure script
574 sed -i \
575 -e 's:/usr:${EPREFIX}/usr:g' \
576 configure || die "prefixify configure failed"
577
578 # QTDIR only used for qt3 in gentoo, and configure looks for it.
579 unset QTDIR
580 }
581
582 src_configure() {
583 # the configure script is not the standard autotools
584 ./configure \
585 --prefix="${EPREFIX}"/usr \
586 --etcdir="${EPREFIX}"/etc/root \
587 --libdir="${EPREFIX}"/usr/$(get_libdir)/${PN} \
588 --docdir="${EPREFIX}"/usr/share/doc/${PF} \
589 --tutdir="${EPREFIX}"/usr/share/doc/${PF}/examples/tutorials \
590 --testdir="${EPREFIX}"/usr/share/doc/${PF}/examples/tests \
591 --with-cc=$(tc-getCC) \
592 --with-cxx=$(tc-getCXX) \
593 --with-f77=$(tc-getFC) \
594 --with-sys-iconpath="${EPREFIX}"/usr/share/pixmaps \
595 --disable-builtin-afterimage \
596 --disable-builtin-freetype \
597 --disable-builtin-ftgl \
598 --disable-builtin-glew \
599 --disable-builtin-pcre \
600 --disable-builtin-zlib \
601 --disable-rpath \
602 --enable-asimage \
603 --enable-astiff \
604 --enable-exceptions \
605 --enable-explicitlink \
606 --enable-gdml \
607 --enable-memstat \
608 --enable-shadowpw \
609 --enable-shared \
610 --enable-soversion \
611 --enable-table \
612 --fail-on-missing \
613 --with-afs-shared=yes \
614 $(use_enable afs) \
615 $(use_enable avahi bonjour) \
616 $(use_enable clarens) \
617 $(use_enable clarens peac) \
618 $(use_enable ncurses editline) \
619 $(use_enable fits fitsio) \
620 $(use_enable fftw fftw3) \
621 $(use_enable graphviz gviz) \
622 $(use_enable kerberos krb5) \
623 $(use_enable ldap) \
624 $(use_enable math gsl-shared) \
625 $(use_enable math genvector) \
626 $(use_enable math mathmore) \
627 $(use_enable math minuit2) \
628 $(use_enable math roofit) \
629 $(use_enable math tmva) \
630 $(use_enable math unuran) \
631 $(use_enable mysql) \
632 $(use_enable odbc) \
633 $(use_enable opengl) \
634 $(use_enable postgres pgsql) \
635 $(use_enable pythia6) \
636 $(use_enable pythia8) \
637 $(use_enable python) \
638 $(use_enable qt4 qt) \
639 $(use_enable qt4 qtgsi) \
640 $(use_enable reflex cintex) \
641 $(use_enable reflex) \
642 $(use_enable ruby) \
643 $(use_enable ssl) \
644 $(use_enable xft) \
645 $(use_enable xml) \
646 $(use_enable xrootd) \
647 ${EXTRA_ECONF} \
648 || die "configure failed"
649 }
650
651 src_compile() {
652 emake OPT="${CFLAGS}" F77OPT="${FFLAGS}" || die "emake failed"
653 if use emacs; then
654 elisp-compile build/misc/*.el || die "elisp-compile failed"
655 fi
656 }
657
658 doc_install() {
659 cd "${S}"
660 if use doc; then
661 einfo "Installing user's guides"
662 dodoc "${DISTDIR}"/Users_Guide_${DOC_PV}.pdf
663 use math && dodoc \
664 "${DISTDIR}"/RooFit_Users_Manual_${ROOFIT_DOC_PV}.pdf \
665 "${DISTDIR}"/TMVAUsersGuide-v${TMVA_DOC_PV}.pdf
666 fi
667
668 if use examples; then
669 # these should really be taken care of by the root make install
670 insinto /usr/share/doc/${PF}/examples/tutorials/tmva
671 doins -r tmva/test
672 else
673 rm -rf "${ED}"/usr/share/doc/${PF}/examples
674 fi
675 }
676
677 daemon_install() {
678 cd "${S}"
679 local daemons="rootd proofd"
680 dodir /var/spool/rootd
681 fowners rootd:rootd /var/spool/rootd
682 dodir /var/spool/rootd/{pub,tmp}
683 fperms 1777 /var/spool/rootd/{pub,tmp}
684
685 use xrootd && daemons="${daemons} xrootd olbd"
686 for i in ${daemons}; do
687 newinitd "${FILESDIR}"/${i}.initd ${i}
688 newconfd "${FILESDIR}"/${i}.confd ${i}
689 done
690 if use xinetd; then
691 insinto /etc/xinetd
692 doins etc/daemons/{rootd,proofd}.xinetd
693 fi
694 }
695
696 desktop_install() {
697 cd "${S}"
698 sed -e 's,@prefix@,/usr,' \
699 build/package/debian/root-system-bin.desktop.in > root.desktop
700 domenu root.desktop
701 doicon "${S}"/build/package/debian/root-system-bin.png
702
703 insinto /usr/share/icons/hicolor/48x48/mimetypes
704 doins build/package/debian/application-x-root.png
705
706 insinto /usr/share/icons/hicolor/48x48/apps
707 doicon build/package/debian/root-system-bin.xpm
708 }
709
710 src_install() {
711 emake DESTDIR="${D}" install || die "emake install failed"
712
713 echo "LDPATH=${EPREFIX}/usr/$(get_libdir)/root" > 99root
714 use pythia8 && echo "PYTHIA8=${EPREFIX}/usr" >> 99root
715 use python && echo "PYTHONPATH=${EPREFIX}/usr/$(get_libdir)/root" >> 99root
716 use ruby && echo "RUBYLIB=${EPREFIX}/usr/$(get_libdir)/root" >> 99root
717 doenvd 99root || die "doenvd failed"
718
719 # The build system installs Emacs support unconditionally and in the wrong
720 # directory. Remove it and call elisp-install in case of USE=emacs.
721 rm -rf "${ED}"/usr/share/emacs
722 if use emacs; then
723 elisp-install ${PN} build/misc/*.{el,elc} || die "elisp-install failed"
724 fi
725
726 doc_install
727 daemon_install
728 desktop_install
729
730 # Cleanup of files either already distributed or unused on Gentoo
731 rm "${ED}"usr/share/doc/${PF}/{INSTALL,LICENSE,COPYING.CINT}
732 rm "${ED}"usr/share/root/fonts/LICENSE
733 pushd "${ED}"usr/$(get_libdir)/root/cint/cint/lib > /dev/null
734 rm -f posix/mktypes dll_stl/setup \
735 G__* dll_stl/G__* dll_stl/rootcint_* posix/exten.o
736 rm -f "${ED}"usr/$(get_libdir)/root/cint/cint/include/makehpib
737 rm -f "${ED}"/etc/root/proof/*.sample
738 rm -rf "${ED}"/etc/root/daemons
739 popd > /dev/null
740 # these should be in PATH
741 mv "${ED}"etc/root/proof/utils/pq2/pq2* \
742 "${ED}"usr/bin
743 }
744
745 pkg_postinst() {
746 fdo-mime_desktop_database_update
747 use python && python_mod_optimize /usr/$(get_libdir)/root
748 }
749
750 pkg_postrm() {
751 fdo-mime_desktop_database_update
752 use python && python_mod_cleanup /usr/$(get_libdir)/root
753 }