aboutsummaryrefslogtreecommitdiff
blob: 2109a907cd9a785e69b3add38fe5d629d4d0366f (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
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

EAPI=5

inherit versionator

MPV=$(get_version_component_range 2-)

DESCRIPTION="Virtual Monte Carlo Geant4 implementation"
HOMEPAGE="http://root.cern.ch/root/vmc/VirtualMC.html"
SRC_URI="http://root.cern.ch/download/vmc/geant4_vmc.${MPV}.tar.gz"

LICENSE="GPL-2"
SLOT="4"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE="doc examples vgm"

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

S="${WORKDIR}/geant4_vmc"

src_compile() {
	use vgm && export USE_VGM=1
	local dirs="g4root source"
	use examples && dirs+=" examples"
	local d
	source $(ls -1 "${EROOT}"usr/share/Geant4-*/geant4make/geant4make.sh) || die
	for d in ${dirs}; do
		pushd ${d} > /dev/null || die
		default
		if use doc; then
			doxygen || die
		fi
		popd > /dev/null
	done
}

src_test() {
	cd examples || die
	default
	./run_suite.sh || die
}

src_install() {
	dolib.so lib/tgt_*/{libg4root,libgeant4vmc}.so
	doheader -r include/*
	dodoc README history version_number
	use doc && dohtml -r Geant4VMC.html doc/*
	if use examples; then
		insinto /usr/share/doc/${PF}
		emake -C examples clean
		doins -r examples
	fi
}