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 DESCRIPTION="C++ data analysis framework and interpreter from CERN"
16 HOMEPAGE="https://root.cern"
17 SRC_URI="https://root.cern/download/${PN}_v${PV}.source.tar.gz"
19 IUSE="+X avahi aqua +asimage +davix emacs +examples fits fftw fortran
20 +gdml graphviz +gsl http jemalloc kerberos ldap libcxx memstat
21 +minuit mysql odbc +opengl oracle postgres prefix pythia6 pythia8
22 +python qt5 R +roofit root7 shadow sqlite +ssl table +tbb test
23 +threads +tiff +tmva +unuran vc xinetd +xml xrootd"
25 SLOT="$(ver_cut 1-2)/$(ver_cut 3)"
26 LICENSE="LGPL-2.1 freedist MSttfEULA LGPL-3 libpng UoI-NCSA"
27 KEYWORDS="~amd64 ~x86"
30 !X? ( !asimage !opengl !qt5 !tiff )
31 python? ( ${PYTHON_REQUIRED_USE} )
39 fortran? ( dev-lang/cfortran )
43 media-libs/freetype:2=
66 media-libs/libafterimage[gif,jpeg,png,tiff?]
67 >=x11-wm/afterstep-2.2.11[gif,jpeg,png,tiff?]
69 avahi? ( net-dns/avahi[mdnsresponder-compat] )
70 davix? ( net-libs/davix )
71 emacs? ( virtual/emacs )
72 fftw? ( sci-libs/fftw:3.0= )
73 fits? ( sci-libs/cfitsio:0= )
74 graphviz? ( media-gfx/graphviz:0= )
76 http? ( dev-libs/fcgi:0= )
77 jemalloc? ( dev-libs/jemalloc )
78 kerberos? ( virtual/krb5 )
79 ldap? ( net-nds/openldap:0= )
80 libcxx? ( sys-libs/libcxx )
81 unuran? ( sci-mathematics/unuran:0= )
82 minuit? ( !sci-libs/minuit )
83 mysql? ( virtual/mysql )
84 odbc? ( || ( dev-db/libiodbc dev-db/unixODBC ) )
85 oracle? ( dev-db/oracle-instantclient-basic )
86 postgres? ( dev-db/postgresql:= )
87 pythia6? ( sci-physics/pythia:6= )
88 pythia8? ( sci-physics/pythia:8= )
89 python? ( ${PYTHON_DEPS} )
91 shadow? ( virtual/shadow )
92 sqlite? ( dev-db/sqlite:3 )
93 ssl? ( dev-libs/openssl:0= )
95 tmva? ( dev-python/numpy[${PYTHON_USEDEP}] )
97 xml? ( dev-libs/libxml2:2= )
98 xrootd? ( net-libs/xrootd:0= )
105 xinetd? ( sys-apps/xinetd )"
108 "${FILESDIR}"/${PN}-6.11.02-hsimple.patch
109 "${FILESDIR}"/${PN}-6.12.04-no-ocaml.patch
110 "${FILESDIR}"/${PN}-6.12.04-no-opengl.patch
111 "${FILESDIR}"/${PN}-6.12.04-z3.patch
115 use fortran && fortran-2_pkg_setup
116 use python && python-single-r1_pkg_setup
119 elog "There are extra options on packages not yet in Gentoo:"
120 elog "Afdsmgrd, AliEn, castor, Chirp, dCache, gfal, Globus, gLite,"
121 elog "HDFS, Monalisa, MaxDB/SapDB, SRP, VecCore."
122 elog "You can use the env variable EXTRA_ECONF variable for this."
123 elog "For example, for Chirp, you would set: "
124 elog "EXTRA_ECONF=\"-Dchirp=ON\""
129 cmake-utils_src_prepare
131 sed -i "/CLING_BUILD_PLUGINS/d" interpreter/CMakeLists.txt || die
133 # CSS should use local images
134 sed -i -e 's,http://.*/,,' etc/html/ROOT.css || die "html sed failed"
137 # Note: ROOT uses bundled clang because it is patched and API-incompatible
138 # with vanilla clang. The patches enable the C++ interpreter to work.
139 # Since ROOT installs many small files into /etc (~100MB in total),
140 # we install it into another directory to avoid making /etc too big.
144 -DCMAKE_C_FLAGS="${CFLAGS}"
145 -DCMAKE_CXX_FLAGS="${CXXFLAGS}"
146 -DCMAKE_INSTALL_PREFIX="${EPREFIX%/}/usr/$(get_libdir)/${PN}/$(ver_cut 1-2)"
147 -DCMAKE_INSTALL_MANDIR="${EPREFIX%/}/usr/$(get_libdir)/${PN}/$(ver_cut 1-2)/share/man"
148 -DMCAKE_INSTALL_LIBDIR=$(get_libdir)
149 -DDEFAULT_SYSROOT="${EPREFIX}"
156 -Dbuiltin_afterimage=OFF
157 -Dbuiltin_cfitsio=OFF
160 -Dbuiltin_freetype=OFF
167 -Dbuiltin_openssl=OFF
173 -Dbuiltin_veccore=OFF
180 -Dafs=OFF # not implemented
182 -Dasimage=$(usex asimage)
183 -Dastiff=$(usex tiff)
184 -Dbonjour=$(usex avahi)
185 -Dlibcxx=$(usex libcxx)
186 -Dccache=OFF # use ccache via portage
189 -Dcling=ON # cling=OFF is broken
191 -Dcxx14=$(usex root7)
192 -Dcxxmodules=OFF # requires clang, unstable
193 -Ddavix=$(usex davix)
196 -Dfitsio=$(usex fits)
197 -Dfortran=$(usex fortran)
198 -Dftgl=$(usex opengl)
200 -Dgenvector=ON # genvector=OFF ignored
203 -Dgl2ps=$(usex opengl)
204 -Dglite=OFF # not implemented
208 -Dgsl_shared=$(usex gsl)
209 -Dgviz=$(usex graphviz)
213 -Djemalloc=$(usex jemalloc)
214 -Dkrb5=$(usex kerberos)
216 -Dmathmore=$(usex gsl)
217 -Dmemstat=$(usex memstat)
219 -Dminuit2=$(usex minuit)
220 -Dminuit=$(usex minuit)
222 -Dmysql=$(usex mysql)
224 -Dopengl=$(usex opengl)
225 -Doracle=$(usex oracle)
226 -Dpch=ON # pch=OFF is broken
227 -Dpgsql=$(usex postgres)
228 -Dpythia6=$(usex pythia6)
229 -Dpythia8=$(usex pythia8)
230 -Dpython=$(usex python)
235 -Droofit=$(usex roofit)
236 -Droot7=$(usex root7)
238 -Droottest=$(usex test)
239 -Drpath=ON # needed for multi-slot to work
240 -Druby=OFF # deprecated and broken
241 -Druntime_cxxmodules=OFF # does not work yet
243 -Dsapdb=OFF # not implemented
244 -Dshadowpw=$(usex shadow)
245 -Dsqlite=$(usex sqlite)
246 -Dsrp=OFF # not implemented
248 -Dtable=$(usex table)
251 -Dtesting=$(usex test)
252 -Dthread=$(usex threads)
254 -Dunuran=$(usex unuran)
259 -Dxrootd=$(usex xrootd)
263 cmake-utils_src_configure
267 cmake-utils_src_install
269 ROOTSYS=${EPREFIX%/}/usr/$(get_libdir)/${PN}/$(ver_cut 1-2)
270 ROOTENV=$((9999 - $(ver_cut 2)))${PN}-$(ver_cut 1-2)
272 # ROOT fails without this symlink because it only looks in lib
273 if [[ ! -d ${D}/${ROOTSYS}/lib ]]; then
274 dosym $(get_libdir) /usr/$(get_libdir)/${PN}/$(ver_cut 1-2)/lib
277 cat > ${ROOTENV} <<- EOF || die
278 MANPATH="${ROOTSYS}/share/man"
279 PATH="${ROOTSYS}/bin"
280 ROOTPATH="${ROOTSYS}/bin"
281 LDPATH="${ROOTSYS}/$(get_libdir)"
285 echo "PYTHONPATH=${ROOTSYS}/$(get_libdir)" >> ${ROOTENV} || die
290 pushd "${D}/${ROOTSYS}" > /dev/null
293 elisp-install ${PN}-$(ver_cut 1-2) "${BUILD_DIR}"/root-help.el
300 if ! use examples; then
301 rm -r test tutorials || die
308 # clean up unnecessary files from installation
309 rm -r config emacs etc/vmc || die