1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 # ninja does not work due to fortran
7 CMAKE_MAKEFILE_GENERATOR=emake
8 FORTRAN_NEEDED="fortran"
9 PYTHON_COMPAT=( python2_7 python3_{6,7,8} )
11 inherit cmake-utils cuda eapi7-ver elisp-common eutils fortran-2 \
12 prefix python-single-r1 toolchain-funcs
14 DESCRIPTION="C++ data analysis framework and interpreter from CERN"
15 HOMEPAGE="https://root.cern"
17 IUSE="+X aqua +asimage +c++11 c++14 c++17 cuda cudnn +davix debug emacs
18 +examples fits fftw fortran +gdml graphviz +gsl http libcxx +minuit
19 mpi mysql odbc +opengl oracle postgres prefix pythia6 pythia8 +python
20 qt5 R +roofit root7 shadow sqlite +ssl +tbb test +tmva +unuran vc
22 RESTRICT="!test? ( test )"
24 if [[ ${PV} =~ "9999" ]] ; then
27 EGIT_REPO_URI="http://root.cern/git/root.git"
28 if [[ ${PV} == "9999" ]]; then
31 SLOT="$(ver_cut 1-2)/$(ver_cut 3)"
32 EGIT_BRANCH="v$(ver_cut 1)-$(ver_cut 2)-00-patches"
35 KEYWORDS="~amd64 ~x86"
36 SRC_URI="https://root.cern/download/${PN}_v${PV}.source.tar.gz"
39 LICENSE="LGPL-2.1 freedist MSttfEULA LGPL-3 libpng UoI-NCSA"
42 ^^ ( c++11 c++14 c++17 )
45 !X? ( !asimage !opengl !qt5 )
47 python? ( ${PYTHON_REQUIRED_USE} )
49 root7? ( || ( c++14 c++17 ) )
57 fortran? ( dev-lang/cfortran )
80 dev-qt/qtwebengine:5[widgets]
83 asimage? ( media-libs/libafterimage[gif,jpeg,png,tiff] )
84 cuda? ( >=dev-util/nvidia-cuda-toolkit-9.0 )
85 cudnn? ( dev-libs/cudnn )
86 davix? ( net-libs/davix )
87 emacs? ( >=app-editors/emacs-23.1:* )
88 fftw? ( sci-libs/fftw:3.0= )
89 fits? ( sci-libs/cfitsio:0= )
90 graphviz? ( media-gfx/graphviz )
91 gsl? ( sci-libs/gsl:= )
92 http? ( dev-libs/fcgi:0= )
93 libcxx? ( sys-libs/libcxx )
94 unuran? ( sci-mathematics/unuran:0= )
95 minuit? ( !sci-libs/minuit )
97 mysql? ( dev-db/mysql-connector-c )
98 odbc? ( || ( dev-db/libiodbc dev-db/unixODBC ) )
99 oracle? ( dev-db/oracle-instantclient-basic )
100 postgres? ( dev-db/postgresql:= )
101 pythia6? ( sci-physics/pythia:6 )
102 pythia8? ( sci-physics/pythia:8 )
103 python? ( ${PYTHON_DEPS} )
105 shadow? ( sys-apps/shadow )
106 sqlite? ( dev-db/sqlite:3 )
107 ssl? ( dev-libs/openssl:0= )
108 tbb? ( >=dev-cpp/tbb-2018 )
110 $(python_gen_cond_dep '
111 dev-python/numpy[${PYTHON_MULTI_USEDEP}]
114 vc? ( dev-libs/vc:= )
115 xml? ( dev-libs/libxml2:2= )
116 xrootd? ( net-libs/xrootd:0= )
125 "${FILESDIR}"/${PN}-6.12.06_cling-runtime-sysroot.patch
129 use fortran && fortran-2_pkg_setup
130 use python && python-single-r1_pkg_setup
132 elog "There are extra options on packages not available in Gentoo."
133 elog "You can use the environment variable EXTRA_ECONF to enable"
134 elog "these packages. For example, for Vdt you would set:"
135 elog "EXTRA_ECONF=\"-Dbuiltin_vdt=ON -Dvdt=ON\""
139 use cuda && cuda_src_prepare
141 cmake-utils_src_prepare
143 sed -i "/CLING_BUILD_PLUGINS/d" interpreter/CMakeLists.txt || die
145 # CSS should use local images
146 sed -i -e 's,http://.*/,,' etc/html/ROOT.css || die "html sed failed"
149 # Note: ROOT uses bundled clang because it is patched and API-incompatible
150 # with vanilla clang. The patches enable the C++ interpreter to work.
151 # Since ROOT installs many files into /etc (>100MB in total) that don't
152 # really belong there, we install it into another directory to avoid
153 # making /etc too big.
157 -DCMAKE_C_COMPILER=$(tc-getCC)
158 -DCMAKE_CXX_COMPILER=$(tc-getCXX)
159 -DCMAKE_CUDA_HOST_COMPILER=$(tc-getCXX)
160 -DCMAKE_C_FLAGS="${CFLAGS}"
161 -DCMAKE_CXX_FLAGS="${CXXFLAGS}"
162 -DCMAKE_CXX_STANDARD=$((usev c++11 || usev c++14 || usev c++17) | cut -c4-)
163 -DPYTHON_EXECUTABLE="${EPREFIX}/usr/bin/${EPYTHON}"
164 -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr/lib/${PN}/$(ver_cut 1-2)"
165 -DCMAKE_INSTALL_MANDIR="${EPREFIX}/usr/lib/${PN}/$(ver_cut 1-2)/share/man"
166 -DCMAKE_INSTALL_LIBDIR="lib"
167 -DDEFAULT_SYSROOT="${EPREFIX}"
168 -DCLING_BUILD_PLUGINS=OFF
177 -Dbuiltin_afterimage=OFF
178 -Dbuiltin_cfitsio=OFF
181 -Dbuiltin_freetype=OFF
188 -Dbuiltin_openssl=OFF
194 -Dbuiltin_veccore=OFF
202 -Dasimage=$(usex asimage)
203 -Dlibcxx=$(usex libcxx)
204 -Dccache=OFF # use ccache via portage
209 -Dcudnn=$(usex cudnn)
210 -Dcxxmodules=OFF # requires clang, unstable
211 -Ddavix=$(usex davix)
216 -Dfitsio=$(usex fits)
217 -Dfortran=$(usex fortran)
218 -Dftgl=$(usex opengl)
221 -Dgl2ps=$(usex opengl)
223 -Dgsl_shared=$(usex gsl)
224 -Dgviz=$(usex graphviz)
227 -Dmathmore=$(usex gsl)
228 -Dmemstat=OFF # deprecated
230 -Dminuit2=$(usex minuit)
231 -Dminuit=$(usex minuit)
235 -Dmysql=$(usex mysql)
237 -Dopengl=$(usex opengl)
238 -Doracle=$(usex oracle)
239 -Dpgsql=$(usex postgres)
240 -Dpythia6=$(usex pythia6)
241 -Dpythia8=$(usex pythia8)
242 -Dpyroot=$(usex python) # python was renamed to pyroot
243 -Dpython=$(usex python) # kept for backward compatibility
244 -Dpyroot_experimental=OFF # use standard PyROOT for now
246 -Droofit=$(usex roofit)
247 -Droot7=$(usex root7)
251 -Druntime_cxxmodules=OFF # does not work yet
253 -Dshadowpw=$(usex shadow)
254 -Dsqlite=$(usex sqlite)
257 -Dtesting=$(usex test)
259 -Dtmva-cpu=$(usex tmva)
260 -Dtmva-gpu=$(usex cuda)
261 -Dunuran=$(usex unuran)
267 -Dxrootd=$(usex xrootd)
271 CMAKE_BUILD_TYPE=$(usex debug Debug Release) \
272 cmake-utils_src_configure
276 # needed for hsimple.root
278 cmake-utils_src_compile
282 cmake-utils_src_install
284 ROOTSYS=${EPREFIX}/usr/lib/${PN}/$(ver_cut 1-2)
286 if [[ ${PV} == "9999" ]]; then
287 ROOTENV="9900${PN}-git"
289 ROOTENV="$((9999 - $(ver_cut 2)))${PN}-$(ver_cut 1-2)-git"
292 cat > ${ROOTENV} <<- EOF || die
293 MANPATH="${ROOTSYS}/share/man"
294 PATH="${ROOTSYS}/bin"
295 ROOTPATH="${ROOTSYS}/bin"
296 LDPATH="${ROOTSYS}/lib"
300 echo "PYTHONPATH=\"${ROOTSYS}/lib\"" >> ${ROOTENV} || die
306 elisp-install ${PN}-$(ver_cut 1-2) "${BUILD_DIR}"/root-help.el
309 pushd "${D}/${ROOTSYS}" > /dev/null
311 rm -r emacs bin/*.{csh,sh,fish} || die
313 if ! use examples; then
314 rm -r tutorials || die
317 # create versioned symlinks for binaries
318 if [[ ! ${PV} == "9999" ]]; then
321 dosym "${exe}" "/usr/lib/${PN}/$(ver_cut 1-2)/bin/${exe}-$(ver_cut 1-2)"