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

EAPI=8

inherit cmake

DESCRIPTION="C++ bindings for Apache Thrift"
HOMEPAGE="https://thrift.apache.org/lib/cpp.html"
SRC_URI="mirror://apache/thrift/${PV}/${P}.tar.gz"

LICENSE="Apache-2.0"
SLOT="0/${PV}"
KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~ppc64 ~riscv ~s390 ~x86"
IUSE="libevent lua +ssl test"

RESTRICT="!test? ( test )"

DEPEND="
	dev-libs/boost:=[nls(+)]
	dev-libs/openssl:=
	sys-libs/zlib:=
	libevent? ( dev-libs/libevent:= )
"
RDEPEND="${DEPEND}"
BDEPEND="
	app-alternatives/lex
	app-alternatives/yacc
"

REQUIRED_USE="
	test? ( ssl libevent )
"

PATCHES=(
	"${FILESDIR}/thrift-0.16.0-network-tests.patch"
	"${FILESDIR}/thrift-0.18.1-tests.patch"
)

src_configure() {
	local mycmakeargs=(
		-DBUILD_CPP=ON
		-DBUILD_C_GLIB=OFF
		-DBUILD_JAVA=OFF
		-DBUILD_JAVASCRIPT=OFF
		-DBUILD_NODEJS=OFF
		-DBUILD_PYTHON=OFF
		-DBUILD_TESTING=$(usex test 'ON' 'OFF')
		-DWITH_LIBEVENT=$(usex libevent 'ON' 'OFF')
		-DWITH_OPENSSL=$(usex ssl 'ON' 'OFF')
		-DWITH_ZLIB=ON
		-Wno-dev
	)
	cmake_src_configure
}

src_test() {
	MAKEOPTS="-j1" cmake_src_test
}