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

EAPI="6"

inherit toolchain-funcs

DESCRIPTION="Apache Kafka C/C++ client library"
HOMEPAGE="https://github.com/edenhill/librdkafka"

if [[ ${PV} == "9999" ]]; then
	EGIT_REPO_URI="
		git://github.com/edenhill/${PN}.git
		https://github.com/edenhill/${PN}.git
		"

	inherit git-r3
else
	SRC_URI="https://github.com/edenhill/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
	KEYWORDS="~amd64 ~arm ~hppa ~x86"
fi

LICENSE="BSD-2"

# subslot = soname version
SLOT="0/1"

IUSE="lz4 sasl ssl static-libs"

RDEPEND="
	lz4? ( app-arch/lz4:= )
	sasl? ( dev-libs/cyrus-sasl:= )
	ssl? ( dev-libs/openssl:0= )
	sys-libs/zlib
"

DEPEND="
	${RDEPEND}
	virtual/pkgconfig
"

PATCHES=( "${FILESDIR}"/${PN}-0.9.3-remove-lz4-automagic.patch )

src_configure() {
	tc-export CC CXX LD NM OBJDUMP PKG_CONFIG STRIP

	local myeconf=(
		--no-cache
		--no-download
		--disable-debug-symbols
		$(use_enable lz4)
		$(use_enable sasl)
		$(usex static-libs '--enable-static' '')
		$(use_enable ssl)
	)

	econf ${myeconf[@]}
}

src_test() {
	emake -C tests run_local
}

src_install() {
	local DOCS=(
		README.md
		CONFIGURATION.md
		INTRODUCTION.md
	)

	default

	if ! use static-libs; then
		find "${ED}"usr/lib* -name '*.la' -o -name '*.a' -delete || die
	fi
}