dev-libs/librdkafka: Add USE flag for lz4 support
authorThomas Deutschmann <whissi@gentoo.org>
Fri, 27 Jan 2017 13:32:13 +0000 (14:32 +0100)
committerThomas Deutschmann <whissi@gentoo.org>
Fri, 27 Jan 2017 13:34:39 +0000 (14:34 +0100)
Package-Manager: Portage-2.3.3, Repoman-2.3.1

dev-libs/librdkafka/files/librdkafka-0.9.2-remove-lz4-automagic.patch [new file with mode: 0644]
dev-libs/librdkafka/librdkafka-0.9.2-r1.ebuild [moved from dev-libs/librdkafka/librdkafka-0.9.2.ebuild with 85% similarity]
dev-libs/librdkafka/metadata.xml

diff --git a/dev-libs/librdkafka/files/librdkafka-0.9.2-remove-lz4-automagic.patch b/dev-libs/librdkafka/files/librdkafka-0.9.2-remove-lz4-automagic.patch
new file mode 100644 (file)
index 0000000..bf22aed
--- /dev/null
@@ -0,0 +1,47 @@
+[PATCH] configure: Add option to disable automagic dependency on
+ liblz4
+
+Backport of commit cbf5ea173a2e17310aa1adc4b1ee80fb8831901b.
+
+Previously, mklove activated lz4 support when lz4 was found. This added
+a so called "automagic" dependency on liblz4 which is a problem from
+distributions.
+
+This commit will add an option which will allow you to explicit disable
+lz4 usage.
+---
+ configure.librdkafka | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+diff --git a/configure.librdkafka b/configure.librdkafka
+index 34acc17..71d9905 100644
+--- a/configure.librdkafka
++++ b/configure.librdkafka
+@@ -30,6 +30,8 @@ mkl_toggle_option "Development" ENABLE_REFCNT_DEBUG "--enable-refcnt-debug" "Ena
+ mkl_toggle_option "Development" ENABLE_SHAREDPTR_DEBUG "--enable-sharedptr-debug" "Enable sharedptr debugging" "n"
++mkl_toggle_option "Feature" ENABLE_LZ4 "--enable-lz4" "Enable LZ4 support" "y"
++
+ mkl_toggle_option "Feature" ENABLE_SSL "--enable-ssl" "Enable SSL support" "y"
+ mkl_toggle_option "Feature" ENABLE_SASL "--enable-sasl" "Enable SASL support" "y"
+@@ -42,10 +44,11 @@ function checks {
+     # optional libs
+     mkl_lib_check "zlib" "WITH_ZLIB" disable CC "-lz"
+     mkl_lib_check "libcrypto" "" disable CC "-lcrypto"
+-    mkl_lib_check "liblz4" "WITH_LZ4" disable CC "-llz4" \
+-                "
+-#include <lz4frame.h>
+-"
++
++    if [[ "$ENABLE_LZ4" == "y" ]]; then
++        mkl_lib_check "liblz4" "WITH_LZ4" disable CC "-llz4" \
++                      "#include <lz4frame.h>"
++    fi
+     # Snappy support is built-in
+     mkl_allvar_set WITH_SNAPPY WITH_SNAPPY y
+-- 
+2.11.0
+
similarity index 85%
rename from dev-libs/librdkafka/librdkafka-0.9.2.ebuild
rename to dev-libs/librdkafka/librdkafka-0.9.2-r1.ebuild
index 7623bd2a83f6b4fa0a2df2a3929613692224b766..14f60a180614290c374a6d1ef7f4a3ad288f41d4 100644 (file)
@@ -1,8 +1,8 @@
-# Copyright 1999-2016 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
-EAPI=6
+EAPI="6"
 
 inherit toolchain-funcs
 
@@ -26,9 +26,10 @@ LICENSE="BSD-2"
 # subslot = soname version
 SLOT="0/1"
 
-IUSE="sasl ssl static-libs"
+IUSE="lz4 sasl ssl static-libs"
 
 RDEPEND="
+       lz4? ( app-arch/lz4:= )
        sasl? ( dev-libs/cyrus-sasl:= )
        ssl? ( dev-libs/openssl:0= )
        sys-libs/zlib
@@ -39,6 +40,8 @@ DEPEND="
        virtual/pkgconfig
 "
 
+PATCHES=( "${FILESDIR}"/${PN}-0.9.2-remove-lz4-automagic.patch )
+
 src_configure() {
        tc-export CC CXX LD NM OBJDUMP PKG_CONFIG STRIP
 
@@ -46,6 +49,7 @@ src_configure() {
                --no-cache
                --no-download
                --disable-debug-symbols
+               $(use_enable lz4)
                $(use_enable sasl)
                $(usex static-libs '--enable-static' '')
                $(use_enable ssl)
index e0fb32efd62feac42f3165b46b7633b247c6d0d1..1d277adeaf2292634f7ffbf658a1ab46af591fdb 100644 (file)
@@ -9,4 +9,7 @@
                <bugs-to>https://github.com/edenhill/librdkafka/issues</bugs-to>
                <remote-id type="github">edenhill/librdkafka</remote-id>
        </upstream>
+       <use>
+               <flag name="lz4">Enable support for Kafka's LZ4 compression based on KIP-57 (uses <pkg>app-arch/lz4</pkg>)</flag>
+       </use>
 </pkgmetadata>