summaryrefslogtreecommitdiff
path: root/sci-physics/fastjet/fastjet-3.4.2.ebuild
blob: b090ff59f0e8347a0c55e3ac47ccae8e9a0b0fd6 (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
81
82
83
84
# Copyright 2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

FORTRAN_NEEDED=plugins
PYTHON_COMPAT=( python3_{10..12} )
DOCS_BUILDER="doxygen"
DOCS_DEPEND="
	media-gfx/graphviz
	media-libs/freetype
	virtual/latex-base
"

inherit autotools docs flag-o-matic fortran-2 python-single-r1

DESCRIPTION="A software package for jet finding in pp and e+e- collisions"
HOMEPAGE="https://fastjet.fr/"
SRC_URI="https://fastjet.fr/repo/${P}.tar.gz"

LICENSE="GPL-2+"
SLOT="0"
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
IUSE="cgal examples python +plugins"
REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"

# cgal is header-only in version 5.4 and up. We need to use the
# special --enable-cgal-header-only argument to use these versions.
DEPEND="
	cgal? ( >=sci-mathematics/cgal-5.4:=[shared(+)] )
	plugins? ( sci-physics/siscone:= )
	python? ( ${PYTHON_DEPS} )
"
RDEPEND="${DEPEND}"
BDEPEND="app-shells/bash"

PATCHES=(
	"${FILESDIR}"/${PN}-3.4.0-system-siscone.patch
	"${FILESDIR}"/${PN}-3.4.0-gfortran.patch
)

pkg_setup() {
	use python && python-single-r1_pkg_setup
}

src_prepare() {
	default
	eautoreconf
}

src_configure() {
	use cgal && \
		has_version 'sci-mathematics/cgal[gmp]' && append-libs -lgmp
	# only bash compatible
	sed -i 's#/bin/sh#/bin/bash#g' ./configure || die
	econf \
		$(use_enable cgal cgal-header-only) \
		$(use_enable plugins allplugins) \
		$(use_enable plugins allcxxplugins) \
		--enable-shared \
		--enable-static=no \
		--disable-static \
		--disable-auto-ptr  \
		$(use_enable python pyext)
}

src_compile() {
	default
	docs_compile
}

src_install() {
	default
	use python && python_optimize
	if use examples; then
		emake -C example maintainer-clean
		find example -iname 'makefile*' -delete || die

		docinto examples
		dodoc -r example/.
		docompress -x /usr/share/doc/${PF}/examples
	fi
	find "${ED}" -name '*.la' -delete || die
}