1 # Copyright 1999-2017 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
6 inherit cmake-utils versionator
9 SPV="$(get_version_component_range 1 ${PV}).$(get_version_component_range 2 ${PV}).$(printf %1d $(get_version_component_range 3 ${PV}))"
11 DESCRIPTION="Toolkit for simulation of passage of particles through matter"
12 HOMEPAGE="http://geant4.cern.ch/"
13 SRC_URI="http://geant4.cern.ch/support/source/${MY_P}.tar.gz"
17 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
18 IUSE="+data dawn doc examples gdml geant3 inventor motif opengl
19 raytracerx qt4 static-libs vrml zlib threads"
23 >=sci-physics/clhep-2.3.3.0:2=
24 dawn? ( media-gfx/dawn )
25 gdml? ( dev-libs/xerces-c )
26 motif? ( x11-libs/motif:0 )
27 opengl? ( virtual/opengl )
28 inventor? ( media-libs/SoXt )
31 opengl? ( dev-qt/qtopengl:4 )
37 zlib? ( sys-libs/zlib )"
38 DEPEND="${RDEPEND} prefix? ( app-shells/tcsh )"
40 data? ( ~sci-physics/geant-data-${PV} )
41 doc? ( ~app-doc/geant-docs-${PV} )"
43 HTML_DOCS=( ReleaseNotes/ReleaseNotes${SPV}.html )
45 S="${WORKDIR}/${MY_P}"
48 cmake-utils_src_prepare
50 if ! use examples; then
51 sed -i '/install(DIRECTORY examples/,/)/d' CMakeLists.txt || die
57 -DGEANT4_USE_SYSTEM_CLHEP=ON
58 -DGEANT4_INSTALL_DATA=OFF
59 -DUSE_GEANT4_BUILD_MULTITHREADED=$(usex threads)
60 -DUSE_GEANT4_USE_NETWORKDAWN=$(usex dawn)
61 -DUSE_GEANT4_USE_GDML=$(usex gdml)
62 -DUSE_GEANT4_USE_G3TOG4=$(usex geant3)
63 -DUSE_GEANT4_USE_XM=$(usex motif)
64 -DUSE_GEANT4_USE_OPENGL_X11=$(usex opengl)
65 -DUSE_GEANT4_USE_INVENTOR=$(usex inventor)
66 -DUSE_GEANT4_USE_QT=$(usex qt4)
67 -DUSE_GEANT4_USE_RAYTRACER_X11=$(usex raytracerx)
68 -DUSE_GEANT4_USE_NETWORKVRML=$(usex vrml)
69 -DUSE_GEANT4_USE_SYSTEM_ZLIB=$(usex zlib)
70 -DBUILD_STATIC_LIBS=$(usex static-libs)
74 -DINVENTOR_INCLUDE_DIR="$(coin-config --includedir)"
75 -DINVENTOR_SOXT_INCLUDE_DIR="$(coin-config --includedir)"
78 cmake-utils_src_configure
82 # adjust clhep linking flags for system clhep
83 # binmake.gmk is only useful for legacy build systems
84 sed -i -e 's/-lG4clhep/-lCLHEP/' config/binmake.gmk || die
85 cmake-utils_src_install
86 [[ -f ReleaseNotes/Patch${SPV}-1.txt ]] && DOCS+=( ReleaseNotes/Patch${SPV}-*.txt )
91 elog "The following scripts are provided for backward compatibility:"
92 elog "$(ls -1 ${EROOT%/}/usr/share/${PN^}${SPV}.*/geant4make/*sh)"