Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-arch/zstd/
Date: Sun, 25 Sep 2022 01:21:20
Message-Id: 1664068794.6121cf31cd310cff467f26b6dfcfdd8df6000aa3.sam@gentoo
1 commit: 6121cf31cd310cff467f26b6dfcfdd8df6000aa3
2 Author: Holger Hoffstätte <holger <AT> applied-asynchrony <DOT> com>
3 AuthorDate: Sun Sep 4 14:58:25 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 25 01:19:54 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6121cf31
7
8 app-arch/zstd: enable threads by default
9
10 This follows upstream's default since 1.5.0.
11
12 Closes: https://bugs.gentoo.org/868390
13 Signed-off-by: Holger Hoffstätte <holger <AT> applied-asynchrony.com>
14 Closes: https://github.com/gentoo/gentoo/pull/27141
15 Signed-off-by: Sam James <sam <AT> gentoo.org>
16
17 app-arch/zstd/zstd-1.5.2-r3.ebuild | 69 ++++++++++++++++++++++++++++++++++++++
18 1 file changed, 69 insertions(+)
19
20 diff --git a/app-arch/zstd/zstd-1.5.2-r3.ebuild b/app-arch/zstd/zstd-1.5.2-r3.ebuild
21 new file mode 100644
22 index 000000000000..4164ae59fa66
23 --- /dev/null
24 +++ b/app-arch/zstd/zstd-1.5.2-r3.ebuild
25 @@ -0,0 +1,69 @@
26 +# Copyright 1999-2022 Gentoo Authors
27 +# Distributed under the terms of the GNU General Public License v2
28 +
29 +EAPI=8
30 +
31 +inherit multilib-minimal toolchain-funcs usr-ldscript
32 +
33 +DESCRIPTION="zstd fast compression library"
34 +HOMEPAGE="https://facebook.github.io/zstd/"
35 +SRC_URI="https://github.com/facebook/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
36 +
37 +LICENSE="|| ( BSD GPL-2 )"
38 +SLOT="0/1"
39 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
40 +IUSE="lz4 static-libs"
41 +
42 +RDEPEND="
43 + app-arch/xz-utils
44 + sys-libs/zlib
45 + lz4? ( app-arch/lz4 )
46 +"
47 +DEPEND="${RDEPEND}"
48 +
49 +src_prepare() {
50 + default
51 + multilib_copy_sources
52 +}
53 +
54 +mymake() {
55 + emake \
56 + CC="$(tc-getCC)" \
57 + CXX="$(tc-getCXX)" \
58 + AR="$(tc-getAR)" \
59 + PREFIX="${EPREFIX}/usr" \
60 + LIBDIR="${EPREFIX}/usr/$(get_libdir)" \
61 + V=1 \
62 + "${@}"
63 +}
64 +
65 +multilib_src_compile() {
66 + local libzstd_targets=( libzstd{,.a}-mt )
67 +
68 + mymake -C lib ${libzstd_targets[@]} libzstd.pc
69 +
70 + if multilib_is_native_abi ; then
71 + mymake HAVE_LZ4="$(usex lz4 1 0)" zstd
72 +
73 + mymake -C contrib/pzstd
74 + fi
75 +}
76 +
77 +multilib_src_install() {
78 + mymake -C lib DESTDIR="${D}" install
79 +
80 + if multilib_is_native_abi ; then
81 + mymake -C programs DESTDIR="${D}" install
82 + gen_usr_ldscript -a zstd
83 +
84 + mymake -C contrib/pzstd DESTDIR="${D}" install
85 + fi
86 +}
87 +
88 +multilib_src_install_all() {
89 + einstalldocs
90 +
91 + if ! use static-libs; then
92 + find "${ED}" -name "*.a" -delete || die
93 + fi
94 +}