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

EAPI=7

inherit autotools git-r3 pax-utils

DESCRIPTION="System performance benchmark"
HOMEPAGE="https://github.com/akopytov/sysbench"
EGIT_REPO_URI="https://github.com/akopytov/sysbench.git"

LICENSE="GPL-2+"
SLOT="0"
KEYWORDS=""
IUSE="aio mysql postgres test"
RESTRICT="!test? ( test )"

RDEPEND="aio? ( dev-libs/libaio )
	mysql? ( dev-db/mysql-connector-c:= )
	postgres? ( dev-db/postgresql:= )
	dev-lang/luajit:="
DEPEND="${RDEPEND}
	dev-libs/concurrencykit
	dev-libs/libxslt
	sys-devel/libtool
	virtual/pkgconfig
	test? ( dev-util/cram )"

src_prepare() {
	default

	# remove bundled libs
	rm -r third_party/luajit/luajit third_party/concurrency_kit/ck third_party/cram || die

	eautoreconf
}

src_configure() {
	local myeconfargs=(
		$(use_enable aio)
		$(use_with mysql)
		$(use_with postgres pgsql)
		--with-system-luajit
		--with-system-ck
	)

	econf "${myeconfargs[@]}"
}

src_test() {
	emake check test
}

src_install() {
	default

	pax-mark m "${ED}"/usr/bin/${PN}
}