/[gentoo-x86]/sci-physics/root/root-5.32.03-r2.ebuild
Gentoo

Contents of /sci-physics/root/root-5.32.03-r2.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.6 - (show annotations) (download)
Sat Mar 2 23:27:01 2013 UTC (2 months, 2 weeks ago) by hwoarang
Branch: MAIN
CVS Tags: HEAD
Changes since 1.5: +8 -8 lines
Move Qt dependencies to the new category

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

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-physics/root/root-5.32.03-r2.ebuild,v 1.5 2012/10/16 18:50:45 jlec Exp $
4
5 EAPI=4
6
7 PYTHON_DEPEND="python? 2"
8
9 if [[ ${PV} == "9999" ]] ; then
10 _SVN=subversion
11 ESVN_REPO_URI="https://root.cern.ch/svn/root/trunk"
12 ESVN_OPTIONS="--non-interactive --trust-server-cert"
13 SRC_URI=""
14 KEYWORDS=""
15 else
16 SRC_URI="ftp://root.cern.ch/${PN}/${PN}_v${PV}.source.tar.gz"
17 KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux"
18 fi
19
20 inherit elisp-common eutils fdo-mime fortran-2 multilib python toolchain-funcs user ${_SVN}
21
22 ROOFIT_DOC_PV=2.91-33
23 TMVA_DOC_PV=4.03
24 PATCH_PV=5.28.00b
25 PATCH_PV2=5.32.00
26
27 DESCRIPTION="C++ data analysis framework and interpreter from CERN"
28 HOMEPAGE="http://root.cern.ch/"
29 SRC_URI="${SRC_URI}
30 doc? ( ftp://root.cern.ch/${PN}/doc/ROOTUsersGuide.pdf
31 math? (
32 ftp://root.cern.ch/${PN}/doc/RooFit_Users_Manual_${ROOFIT_DOC_PV}.pdf
33 http://tmva.sourceforge.net/docu/TMVAUsersGuide.pdf -> TMVAUsersGuide-v${TMVA_DOC_PV}.pdf )
34 htmldoc? (
35 http://root.cern.ch/drupal/sites/default/files/rootdrawing-logo.png
36 http://root.cern.ch/drupal/sites/all/themes/newsflash/images/blue/root-banner.png
37 http://root.cern.ch/drupal/sites/all/themes/newsflash/images/info.png ) )"
38
39 SLOT="0"
40 LICENSE="LGPL-2.1"
41 IUSE="+X afs avahi clarens doc emacs examples fits fftw graphviz htmldoc kerberos
42 ldap +math mpi mysql odbc +opengl openmp oracle postgres prefix pythia6
43 pythia8 python qt4 +reflex ruby ssl xft xinetd xml xrootd"
44
45 CDEPEND="
46 app-arch/xz-utils
47 >=dev-lang/cfortran-4.4-r2
48 dev-libs/libpcre
49 media-fonts/dejavu
50 media-libs/freetype
51 media-libs/giflib
52 media-libs/libpng:0
53 media-libs/tiff:0
54 sys-libs/zlib
55 virtual/jpeg
56 virtual/shadow
57 X? (
58 media-libs/ftgl
59 media-libs/glew
60 x11-libs/libX11
61 x11-libs/libXext
62 x11-libs/libXpm
63 || (
64 >=media-libs/libafterimage-1.20[gif,jpeg,png,tiff]
65 >=x11-wm/afterstep-2.2.11[gif,jpeg,png,tiff]
66 )
67 opengl? ( virtual/opengl virtual/glu x11-libs/gl2ps )
68 qt4? (
69 dev-qt/qtgui:4
70 dev-qt/qtopengl:4
71 dev-qt/qt3support:4
72 dev-qt/qtsvg:4
73 dev-qt/qtwebkit:4
74 dev-qt/qtxmlpatterns:4 )
75 xft? ( x11-libs/libXft )
76 )
77 afs? ( net-fs/openafs )
78 avahi? ( net-dns/avahi )
79 clarens? ( dev-libs/xmlrpc-c[curl] )
80 emacs? ( virtual/emacs )
81 fits? ( sci-libs/cfitsio )
82 fftw? ( sci-libs/fftw:3.0 )
83 graphviz? ( media-gfx/graphviz )
84 kerberos? ( virtual/krb5 )
85 ldap? ( net-nds/openldap )
86 math? ( sci-libs/gsl sci-mathematics/unuran mpi? ( virtual/mpi ) )
87 mysql? ( virtual/mysql )
88 odbc? ( || ( dev-db/libiodbc dev-db/unixODBC ) )
89 oracle? ( dev-db/oracle-instantclient-basic )
90 postgres? ( dev-db/postgresql-base )
91 pythia6? ( sci-physics/pythia:6 )
92 pythia8? ( sci-physics/pythia:8 )
93 ruby? (
94 dev-lang/ruby
95 dev-ruby/rubygems )
96 ssl? ( dev-libs/openssl )
97 xml? ( dev-libs/libxml2 )
98 xrootd? ( net-libs/xrootd )"
99
100 DEPEND="${CDEPEND}
101 virtual/pkgconfig"
102
103 RDEPEND="${CDEPEND}
104 reflex? ( dev-cpp/gccxml )
105 xinetd? ( sys-apps/xinetd )"
106
107 PDEPEND="htmldoc? ( ~app-doc/root-docs-${PV} )"
108
109 REQUIRED_USE="
110 !X? ( !opengl !qt4 !xft )
111 mpi? ( math !openmp )
112 openmp? ( math !mpi )"
113
114 S="${WORKDIR}/${PN}"
115
116 pkg_setup() {
117 fortran-2_pkg_setup
118 python_pkg_setup
119 echo
120 elog "There are extra options on packages not yet in Gentoo:"
121 elog "AliEn, castor, Chirp, dCache, gfal, gLite, Globus,"
122 elog "HDFS, Monalisa, MaxDB/SapDB, SRP."
123 elog "You can use the env variable EXTRA_ECONF variable for this."
124 elog "For example, for SRP, you would set: "
125 elog "EXTRA_ECONF=\"--enable-srp --with-srp-libdir=/usr/$(get_libdir)\""
126 echo
127 enewgroup rootd
128 enewuser rootd -1 -1 /var/spool/rootd rootd
129
130 if use math; then
131 if use openmp; then
132 if [[ $(tc-getCC)$ == *gcc* ]] && ! tc-has-openmp; then
133 ewarn "You are using a gcc without OpenMP capabilities"
134 die "Need an OpenMP capable compiler"
135 else
136 export USE_OPENMP=1 USE_PARALLEL_MINUIT2=1
137 fi
138 elif use mpi; then
139 export USE_MPI=1 USE_PARALLEL_MINUIT2=1
140 fi
141 fi
142 }
143
144 src_prepare() {
145 epatch \
146 "${FILESDIR}"/${PN}-${PATCH_PV}-prop-ldflags.patch \
147 "${FILESDIR}"/${PN}-${PATCH_PV}-asneeded.patch \
148 "${FILESDIR}"/${PN}-${PATCH_PV2}-nobyte-compile.patch \
149 "${FILESDIR}"/${PN}-${PATCH_PV}-glibc212.patch \
150 "${FILESDIR}"/${PN}-${PATCH_PV}-unuran.patch \
151 "${FILESDIR}"/${PN}-${PATCH_PV2}-afs.patch \
152 "${FILESDIR}"/${PN}-${PATCH_PV2}-cfitsio.patch \
153 "${FILESDIR}"/${PN}-${PATCH_PV2}-chklib64.patch \
154 "${FILESDIR}"/${PN}-${PATCH_PV2}-explicit-functions.patch \
155 "${FILESDIR}"/${PN}-${PATCH_PV2}-dotfont.patch
156
157 # make sure we use system libs and headers
158 rm montecarlo/eg/inc/cfortran.h README/cfortran.doc || die
159 rm -rf graf2d/asimage/src/libAfterImage || die
160 rm -rf graf3d/ftgl/{inc,src} || die
161 rm -rf graf2d/freetype/src || die
162 rm -rf graf3d/glew/{inc,src} || die
163 rm -rf core/pcre/src || die
164 rm -rf math/unuran/src/unuran-*.tar.gz || die
165 LANG=C LC_ALL=C find core/zip -type f -name "[a-z]*" -print0 | xargs -0 rm -f || die
166 rm -rf core/lzma/src/*.tar.gz || die
167 rm graf3d/gl/{inc,src}/gl2ps.* || die
168 sed -i -e 's/^GLLIBS *:= .* $(OPENGLLIB)/& -lgl2ps/' graf3d/gl/Module.mk || die
169
170 # In Gentoo, libPythia6 is called libpythia6
171 # libungif is called libgif,
172 # iodbc is in /usr/include/iodbc
173 # pg_config.h is checked instead of libpq-fe.h
174 sed -i \
175 -e 's:libPythia6:libpythia6:g' \
176 -e 's:ungif:gif:g' \
177 -e 's:$ODBCINCDIR:$ODBCINCDIR /usr/include/iodbc:' \
178 -e 's:libpq-fe.h:pg_config.h:' \
179 configure || die "adjusting configure for Gentoo failed"
180
181 # prefixify the configure script
182 sed -i \
183 -e 's:/usr:${EPREFIX}/usr:g' \
184 configure || die "prefixify configure failed"
185
186 # QTDIR only used for qt3 in gentoo, and configure looks for it.
187 unset QTDIR
188
189 # Make html docs self-consistent for offline work (based on Fedora spec)
190 if use htmldoc; then
191 epatch "${FILESDIR}"/${PN}-${PATCH_PV2}-htmldoc.patch
192 # make images local
193 sed 's!http://root.cern.ch/drupal/sites/all/themes/newsflash/images/blue/!!' \
194 -i etc/html/ROOT.css || die "htmldoc sed failed"
195 sed 's!http://root.cern.ch/drupal/sites/all/themes/newsflash/images/!!' \
196 -i etc/html/ROOT.css || die "htmldoc sed failed"
197 sed 's!http://root.cern.ch/drupal/sites/default/files/!!' \
198 -i etc/html/header.html || die "htmldoc sed failed"
199
200 cp "${DISTDIR}"/{rootdrawing-logo.png,root-banner.png,info.png} etc/html ||
201 die "htmldoc preparation failed"
202 fi
203 }
204
205 src_configure() {
206 # the configure script is not the standard autotools
207 ./configure \
208 --prefix="${EPREFIX}"/usr \
209 --etcdir="${EPREFIX}"/etc/root \
210 --libdir="${EPREFIX}"/usr/$(get_libdir)/${PN} \
211 --docdir="${EPREFIX}"/usr/share/doc/${PF} \
212 --tutdir="${EPREFIX}"/usr/share/doc/${PF}/examples/tutorials \
213 --testdir="${EPREFIX}"/usr/share/doc/${PF}/examples/tests \
214 --with-cc=$(tc-getCC) \
215 --with-cxx=$(tc-getCXX) \
216 --with-f77=$(tc-getFC) \
217 --with-ld=$(tc-getCXX) \
218 --with-afs-shared=yes \
219 --with-sys-iconpath="${EPREFIX}"/usr/share/pixmaps \
220 --disable-builtin-afterimage \
221 --disable-builtin-freetype \
222 --disable-builtin-ftgl \
223 --disable-builtin-glew \
224 --disable-builtin-pcre \
225 --disable-builtin-zlib \
226 --disable-builtin-lzma \
227 --disable-cling \
228 --enable-astiff \
229 --enable-exceptions \
230 --enable-explicitlink \
231 --enable-gdml \
232 --enable-memstat \
233 --enable-shadowpw \
234 --enable-shared \
235 --enable-soversion \
236 --enable-table \
237 --fail-on-missing \
238 $(use_enable X x11) \
239 $(use_enable X asimage) \
240 $(use_enable afs) \
241 $(use_enable avahi bonjour) \
242 $(use_enable clarens) \
243 $(use_enable clarens peac) \
244 $(use_enable fits fitsio) \
245 $(use_enable fftw fftw3) \
246 $(use_enable graphviz gviz) \
247 $(use_enable kerberos krb5) \
248 $(use_enable ldap) \
249 $(use_enable math gsl-shared) \
250 $(use_enable math genvector) \
251 $(use_enable math mathmore) \
252 $(use_enable math minuit2) \
253 $(use_enable math roofit) \
254 $(use_enable math tmva) \
255 $(use_enable math unuran) \
256 $(use_enable mysql) \
257 $(use_enable odbc) \
258 $(use_enable opengl) \
259 $(use_enable postgres pgsql) \
260 $(use_enable prefix rpath) \
261 $(use_enable pythia6) \
262 $(use_enable pythia8) \
263 $(use_enable python) \
264 $(use_enable qt4 qt) \
265 $(use_enable qt4 qtgsi) \
266 $(use_enable reflex cintex) \
267 $(use_enable reflex) \
268 $(use_enable ruby) \
269 $(use_enable ssl) \
270 $(use_enable xft) \
271 $(use_enable xml) \
272 $(use_enable xrootd) \
273 ${EXTRA_ECONF} \
274 || die "configure failed"
275 }
276
277 src_compile() {
278 emake OPT="${CXXFLAGS}" F77OPT="${FFLAGS}"
279 if use emacs; then
280 elisp-compile build/misc/*.el || die "elisp-compile failed"
281 fi
282 }
283
284 doc_install() {
285 cd "${S}"
286 if use doc; then
287 einfo "Installing user's guides"
288 dodoc "${DISTDIR}"/ROOTUsersGuide.pdf
289 use math && dodoc \
290 "${DISTDIR}"/RooFit_Users_Manual_${ROOFIT_DOC_PV}.pdf \
291 "${DISTDIR}"/TMVAUsersGuide-v${TMVA_DOC_PV}.pdf
292 fi
293
294 if use examples; then
295 # these should really be taken care of by the root make install
296 insinto /usr/share/doc/${PF}/examples/tutorials/tmva
297 doins -r tmva/test
298 else
299 rm -rf "${ED}"/usr/share/doc/${PF}/examples || die
300 fi
301 }
302
303 daemon_install() {
304 cd "${S}"
305 local daemons="rootd proofd"
306 dodir /var/spool/rootd
307 fowners rootd:rootd /var/spool/rootd
308 dodir /var/spool/rootd/{pub,tmp}
309 fperms 1777 /var/spool/rootd/{pub,tmp}
310
311 for i in ${daemons}; do
312 newinitd "${FILESDIR}"/${i}.initd ${i}
313 newconfd "${FILESDIR}"/${i}.confd ${i}
314 done
315 if use xinetd; then
316 insinto /etc/xinetd
317 doins etc/daemons/{rootd,proofd}.xinetd
318 fi
319 }
320
321 desktop_install() {
322 cd "${S}"
323 sed -e 's,@prefix@,/usr,' \
324 build/package/debian/root-system-bin.desktop.in > root.desktop
325 domenu root.desktop
326 doicon "${S}"/build/package/debian/root-system-bin.png
327
328 insinto /usr/share/icons/hicolor/48x48/mimetypes
329 doins build/package/debian/application-x-root.png
330
331 insinto /usr/share/icons/hicolor/48x48/apps
332 doicon build/package/debian/root-system-bin.xpm
333 }
334
335 src_install() {
336 emake DESTDIR="${D}" install
337
338 echo "LDPATH=${EPREFIX}/usr/$(get_libdir)/root" > 99root
339 use pythia8 && echo "PYTHIA8=${EPREFIX}/usr" >> 99root
340 use python && echo "PYTHONPATH=${EPREFIX}/usr/$(get_libdir)/root" >> 99root
341 use ruby && echo "RUBYLIB=${EPREFIX}/usr/$(get_libdir)/root" >> 99root
342 doenvd 99root
343
344 # The build system installs Emacs support unconditionally and in the wrong
345 # directory. Remove it and call elisp-install in case of USE=emacs.
346 rm -rf "${ED}"/usr/share/emacs
347 if use emacs; then
348 elisp-install ${PN} build/misc/*.{el,elc} || die "elisp-install failed"
349 fi
350
351 doc_install
352 daemon_install
353 desktop_install
354
355 # Cleanup of files either already distributed or unused on Gentoo
356 rm "${ED}"usr/share/doc/${PF}/{INSTALL,LICENSE,COPYING.CINT} || die
357 rm "${ED}"usr/share/root/fonts/LICENSE || die
358 pushd "${ED}"usr/$(get_libdir)/root/cint/cint/lib > /dev/null
359 rm -f posix/mktypes dll_stl/setup \
360 G__* dll_stl/G__* dll_stl/rootcint_* posix/exten.o || die
361 rm -f "${ED}"usr/$(get_libdir)/root/cint/cint/include/makehpib || die
362 rm -f "${ED}"/etc/root/proof/*.sample || die
363 rm -rf "${ED}"/etc/root/daemons || die
364 popd > /dev/null
365 # these should be in PATH
366 mv "${ED}"etc/root/proof/utils/pq2/pq2* \
367 "${ED}"usr/bin/ || die
368 }
369
370 pkg_postinst() {
371 fdo-mime_desktop_database_update
372 use python && python_mod_optimize /usr/$(get_libdir)/root
373 }
374
375 pkg_postrm() {
376 fdo-mime_desktop_database_update
377 use python && python_mod_cleanup /usr/$(get_libdir)/root
378 }

  ViewVC Help
Powered by ViewVC 1.1.13