commit: c8f63df394e7d5094bffa55d66a89501f8cb43b1 Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Wed Dec 22 02:23:59 2021 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Wed Dec 22 02:23:59 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c8f63df3
app-arch/zstd: add 1.5.1 Signed-off-by: Sam James <sam <AT> gentoo.org> app-arch/zstd/Manifest | 1 + .../zstd/files/zstd-1.5.1-respect-CFLAGS.patch | 11 ++++ app-arch/zstd/zstd-1.5.1.ebuild | 69 ++++++++++++++++++++++ 3 files changed, 81 insertions(+) diff --git a/app-arch/zstd/Manifest b/app-arch/zstd/Manifest index 7950f8b80cac..3699570af10c 100644 --- a/app-arch/zstd/Manifest +++ b/app-arch/zstd/Manifest @@ -1,2 +1,3 @@ DIST zstd-1.4.9.tar.gz 1834843 BLAKE2B 907f492bd023db9459bdc292a0bc4d1b6336d92dd7041eb2b36668589c20fcb98c411b85d78f92cd16d9b4a000d9c4125b5f966a5ca777034ae78210e639315b SHA512 f529db9c094f9ae26428bf1fdfcc91c6d783d400980e0f0d802d2cf13c2be2931465ef568907e03841ff76a369a1447e7371f8799d8526edb9a513ba5c6db133 DIST zstd-1.5.0.tar.gz 1867111 BLAKE2B e503d17478b94128eb3ec578178f9d7023e941434dcc07790e12fd6c9933518f34fba5d7795ab7b145e4e499597644a6edd2830106649c5a749c962d5afe2f31 SHA512 25b657529a698eec891f92ff4a085d1fd95d2ff938ce52c8a4ff6163eb0b668ec642dd09e0db190652638cd92371006afa01d8e437437762c4097ad301675c33 +DIST zstd-1.5.1.tar.gz 1948539 BLAKE2B 2f82fb7872c49c41c8ccae17e343825dabceae3070266e49468c2019a1324758b825d7fc1bc3b62602b4d726538260258dc9134fa81d3c5e5085a8a1b531a8c5 SHA512 ed8ea0143b7bbd85afdcc8f95d44589a0903cff8375059836ebe577cc4b3ea49c0c756db6a3649655e478377f48b3120ef87dc768fd449bd4bfac786209bfd31 diff --git a/app-arch/zstd/files/zstd-1.5.1-respect-CFLAGS.patch b/app-arch/zstd/files/zstd-1.5.1-respect-CFLAGS.patch new file mode 100644 index 000000000000..63f0f47459d9 --- /dev/null +++ b/app-arch/zstd/files/zstd-1.5.1-respect-CFLAGS.patch @@ -0,0 +1,11 @@ +--- a/lib/libzstd.mk ++++ b/lib/libzstd.mk +@@ -78,8 +78,6 @@ else + endif + CFLAGS += -fno-stack-protector -fomit-frame-pointer -fno-ident \ + -DDYNAMIC_BMI2=0 -DNDEBUG +-else +- CFLAGS += -O3 + endif + + DEBUGLEVEL ?= 0 diff --git a/app-arch/zstd/zstd-1.5.1.ebuild b/app-arch/zstd/zstd-1.5.1.ebuild new file mode 100644 index 000000000000..ee5d6e6b7871 --- /dev/null +++ b/app-arch/zstd/zstd-1.5.1.ebuild @@ -0,0 +1,69 @@ +# Copyright 1999-2021 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 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="lz4 static-libs +threads" + +RDEPEND="app-arch/xz-utils + lz4? ( app-arch/lz4 )" +DEPEND="${RDEPEND}" + +PATCHES=( + "${FILESDIR}"/${PN}-1.5.1-respect-CFLAGS.patch +) + +src_prepare() { + default + multilib_copy_sources +} + +mymake() { + emake \ + CC="$(tc-getCC)" \ + CXX="$(tc-getCXX)" \ + AR="$(tc-getAR)" \ + PREFIX="${EPREFIX}/usr" \ + LIBDIR="${EPREFIX}/usr/$(get_libdir)" \ + V=1 \ + "${@}" +} + +multilib_src_compile() { + local libzstd_targets=( libzstd{,.a}$(usex threads '-mt' '') ) + + mymake -C lib ${libzstd_targets[@]} libzstd.pc + + if multilib_is_native_abi ; then + mymake HAVE_LZ4="$(usex lz4 1 0)" zstd + + mymake -C contrib/pzstd + fi +} + +multilib_src_install() { + mymake -C lib DESTDIR="${D}" install + + if multilib_is_native_abi ; then + mymake -C programs DESTDIR="${D}" install + + mymake -C contrib/pzstd DESTDIR="${D}" install + fi +} + +multilib_src_install_all() { + einstalldocs + + if ! use static-libs; then + find "${ED}" -name "*.a" -delete || die + fi +}