1 # Copyright 1999-2018 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 CMAKE_BUILD_TYPE=Release
7 # ninja does not work due to fortran
8 CMAKE_MAKEFILE_GENERATOR=emake
9 FORTRAN_NEEDED="fortran"
10 PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
12 inherit cmake-utils eapi7-ver elisp-common eutils fortran-2 \
13 prefix python-single-r1 toolchain-funcs
15 if [[ ${PV} == "9999" ]] ; then
18 EGIT_REPO_URI="http://root.cern/git/root.git"
21 KEYWORDS="~amd64 ~x86"
22 SRC_URI="https://root.cern/download/${PN}_v${PV}.source.tar.gz"
23 SLOT="$(ver_cut 1-2)/$(ver_cut 3)"
26 DESCRIPTION="C++ data analysis framework and interpreter from CERN"
27 HOMEPAGE="https://root.cern"
29 IUSE="+X avahi aqua +asimage +davix emacs +examples fits fftw fortran
30 +gdml graphviz +gsl http jemalloc kerberos ldap libcxx memstat
31 +minuit mysql odbc +opengl oracle postgres prefix pythia6 pythia8
32 +python qt4 qt5 R +roofit root7 shadow sqlite +ssl table +tbb test
33 +threads +tiff +tmva +unuran vc xinetd +xml xrootd"
35 LICENSE="LGPL-2.1 freedist MSttfEULA LGPL-3 libpng UoI-NCSA"
38 !X? ( !asimage !opengl !qt4 !qt5 !tiff )
39 python? ( ${PYTHON_REQUIRED_USE} )
47 fortran? ( dev-lang/cfortran )
51 media-libs/freetype:2=
79 media-libs/libafterimage[gif,jpeg,png,tiff?]
80 >=x11-wm/afterstep-2.2.11[gif,jpeg,png,tiff?]
82 avahi? ( net-dns/avahi[mdnsresponder-compat] )
83 davix? ( net-libs/davix )
84 emacs? ( virtual/emacs )
85 fftw? ( sci-libs/fftw:3.0= )
86 fits? ( sci-libs/cfitsio:0= )
87 graphviz? ( media-gfx/graphviz:0= )
89 http? ( dev-libs/fcgi:0= )
90 jemalloc? ( dev-libs/jemalloc )
91 kerberos? ( virtual/krb5 )
92 ldap? ( net-nds/openldap:0= )
93 libcxx? ( sys-libs/libcxx )
94 unuran? ( sci-mathematics/unuran:0= )
95 minuit? ( !sci-libs/minuit )
96 mysql? ( virtual/mysql )
97 odbc? ( || ( dev-db/libiodbc dev-db/unixODBC ) )
98 oracle? ( dev-db/oracle-instantclient-basic )
99 postgres? ( dev-db/postgresql:= )
100 pythia6? ( sci-physics/pythia:6= )
101 pythia8? ( sci-physics/pythia:8= )
102 python? ( ${PYTHON_DEPS} )
104 shadow? ( virtual/shadow )
105 sqlite? ( dev-db/sqlite:3 )
106 ssl? ( dev-libs/openssl:0= )
108 tmva? ( dev-python/numpy[${PYTHON_USEDEP}] )
110 xml? ( dev-libs/libxml2:2= )
111 xrootd? ( net-libs/xrootd:0= )
118 xinetd? ( sys-apps/xinetd )"
121 "${FILESDIR}"/${PN}-6.12.04-no-ocaml.patch
122 "${FILESDIR}"/${PN}-6.13.02-hsimple.patch
126 use fortran && fortran-2_pkg_setup
127 use python && python-single-r1_pkg_setup
130 elog "There are extra options on packages not yet in Gentoo:"
131 elog "Afdsmgrd, AliEn, castor, Chirp, dCache, gfal, Globus, gLite,"
132 elog "HDFS, Monalisa, MaxDB/SapDB, SRP, VecCore."
133 elog "You can use the env variable EXTRA_ECONF variable for this."
134 elog "For example, for Chirp, you would set: "
135 elog "EXTRA_ECONF=\"-Dchirp=ON\""
140 cmake-utils_src_prepare
142 sed -i "/CLING_BUILD_PLUGINS/d" interpreter/CMakeLists.txt || die
144 # CSS should use local images
145 sed -i -e 's,http://.*/,,' etc/html/ROOT.css || die "html sed failed"
148 # Note: ROOT uses bundled clang because it is patched and API-incompatible
149 # with vanilla clang. The patches enable the C++ interpreter to work.
150 # Since ROOT installs many small files into /etc (~100MB in total),
151 # we install it into another directory to avoid making /etc too big.
155 -DCMAKE_C_FLAGS="${CFLAGS}"
156 -DCMAKE_CXX_FLAGS="${CXXFLAGS}"
157 -DCMAKE_INSTALL_PREFIX="${EPREFIX%/}/usr/$(get_libdir)/${PN}/$(ver_cut 1-2)"
158 -DCMAKE_INSTALL_MANDIR="${EPREFIX%/}/usr/$(get_libdir)/${PN}/$(ver_cut 1-2)/share/man"
159 -DMCAKE_INSTALL_LIBDIR=$(get_libdir)
160 -DDEFAULT_SYSROOT="${EPREFIX}"
161 -DLLVM_CONFIG="${EPREFIX%/}/usr/lib/llvm/5/bin/llvm-config"
162 -DCLING_BUILD_PLUGINS=OFF
169 -Dbuiltin_afterimage=OFF
170 -Dbuiltin_cfitsio=OFF
173 -Dbuiltin_freetype=OFF
180 -Dbuiltin_openssl=OFF
186 -Dbuiltin_veccore=OFF
193 -Dafs=OFF # not implemented
195 -Dasimage=$(usex asimage)
196 -Dastiff=$(usex tiff)
197 -Dbonjour=$(usex avahi)
198 -Dlibcxx=$(usex libcxx)
199 -Dccache=OFF # use ccache via portage
202 -Dcling=ON # cling=OFF is broken
204 -Dcxx14=$(usex root7)
205 -Dcxxmodules=OFF # requires clang, unstable
206 -Ddavix=$(usex davix)
209 -Dfitsio=$(usex fits)
210 -Dfortran=$(usex fortran)
211 -Dftgl=$(usex opengl)
213 -Dgenvector=ON # genvector=OFF ignored
216 -Dgl2ps=$(usex opengl)
217 -Dglite=OFF # not implemented
221 -Dgsl_shared=$(usex gsl)
222 -Dgviz=$(usex graphviz)
226 -Djemalloc=$(usex jemalloc)
227 -Dkrb5=$(usex kerberos)
229 -Dmathmore=$(usex gsl)
230 -Dmemstat=$(usex memstat)
232 -Dminuit2=$(usex minuit)
233 -Dminuit=$(usex minuit)
235 -Dmysql=$(usex mysql)
237 -Dopengl=$(usex opengl)
238 -Doracle=$(usex oracle)
239 -Dpch=ON # pch=OFF is broken
240 -Dpgsql=$(usex postgres)
241 -Dpythia6=$(usex pythia6)
242 -Dpythia8=$(usex pythia8)
243 -Dpython=$(usex python)
248 -Droofit=$(usex roofit)
249 -Droot7=$(usex root7)
251 -Droottest=$(usex test)
252 -Drpath=ON # needed for multi-slot to work
253 -Druby=OFF # deprecated and broken
254 -Druntime_cxxmodules=OFF # does not work yet
256 -Dsapdb=OFF # not implemented
257 -Dshadowpw=$(usex shadow)
258 -Dsqlite=$(usex sqlite)
259 -Dsrp=OFF # not implemented
261 -Dtable=$(usex table)
264 -Dtesting=$(usex test)
265 -Dthread=$(usex threads)
266 -Dtmva-cpu=$(usex tmva)
269 -Dunuran=$(usex unuran)
274 -Dxrootd=$(usex xrootd)
278 cmake-utils_src_configure
282 cmake-utils_src_install
284 ROOTSYS=${EPREFIX%/}/usr/$(get_libdir)/${PN}/$(ver_cut 1-2)
285 ROOTENV=9999${PN}-$(ver_cut 1-2)
287 # ROOT fails without this symlink because it only looks in lib
288 if [[ ! -d ${D}/${ROOTSYS}/lib ]]; then
289 dosym $(get_libdir) /usr/$(get_libdir)/${PN}/$(ver_cut 1-2)/lib
292 cat > ${ROOTENV} <<- EOF || die
293 MANPATH="${ROOTSYS}/share/man"
294 PATH="${ROOTSYS}/bin"
295 ROOTPATH="${ROOTSYS}/bin"
296 LDPATH="${ROOTSYS}/$(get_libdir)"
300 echo "PYTHONPATH=${ROOTSYS}/$(get_libdir)" >> ${ROOTENV} || die
305 pushd "${D}/${ROOTSYS}" > /dev/null
308 elisp-install ${PN}-$(ver_cut 1-2) "${BUILD_DIR}"/root-help.el
315 if ! use examples; then
316 rm -r test tutorials || die
323 # clean up unnecessary files from installation
324 rm -r bin/clang* config emacs etc/vmc || die