summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lauer <patrick@gentoo.org>2018-07-07 06:06:56 +0000
committerPatrick Lauer <patrick@gentoo.org>2018-07-07 06:16:18 +0000
commitbc57d3bf37f1a5f477c4c8711c34054ec3dd166f (patch)
tree5fad1d12835ba7bf734733cb304f0f391d92b993
parentdev-ruby/ruby-gtk3: amd64 stable (diff)
downloadgentoo-bc57d3bf37f1a5f477c4c8711c34054ec3dd166f.tar.gz
gentoo-bc57d3bf37f1a5f477c4c8711c34054ec3dd166f.tar.bz2
gentoo-bc57d3bf37f1a5f477c4c8711c34054ec3dd166f.zip
app-arch/zstd: Fix automagic lz4 dep #659552
Package-Manager: Portage-2.3.41, Repoman-2.3.9
-rw-r--r--app-arch/zstd/metadata.xml5
-rw-r--r--app-arch/zstd/zstd-1.3.4-r1.ebuild60
2 files changed, 65 insertions, 0 deletions
diff --git a/app-arch/zstd/metadata.xml b/app-arch/zstd/metadata.xml
index b9782eebc304..82079cb18aea 100644
--- a/app-arch/zstd/metadata.xml
+++ b/app-arch/zstd/metadata.xml
@@ -5,6 +5,11 @@
<email>patrick@gentoo.org</email>
<name>Patrick Lauer</name>
</maintainer>
+ <use>
+ <flag name="lz4">
+ Enable support for LZ4 compression using <pkg>app-arch/lz4</pkg>
+ </flag>
+ </use>
<upstream>
<remote-id type="github">facebook/zstd</remote-id>
</upstream>
diff --git a/app-arch/zstd/zstd-1.3.4-r1.ebuild b/app-arch/zstd/zstd-1.3.4-r1.ebuild
new file mode 100644
index 000000000000..b5e953cdda71
--- /dev/null
+++ b/app-arch/zstd/zstd-1.3.4-r1.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit toolchain-funcs
+
+DESCRIPTION="zstd fast compression library"
+HOMEPAGE="https://facebook.github.io/zstd/"
+SRC_URI="https://github.com/facebook/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="|| ( BSD GPL-2 )"
+SLOT="0/1"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="lz4 static-libs"
+
+RDEPEND="app-arch/xz-utils
+ lz4? ( app-arch/lz4 )"
+DEPEND="${RDEPEND}"
+
+src_compile() {
+ emake \
+ CC="$(tc-getCC)" \
+ AR="$(tc-getAR)" \
+ HAVE_LZ4=$(usex lz4 1 0) \
+ PREFIX="${EPREFIX}/usr" \
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" zstd
+
+ emake -C lib \
+ CC="$(tc-getCC)" \
+ AR="$(tc-getAR)" \
+ PREFIX="${EPREFIX}/usr" \
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" libzstd
+
+ emake -C contrib/pzstd \
+ CC="$(tc-getCC)" \
+ CXX="$(tc-getCXX)" \
+ AR="$(tc-getAR)" \
+ PREFIX="${EPREFIX}/usr" \
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)"
+
+}
+
+src_install() {
+ emake \
+ DESTDIR="${D}" \
+ PREFIX="${EPREFIX}/usr" \
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" install
+
+ emake -C contrib/pzstd \
+ DESTDIR="${D}" \
+ PREFIX="${EPREFIX}/usr" \
+ LIBDIR="${EPREFIX}/usr/$(get_libdir)" install
+
+ einstalldocs
+
+ if ! use static-libs; then
+ rm "${ED%/}"/usr/$(get_libdir)/libzstd.a || die
+ fi
+}