aboutsummaryrefslogtreecommitdiff
blob: deaf458a0e3ec526a236ac7a5f66cd2b5cfff305 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

EAPI=5

inherit cmake-utils versionator git-r3

if [[ ${PV} == *9999* ]]; then
	EGIT_REPO_URI=" http://root.cern.ch/git/geant4_vmc.git"
	KEYWORDS=""
else
	MPV=$(get_version_component_range 2-)
	SRC_URI="ftp://root.cern.ch/root/vmc/geant4_vmc.${MPV}.tar.gz"
	KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
fi

DESCRIPTION="Virtual Monte Carlo Geant4 implementation"
HOMEPAGE="http://root.cern.ch/root/vmc/VirtualMC.html"

LICENSE="GPL-2"
SLOT="4"
IUSE="doc examples geant3 +g4root +mtroot vgm test"

RDEPEND="
	sci-physics/root:=
	>=sci-physics/geant-4.9.6[opengl,geant3?]
	vgm? ( >=sci-physics/vgm-4.00 )"
DEPEND="${RDEPEND}
	doc? ( app-doc/doxygen )"

src_configure() {
	local mycmakeargs=(
			$(cmake-utils_use vgm Geant4VMC_USE_VGM)
			$(cmake-utils_use geant3 Geant4VMC_USE_GEANT4_G3TOG4)
			$(cmake-utils_use g4root Geant4VMC_USE_G4Root)
			$(cmake-utils_use mtroot Geant4VMC_USE_MTRoot)
			$(cmake-utils_use test Geant4VMC_BUILD_EXAMPLES)
			$(cmake-utils_use examples Geant4VMC_INSTALL_EXAMPLES)
			)
	cmake-utils_src_configure
}

src_compile() {
	cmake-utils_src_compile
	local dirs="source"
	use g4root && dirs+=" g4root "
	use mtroot && dirs+=" mtroot "
	use examples && dirs+=" examples "
	local d
	for d in ${dirs}; do
		pushd ${d} > /dev/null || die
		if use doc; then
			doxygen || die
		fi
		popd > /dev/null
	done
}

src_test() {
	cd examples || die
	./test_suite.sh --g3=off --builddir="${BUILD_DIR}" || die
	./test_suite_exe.sh --g3=off --builddir="${BUILD_DIR}" || die
}

src_install() {
	cmake-utils_src_install
	dodoc README history
	use doc && dohtml -r Geant4VMC.html doc/*
}