dev-libs/librdkafka: x86 stable wrt bug #717704
[gentoo.git] / dev-libs / librdkafka / librdkafka-1.4.0.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI="7"
5
6 inherit toolchain-funcs
7
8 DESCRIPTION="Apache Kafka C/C++ client library"
9 HOMEPAGE="https://github.com/edenhill/librdkafka"
10
11 if [[ ${PV} == "9999" ]]; then
12         EGIT_REPO_URI="https://github.com/edenhill/${PN}.git"
13
14         inherit git-r3
15 else
16         SRC_URI="https://github.com/edenhill/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
17         KEYWORDS="amd64 arm arm64 ~hppa ~ppc ~sparc x86"
18 fi
19
20 LICENSE="BSD-2"
21
22 # subslot = soname version
23 SLOT="0/1"
24
25 IUSE="lz4 sasl ssl static-libs zstd"
26
27 LIB_DEPEND="
28         lz4? ( app-arch/lz4:=[static-libs(+)] )
29         sasl? ( dev-libs/cyrus-sasl:=[static-libs(+)] )
30         ssl? ( dev-libs/openssl:0=[static-libs(+)] )
31         zstd? ( app-arch/zstd:=[static-libs(+)] )
32         sys-libs/zlib:=[static-libs(+)]
33 "
34
35 RDEPEND="!static-libs? ( ${LIB_DEPEND//\[static-libs(+)]} )"
36
37 DEPEND="
38         ${RDEPEND}
39         virtual/pkgconfig
40         static-libs? ( ${LIB_DEPEND} )
41 "
42
43 src_configure() {
44         tc-export CC CXX LD NM OBJDUMP PKG_CONFIG STRIP
45
46         local myeconf=(
47                 --no-cache
48                 --no-download
49                 --disable-debug-symbols
50                 $(use_enable lz4)
51                 $(use_enable sasl)
52                 $(usex static-libs '--enable-static' '')
53                 $(use_enable ssl)
54                 $(use_enable zstd)
55         )
56
57         econf ${myeconf[@]}
58 }
59
60 src_test() {
61         emake -C tests run_local
62 }
63
64 src_install() {
65         emake \
66                 DESTDIR="${D}" \
67                 docdir="/usr/share/doc/${PF}" \
68                 install
69
70         if ! use static-libs; then
71                 find "${ED}"/usr/lib* -name '*.la' -o -name '*.a' -delete || die
72         fi
73 }