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

EAPI=7

inherit autotools

DESCRIPTION="A compressed bitset with supporting data structures and algorithms"
HOMEPAGE="https://github.com/chriso/bitset"
SRC_URI="https://github.com/chriso/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="LGPL-2.1"
SLOT="0"
IUSE="jemalloc static-libs tcmalloc"
KEYWORDS="amd64 ~arm x86"

RDEPEND="
	tcmalloc? ( dev-util/google-perftools:= )
	jemalloc? ( >=dev-libs/jemalloc-3.2 )
"
DEPEND="${RDEPEND}"

REQUIRED_USE="?? ( jemalloc tcmalloc )"

DOCS=( README.md )

src_prepare() {
	default
	eautoreconf
}

src_configure() {
	local tcmalloc_lib_name='tcmalloc'

	has_version dev-util/google-perftools[minimal] && tcmalloc_lib_name='tcmalloc_minimal'

	local myeconfargs=(
		$(use_with jemalloc) \
		$(use_with tcmalloc) \
		$(use_with tcmalloc tcmalloc-lib "${tcmalloc_lib_name}")
	)

	econf "${myeconfargs[@]}"
}

src_install() {
	default

	find "${ED}" -name '*.la' -delete || die
}