1 # Copyright 1999-2019 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_{5,6,7} )
11 inherit cmake-utils cuda eapi7-ver elisp-common eutils fortran-2 \
12 llvm 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 +davix debug emacs
18 +examples fits fftw fortran +gdml graphviz +gsl http libcxx +minuit
19 mysql nosplash odbc +opengl oracle postgres prefix pythia6 pythia8
20 +python qt5 R +roofit root7 shadow sqlite +ssl +tbb test +tmva
21 +unuran vc vmc +xml xrootd"
23 if [[ ${PV} =~ "9999" ]] ; then
26 EGIT_REPO_URI="http://root.cern/git/root.git"
27 if [[ ${PV} == "9999" ]]; then
30 SLOT="$(ver_cut 1-2)/$(ver_cut 3)"
31 EGIT_BRANCH="v$(ver_cut 1)-$(ver_cut 2)-00-patches"
34 KEYWORDS="~amd64 ~x86"
35 SRC_URI="https://root.cern/download/${PN}_v${PV}.source.tar.gz"
38 LICENSE="LGPL-2.1 freedist MSttfEULA LGPL-3 libpng UoI-NCSA"
41 ^^ ( c++11 c++14 c++17 )
43 !X? ( !asimage !opengl !qt5 )
45 python? ( ${PYTHON_REQUIRED_USE} )
47 root7? ( || ( c++14 c++17 ) )
54 fortran? ( dev-lang/cfortran )
78 dev-qt/qtwebengine:5[widgets]
81 asimage? ( media-libs/libafterimage[gif,jpeg,png,tiff] )
82 cuda? ( >=dev-util/nvidia-cuda-toolkit-9.0 )
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 )
88 gsl? ( sci-libs/gsl:= )
89 http? ( dev-libs/fcgi:0= )
90 libcxx? ( sys-libs/libcxx )
91 unuran? ( sci-mathematics/unuran:0= )
92 minuit? ( !sci-libs/minuit )
93 mysql? ( dev-db/mysql-connector-c )
94 odbc? ( || ( dev-db/libiodbc dev-db/unixODBC ) )
95 oracle? ( dev-db/oracle-instantclient-basic )
96 postgres? ( dev-db/postgresql:= )
97 pythia6? ( sci-physics/pythia:6 )
98 pythia8? ( sci-physics/pythia:8 )
99 python? ( ${PYTHON_DEPS} )
101 shadow? ( virtual/shadow )
102 sqlite? ( dev-db/sqlite:3 )
103 ssl? ( dev-libs/openssl:0= )
104 tbb? ( >=dev-cpp/tbb-2018 )
105 tmva? ( dev-python/numpy[${PYTHON_USEDEP}] )
106 vc? ( dev-libs/vc:= )
107 xml? ( dev-libs/libxml2:2= )
108 xrootd? ( net-libs/xrootd:0= )
117 "${FILESDIR}"/${PN}-6.12.06_cling-runtime-sysroot.patch
121 LLVM_MAX_SLOT=5 llvm_pkg_setup
123 use fortran && fortran-2_pkg_setup
124 use python && python-single-r1_pkg_setup
126 elog "There are extra options on packages not available in Gentoo."
127 elog "You can use the environment variable EXTRA_ECONF to enable"
128 elog "these packages. For example, for Vdt you would set:"
129 elog "EXTRA_ECONF=\"-Dbuiltin_vdt=ON -Dvdt=ON\""
133 cmake-utils_src_prepare
135 sed -i "/CLING_BUILD_PLUGINS/d" interpreter/CMakeLists.txt || die
137 # CSS should use local images
138 sed -i -e 's,http://.*/,,' etc/html/ROOT.css || die "html sed failed"
140 if use nosplash; then
141 sed -i -e '/bool gNoLogo/s@false@true@' rootx/src/rootx.cxx
145 # Note: ROOT uses bundled clang because it is patched and API-incompatible
146 # with vanilla clang. The patches enable the C++ interpreter to work.
147 # Since ROOT installs many files into /etc (>100MB in total) that don't
148 # really belong there, we install it into another directory to avoid
149 # making /etc too big.
153 -DCMAKE_C_FLAGS="${CFLAGS}"
154 -DCMAKE_CXX_FLAGS="${CXXFLAGS}"
155 -DCMAKE_CXX_STANDARD=$((usev c++11 || usev c++14 || usev c++17) | cut -c4-)
156 -DLLVM_CONFIG="$(type -P "${CHOST}-llvm-config")"
157 -DCMAKE_INSTALL_PREFIX="${EPREFIX%/}/usr/lib/${PN}/$(ver_cut 1-2)"
158 -DCMAKE_INSTALL_MANDIR="${EPREFIX%/}/usr/lib/${PN}/$(ver_cut 1-2)/share/man"
159 -DCMAKE_INSTALL_LIBDIR="lib"
160 -DDEFAULT_SYSROOT="${EPREFIX}"
161 -DCLING_BUILD_PLUGINS=OFF
170 -Dbuiltin_afterimage=OFF
171 -Dbuiltin_cfitsio=OFF
174 -Dbuiltin_freetype=OFF
181 -Dbuiltin_openssl=OFF
187 -Dbuiltin_veccore=OFF
194 -Dasimage=$(usex asimage)
195 -Dlibcxx=$(usex libcxx)
196 -Dccache=OFF # use ccache via portage
201 -Dcxxmodules=OFF # requires clang, unstable
202 -Ddavix=$(usex davix)
205 -Dfitsio=$(usex fits)
206 -Dfortran=$(usex fortran)
207 -Dftgl=$(usex opengl)
210 -Dgl2ps=$(usex opengl)
212 -Dgsl_shared=$(usex gsl)
213 -Dgviz=$(usex graphviz)
216 -Dmathmore=$(usex gsl)
217 -Dmemstat=OFF # deprecated
219 -Dminuit2=$(usex minuit)
220 -Dminuit=$(usex minuit)
223 -Dmysql=$(usex mysql)
225 -Dopengl=$(usex opengl)
226 -Doracle=$(usex oracle)
227 -Dpgsql=$(usex postgres)
228 -Dpythia6=$(usex pythia6)
229 -Dpythia8=$(usex pythia8)
230 -Dpython=$(usex python)
232 -Droofit=$(usex roofit)
233 -Droot7=$(usex root7)
237 -Druntime_cxxmodules=OFF # does not work yet
239 -Dshadowpw=$(usex shadow)
240 -Dsqlite=$(usex sqlite)
243 -Dtesting=$(usex test)
245 -Dtmva-cpu=$(usex tmva)
246 -Dtmva-gpu=$(usex cuda)
247 -Dunuran=$(usex unuran)
253 -Dxrootd=$(usex xrootd)
257 CMAKE_BUILD_TYPE=$(usex debug Debug Release) \
258 cmake-utils_src_configure
262 # needed for hsimple.root
264 cmake-utils_src_compile
268 cmake-utils_src_install
270 ROOTSYS=${EPREFIX%/}/usr/lib/${PN}/$(ver_cut 1-2)
272 if [[ ${PV} == "9999" ]]; then
273 ROOTENV="9900${PN}-git"
275 ROOTENV="$((9999 - $(ver_cut 2)))${PN}-$(ver_cut 1-2)-git"
278 cat > ${ROOTENV} <<- EOF || die
279 MANPATH="${ROOTSYS}/share/man"
280 PATH="${ROOTSYS}/bin"
281 ROOTPATH="${ROOTSYS}/bin"
282 LDPATH="${ROOTSYS}/lib"
286 echo "PYTHONPATH=\"${ROOTSYS}/lib\"" >> ${ROOTENV} || die
292 elisp-install ${PN}-$(ver_cut 1-2) "${BUILD_DIR}"/root-help.el
295 pushd "${D}/${ROOTSYS}" > /dev/null
297 rm -r emacs bin/*.{csh,sh,fish} || die
299 if ! use examples; then
300 rm -r tutorials || die
303 # create versioned symlinks for binaries
304 if [[ ! ${PV} == "9999" ]]; then
307 dosym "${exe}" "/usr/lib/${PN}/$(ver_cut 1-2)/bin/${exe}-$(ver_cut 1-2)"