blob: 4a74d2e9e3cf88dba9e505295ad77b0c2b49dbd3 (
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
|
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
inherit autotools
DESCRIPTION="System for computational discrete algebra. Core functionality."
HOMEPAGE="https://www.gap-system.org/"
SRC_URI="https://github.com/gap-system/gap/releases/download/v${PV}/${P}-core.tar.gz"
LICENSE="GPL-2+"
SLOT="0/8"
KEYWORDS="~amd64"
IUSE="cpu_flags_x86_popcnt debug emacs memcheck readline valgrind"
REQUIRED_USE="?? ( memcheck valgrind )"
RESTRICT=test
DEPEND="dev-libs/gmp:=
sys-libs/zlib
valgrind? ( dev-util/valgrind )
readline? ( sys-libs/readline:= )"
RDEPEND="${DEPEND}"
pkg_setup() {
if use valgrind; then
elog "If you enable the use of valgrind during building"
elog "be sure that you have enabled the proper flags"
elog "in gcc to support it:"
elog "https://wiki.gentoo.org/wiki/Debugging#Valgrind"
fi
}
src_prepare() {
# Remove these to be extra sure we don't use bundled libraries.
rm -r extern || die
rm -r hpcgap/extern || die
# The Makefile just tells you to run ./configure, which then
# produces a GNUmakefile.
rm Makefile || die
default
# Fix feature detection with pathological CFLAGS
eautoreconf
}
src_configure() {
# We unset $ABI because GAP uses it internally for something else.
# --without-gmp and --without-zlib both trigger an AC_MSG_ERROR
econf \
ABI="" \
--with-gmp \
--with-zlib \
$(use_enable cpu_flags_x86_popcnt popcnt) \
$(use_enable memcheck memory-checking) \
$(use_enable valgrind) \
$(use_with readline) \
$(use_enable debug)
}
src_compile() {
# Without this, the default is a quiet build.
emake V=1
}
src_install() {
default
# Manually install Makefile.gappkg
insinto usr/share/gap/etc
doins etc/Makefile.gappkg
# la files removal
find "${ED}" -type f -name '*.la' -delete || die
}
|