commit:     dbd66e8ddda83af05fcdc387662bf0bdd79987f5
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 11 22:25:08 2018 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Sun Nov 11 22:30:35 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=dbd66e8d

app-arch/zstd: Added multilib support.

Don't compile code in src_install()

Closes: https://bugs.gentoo.org/594514
Package-Manager: Portage-2.3.51, Repoman-2.3.12
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 app-arch/zstd/zstd-1.3.7-r1.ebuild | 76 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 76 insertions(+)

diff --git a/app-arch/zstd/zstd-1.3.7-r1.ebuild 
b/app-arch/zstd/zstd-1.3.7-r1.ebuild
new file mode 100644
index 00000000000..0882b2bed1d
--- /dev/null
+++ b/app-arch/zstd/zstd-1.3.7-r1.ebuild
@@ -0,0 +1,76 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit multilib-minimal 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 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86"
+IUSE="lz4 static-libs"
+
+RDEPEND="app-arch/xz-utils
+       lz4? ( app-arch/lz4 )"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+       default
+       multilib_copy_sources
+}
+
+multilib_src_compile() {
+       emake -C lib \
+               CC="$(tc-getCC)" \
+               AR="$(tc-getAR)" \
+               PREFIX="${EPREFIX}/usr" \
+               LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
+               libzstd libzstd.a libzstd.pc
+
+       if multilib_is_native_abi ; then
+               emake \
+                       CC="$(tc-getCC)" \
+                       AR="$(tc-getAR)" \
+                       HAVE_LZ4=$(usex lz4 1 0) \
+                       PREFIX="${EPREFIX}/usr" \
+                       LIBDIR="${EPREFIX}/usr/$(get_libdir)" zstd
+
+               emake -C contrib/pzstd \
+                       CC="$(tc-getCC)" \
+                       CXX="$(tc-getCXX)" \
+                       AR="$(tc-getAR)" \
+                       PREFIX="${EPREFIX}/usr" \
+                       LIBDIR="${EPREFIX}/usr/$(get_libdir)"
+       fi
+}
+
+multilib_src_install() {
+       emake -C lib \
+               DESTDIR="${D}" \
+               PREFIX="${EPREFIX}/usr" \
+               LIBDIR="${EPREFIX}/usr/$(get_libdir)" install
+
+       if multilib_is_native_abi ; then
+               emake -C programs \
+                       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
+       fi
+}
+
+multilib_src_install_all() {
+       einstalldocs
+
+       if ! use static-libs; then
+               find "${ED}" -name "*.a" -delete || die
+       fi
+}

Reply via email to