summaryrefslogtreecommitdiff
blob: d696ca7b9817919b26fd1ffbdecb6924e08c7435 (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
# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

inherit autotools toolchain-funcs

DESCRIPTION="Tool for computations in affine monoids and more"
HOMEPAGE="http://www.mathematik.uni-osnabrueck.de/normaliz/"
SRC_URI="https://github.com/Normaliz/Normaliz/archive/v${PV}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/Normaliz-${PV}"

LICENSE="GPL-3"
SLOT="0/3"
KEYWORDS="~amd64 ~arm ~riscv ~x86 ~amd64-linux ~x86-linux"
IUSE="doc extras openmp"

# would be nice to package scip and cocoalib
RDEPEND="
	dev-libs/gmp:=[cxx(+)]
"
DEPEND="
	${RDEPEND}
	dev-libs/boost
"
# Only a boost header is needed -> not RDEPEND

pkg_pretend() {
	[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
}

pkg_setup() {
	[[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp
}

src_prepare() {
	default
	eautoreconf
}

src_configure() {
	econf \
		$(use_enable openmp) \
		--disable-static
}

src_test() {
	emake check
}

src_install() {
	default
	find "${ED}" -name "*.la" -delete || die

	use doc && dodoc doc/Normaliz.pdf
	if use extras; then
		newdoc Singular/normaliz.pdf singular-normaliz.pdf
		insinto /usr/share/${PN}
		doins Singular/normaliz.lib
		doins Macaulay2/Normaliz.m2
	fi
}