aboutsummaryrefslogtreecommitdiff
blob: 0e2b3fc3ab1f62993b7892ff7b86c3c5ffee7efc (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
71
72
73
74
75
76
77
78
79
80
# Copyright 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit fortran-2

MY_PN="TAUOLA"
MY_P=${MY_PN}.${PV}

DESCRIPTION="Tau decay Monte Carlo generator"
HOMEPAGE="http://tauolapp.web.cern.ch/"
SRC_URI="https://tauolapp.web.cern.ch/resources/${MY_P}/${MY_P}.tar.gz"
S="${WORKDIR}/${MY_PN}"

LICENSE="GPL-3+"
SLOT="0"
KEYWORDS="~amd64 ~x86"
IUSE="+hepmc3 +lhapdf doc examples hepmc2 pythia tau-spinner"
REQUIRED_USE=" || ( hepmc2 hepmc3 ) tau-spinner? ( lhapdf )"

RDEPEND="
	hepmc2? ( sci-physics/hepmc:2=[-cm(-),gev(+)] )
	hepmc3? ( sci-physics/hepmc:3=[-cm(-),gev(+)] )
	pythia? ( sci-physics/pythia:8= )
	lhapdf? ( sci-physics/lhapdf )
"
DEPEND="${RDEPEND}"
BDEPEND="
	doc? (
		app-text/doxygen[dot]
		app-text/ghostscript-gpl
		app-text/texlive
	)
"

PATCHES=(
	"${FILESDIR}"/${PN}-1.1.8-tau-spinner-makefile-install.patch
)

src_configure() {
	econf \
		$(use_with lhapdf) \
		$(use_with tau-spinner) \
		$(use_with pythia pythia8 "${EPREFIX}/usr") \
		$(use_with hepmc2 hepmc "${EPREFIX}/usr") \
		$(use_with hepmc3 hepmc3 "${EPREFIX}/usr") \
		--without-mc-tester
	# weird autoconf + Makefile
	cat <<-EOF >> make.inc || die
	LDFLAGS += ${LDFLAGS}
	CFLAGS += ${CFLAGS}
	FFLAGS += ${FFLAGS}
	EOF
}

src_compile() {
	emake -j1

	if use doc; then
		cd "${S}/documentation/doxy_documentation" || die
		default
		cd "${S}/documentation/latex_documentation" || die
		default
	fi
}

src_install() {
	emake DESTDIR="${D}" install

	if use doc; then
		dodoc documentation/doxy_documentation/html/*
		dodoc documentation/latex_documentation/*.pdf
	fi

	if use examples; then
		dodoc -r examples
		docinto tau-spinner && dodoc -r TauSpinner/examples
	fi
}