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