From 17dcfeba22240edb3c54d96e319edf6c4bc008c3 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 10 Mar 2023 18:05:22 +0000 Subject: gentoo auto-resync : 10:03:2023 - 18:05:22 --- app-arch/zstd/Manifest | 4 +- .../zstd/files/zstd-1.5.4-crash-no-directory.patch | 115 +++++++++++++++++++++ app-arch/zstd/zstd-1.5.4-r3.ebuild | 80 ++++++++++++++ app-arch/zstd/zstd-1.5.4.ebuild | 82 --------------- 4 files changed, 197 insertions(+), 84 deletions(-) create mode 100644 app-arch/zstd/files/zstd-1.5.4-crash-no-directory.patch create mode 100644 app-arch/zstd/zstd-1.5.4-r3.ebuild delete mode 100644 app-arch/zstd/zstd-1.5.4.ebuild (limited to 'app-arch/zstd') diff --git a/app-arch/zstd/Manifest b/app-arch/zstd/Manifest index 2c3b2875589f..ddbfcacff78e 100644 --- a/app-arch/zstd/Manifest +++ b/app-arch/zstd/Manifest @@ -1,12 +1,12 @@ +AUX zstd-1.5.4-crash-no-directory.patch 4689 BLAKE2B f490f0bcd938d1eb59f54b5d9d9b9e309a15dfef3fc8e947f19869e9bc1ded56e06170c6c89a79bb33db9ae0ed91edabba5e09f66c1d47eaea4c5c200ee5a5e9 SHA512 735daf86e2cec242764d15907ab9c85735a1bda91ec66dfdbee696bbb74cad53d3eee1f7857ac1fe4c694e935a3779dbdfa0a0f69d45a8b6c009ec7436a90b32 AUX zstd-1.5.4-fix-no-zlib-build.patch 2469 BLAKE2B 955ee5ce52fdf7701c8d3f812c4e4ed15c53d7764e9bfc0cdac09186aa572e0d867eee0862470f2d9cfb17369429f889d3a4f903e3bab12672c517c46c9739d0 SHA512 2caf596008aaad385bbf2ec61faff06ca28abac0228440fc1d4226e83757db2c7ca16010beb73da9802fe82ea6a6b81ce350e7fb7b059266d204d844623a1baa AUX zstd-1.5.4-no-find-valgrind.patch 596 BLAKE2B 28c5bcc005511703833fc73b2f11ee7a42a69c5e762e71c269265c42585fe4cf167a4bdba4f0e36e8e0e7a61e01e0f992c9417690bc879978d575823aa5e1884 SHA512 ad6cd84fde1a4f29710ecffe40854a8bbad0b1428000a57d706b221411675e2d79958c940dc955ec27020cfb7c9a14b7ac84cfe15759a5d07552d46f94b7df88 AUX zstd-1.5.4-tests-no-programs.patch 2252 BLAKE2B 014fab10a60fd6f5ecf5399ebc77a192075c0b08cb3b6643b4b414e942198f476d5dc8fbe8fa76306db70361a299518b574f69b84d8b27b30e5c5dc4988c2c48 SHA512 aed61bacf3d4d2b802e8e6a3dfa12221dcd7b6f0e64972530f826995619870ed1e87ea920eb6fdc81069e5165153703972ad1e2d370521f7d1624c308afba520 DIST zstd-1.4.9.tar.gz 1834843 BLAKE2B 907f492bd023db9459bdc292a0bc4d1b6336d92dd7041eb2b36668589c20fcb98c411b85d78f92cd16d9b4a000d9c4125b5f966a5ca777034ae78210e639315b SHA512 f529db9c094f9ae26428bf1fdfcc91c6d783d400980e0f0d802d2cf13c2be2931465ef568907e03841ff76a369a1447e7371f8799d8526edb9a513ba5c6db133 DIST zstd-1.5.2.tar.gz 1950967 BLAKE2B 9d474e9fdcf7e5eb09d1f606712b05ca3001e8f6f7451254d8dba3f429101048532fd9c84a5b9083ae90d0457e9e1b1d48256581a1697e7db19b09d73595f070 SHA512 e107508a41fca50845cc2494e64adaba93efb95a2fa486fc962510a8ba4b2180d93067cae9870f119e88e5e8b28a046bc2240b0b23cdd8933d1fb1a6a9668c1e DIST zstd-1.5.4.gh.tar.gz 2161536 BLAKE2B ffc5fcbbdf4ab04bc14b5037308bf4e879d4cbaaf863462ea1e8af3f1b86b935ee6036e49298c83ac42b00472c003e32c263c977f0ae7d64f31d9ae63c5c28cb SHA512 2896a6dd6b60cc251720356babcbab6018c874eb2149121b26e28041496fc355a9cb5fd1b39c91558fcfbafb789b3d721264a0f9b5734f893d5f3cdf97016394 -DIST zstd-1.5.4.tar.gz 2178759 BLAKE2B 0c7ad42ebbf888bcd978eee95dc07f8e74c6b4ca1e1cec15ae110f5f57b66cb1d726896f71430e6219ef54ff90e722fc778147d5f77f4bff5395b0dc8b914885 SHA512 b6f64850ceb6cfed831fff3c43508d2a72338862a96dd9430b1d3ebbfcee40201c8b6dcf8b6b603e252bb96f3f283c9cb07da7f24414187f5f1fea3b51e01863 EBUILD zstd-1.4.9.ebuild 1676 BLAKE2B 31a1c1f3b06f03aee1f79be98fd352ebc850cf763a5fca287810fae13042587d434e28f1826e0e86194bffeadb60704d9b36f0b0036aa72a51fa7be11257e814 SHA512 b878ad96130da9450c92597354335b294b24341c6ac0b8f236f9bcd55efda8c46f700f0571ac80822da34a5b854d463d02cf8707ea1e7b3b2b713a6f6924025c EBUILD zstd-1.5.2-r3.ebuild 1490 BLAKE2B 3acb86024c045b85682d2e4b138dd83ab85de948dbc95529aadd260728c6ffe2ddb1168ba3165cab65da7c803f9d715ec2c70f9a0c9d65b7ff01e06ae57d560a SHA512 9fdb17e7d37b41cb2b1cc5553005223d50d3aa0d62fd56100878ac5c30c994e0c515b5dd0aede1f053fc413614810bfd73f4a64da18f12b31f2644537cc6d0a9 EBUILD zstd-1.5.4-r2.ebuild 2085 BLAKE2B d4b17ef1cdf4ae53f6c1381fc6198471385ddd338b09697466bf3cde1501b4780ca97994c86444a9a64e155ec1c53dcc7860cb6fae92fb6931f6a08c2b76bc6f SHA512 54d69027986b64efcc12decc93a9114223663888d20802ad88600eeb6acb6acb5a3a882380341e8bdc7f124c1e8e32c499d18d6a8d026646df8456a6d8fec67e -EBUILD zstd-1.5.4.ebuild 1826 BLAKE2B 606d8babbc91b04dd0901e582195c9d502248c7a87eaed6f6e47255ecf8ad3b10a85a7b9fdb94529721155f78b41896c26e35baf09a028912b31d5d0622f75ff SHA512 470298a353c7834d7d4cde29abf5c71e6e638b1a9d38b0610488cd6a7b1b5b134d52bf5dd35ee026252ed90ae9dffddcbd78d2749da9201381dd916a0b26d908 +EBUILD zstd-1.5.4-r3.ebuild 2130 BLAKE2B fe2d4bc6d0555a154deba842456eb1fe693bcd8a94cae9525c032498c39ba1b7bdbfddff329117e91828fbebb4e4200d64ac5d6d3d0ebacdc51eaefdddb09b70 SHA512 96cf899bd56e6cc234a9d8a047b71a67fb925f8f0a1507f02a4c93151b1b52f43005590997df58d09cab53fdea2b599cdddb57b058440d5fdd880c05e42351bf MISC metadata.xml 302 BLAKE2B 66692581b8918a23bab99bb3b0909702327c1acf2b7f8ec2fbfdf74ff75a8f178ce1140e0a9d46b64983dfe9529134db842a5a60a86b7fcbbd5db88e844d136d SHA512 097c09d06824c85919b21bc841c791851b1a7d1a6c6d16a26bbe9bed9dfb1522cacdd2b430b8ff51762fb73b388d88ec679d46570b2e56b36352ea2cf20e46f6 diff --git a/app-arch/zstd/files/zstd-1.5.4-crash-no-directory.patch b/app-arch/zstd/files/zstd-1.5.4-crash-no-directory.patch new file mode 100644 index 000000000000..d64e1c1d34f0 --- /dev/null +++ b/app-arch/zstd/files/zstd-1.5.4-crash-no-directory.patch @@ -0,0 +1,115 @@ +https://github.com/facebook/zstd/issues/3523 +https://github.com/facebook/zstd/pull/3541 + +From 50e8f55e7d5928af9c3411afdb4fbedb4d8f770d Mon Sep 17 00:00:00 2001 +From: "W. Felix Handte" +Date: Thu, 9 Mar 2023 12:46:37 -0500 +Subject: [PATCH 1/3] Fix Python 3.6 Incompatibility in CLI Tests + +--- a/tests/cli-tests/run.py ++++ b/tests/cli-tests/run.py +@@ -535,7 +535,8 @@ def _run_script(self, script: str, cwd: str) -> None: + subprocess.run( + args=[script], + stdin=subprocess.DEVNULL, +- capture_output=True, ++ stdout=subprocess.PIPE, ++ stderr=subprocess.PIPE, + cwd=cwd, + env=env, + check=True, + +From c4c3e11958aed4dc99ec22e3d31c405217575a8c Mon Sep 17 00:00:00 2001 +From: "W. Felix Handte" +Date: Thu, 9 Mar 2023 12:47:40 -0500 +Subject: [PATCH 2/3] Avoid Calling `setvbuf()` on Null File Pointer + +--- a/programs/fileio.c ++++ b/programs/fileio.c +@@ -644,18 +644,24 @@ FIO_openDstFile(FIO_ctx_t* fCtx, FIO_prefs_t* const prefs, + #endif + if (f == NULL) { + DISPLAYLEVEL(1, "zstd: %s: %s\n", dstFileName, strerror(errno)); ++ } else { ++ /* An increased buffer size can provide a significant performance ++ * boost on some platforms. Note that providing a NULL buf with a ++ * size that's not 0 is not defined in ANSI C, but is defined in an ++ * extension. There are three possibilities here: ++ * 1. Libc supports the extended version and everything is good. ++ * 2. Libc ignores the size when buf is NULL, in which case ++ * everything will continue as if we didn't call `setvbuf()`. ++ * 3. We fail the call and execution continues but a warning ++ * message might be shown. ++ * In all cases due execution continues. For now, I believe that ++ * this is a more cost-effective solution than managing the buffers ++ * allocations ourselves (will require an API change). ++ */ ++ if (setvbuf(f, NULL, _IOFBF, 1 MB)) { ++ DISPLAYLEVEL(2, "Warning: setvbuf failed for %s\n", dstFileName); ++ } + } +- /* An increased buffer size can provide a significant performance boost on some platforms. +- * Note that providing a NULL buf with a size that's not 0 is not defined in ANSI C, but is defined +- * in an extension. There are three possibilities here - +- * 1. Libc supports the extended version and everything is good. +- * 2. Libc ignores the size when buf is NULL, in which case everything will continue as if we didn't +- * call `setvbuf`. +- * 3. We fail the call and execution continues but a warning message might be shown. +- * In all cases due execution continues. For now, I believe that this is a more cost-effective +- * solution than managing the buffers allocations ourselves (will require an API change). */ +- if(setvbuf(f, NULL, _IOFBF, 1 MB)) +- DISPLAYLEVEL(2, "Warning: setvbuf failed for %s\n", dstFileName); + return f; + } + } + +From 957a0ae52d0f49eccd260a22ceb5f5dfed064e9f Mon Sep 17 00:00:00 2001 +From: "W. Felix Handte" +Date: Thu, 9 Mar 2023 12:48:11 -0500 +Subject: [PATCH 3/3] Add CLI Test + +--- /dev/null ++++ b/tests/cli-tests/file-stat/compress-file-to-dir-without-write-perm.sh +@@ -0,0 +1,12 @@ ++#!/bin/sh ++ ++# motivated by issue #3523 ++ ++datagen > file ++mkdir out ++chmod 000 out ++ ++zstd file -q --trace-file-stat -o out/file.zst ++zstd -tq out/file.zst ++ ++chmod 777 out +--- /dev/null ++++ b/tests/cli-tests/file-stat/compress-file-to-dir-without-write-perm.sh.stderr.exact +@@ -0,0 +1,26 @@ ++Trace:FileStat: > UTIL_isLink(file) ++Trace:FileStat: < 0 ++Trace:FileStat: > UTIL_isConsole(2) ++Trace:FileStat: < 0 ++Trace:FileStat: > UTIL_getFileSize(file) ++Trace:FileStat: > UTIL_stat(-1, file) ++Trace:FileStat: < 1 ++Trace:FileStat: < 65537 ++Trace:FileStat: > UTIL_stat(-1, file) ++Trace:FileStat: < 1 ++Trace:FileStat: > UTIL_isDirectoryStat() ++Trace:FileStat: < 0 ++Trace:FileStat: > UTIL_stat(-1, file) ++Trace:FileStat: < 1 ++Trace:FileStat: > UTIL_isSameFile(file, out/file.zst) ++Trace:FileStat: > UTIL_stat(-1, file) ++Trace:FileStat: < 1 ++Trace:FileStat: > UTIL_stat(-1, out/file.zst) ++Trace:FileStat: < 0 ++Trace:FileStat: < 0 ++Trace:FileStat: > UTIL_isRegularFile(out/file.zst) ++Trace:FileStat: > UTIL_stat(-1, out/file.zst) ++Trace:FileStat: < 0 ++Trace:FileStat: < 0 ++zstd: out/file.zst: Permission denied ++zstd: can't stat out/file.zst : Permission denied -- ignored + diff --git a/app-arch/zstd/zstd-1.5.4-r3.ebuild b/app-arch/zstd/zstd-1.5.4-r3.ebuild new file mode 100644 index 000000000000..a74b317a3e8d --- /dev/null +++ b/app-arch/zstd/zstd-1.5.4-r3.ebuild @@ -0,0 +1,80 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit meson-multilib usr-ldscript + +DESCRIPTION="zstd fast compression library" +HOMEPAGE="https://facebook.github.io/zstd/" +# Drop .gh on next bump (>1.5.4), it's only here as we switched to release +# tarball. +SRC_URI="https://github.com/facebook/zstd/releases/download/v${PV}/${P}.tar.gz -> ${P}.gh.tar.gz" +S="${WORKDIR}"/${P}/build/meson + +LICENSE="|| ( BSD GPL-2 )" +SLOT="0/1" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +IUSE="+lzma lz4 static-libs test zlib" +RESTRICT="!test? ( test )" + +RDEPEND=" + lzma? ( app-arch/xz-utils ) + lz4? ( app-arch/lz4:= ) + zlib? ( sys-libs/zlib ) +" +DEPEND="${RDEPEND}" + +MESON_PATCHES=( + # Workaround until Valgrind bugfix lands + "${FILESDIR}"/${PN}-1.5.4-no-find-valgrind.patch + # Allow building tests w/o programs (useful for multilib) + "${FILESDIR}"/${PN}-1.5.4-tests-no-programs.patch +) + +PATCHES=( + # Fix build w/o zlib, bug #894058 + "${FILESDIR}"/${P}-fix-no-zlib-build.patch + "${FILESDIR}"/${P}-crash-no-directory.patch +) + +src_prepare() { + cd "${WORKDIR}"/${P} || die + default + + cd "${S}" || die + eapply "${MESON_PATCHES[@]}" +} + +multilib_src_configure() { + local native_file="${T}"/meson.${CHOST}.${ABI}.ini.local + + # This replaces the no-find-valgrind patch once bugfix lands in a meson + # release + we can BDEPEND on it (https://github.com/mesonbuild/meson/pull/11372) + cat >> ${native_file} <<-EOF || die + [binaries] + valgrind='valgrind-falseified' + EOF + + local emesonargs=( + -Ddefault_library=$(multilib_native_usex static-libs both shared) + + $(meson_native_true bin_programs) + $(meson_native_true bin_contrib) + $(meson_use test bin_tests) + + $(meson_native_use_feature zlib) + $(meson_native_use_feature lzma) + $(meson_native_use_feature lz4) + + --native-file "${native_file}" + ) + + meson_src_configure +} + +multilib_src_install() { + meson_src_install + + multilib_is_native_abi && gen_usr_ldscript -a zstd +} diff --git a/app-arch/zstd/zstd-1.5.4.ebuild b/app-arch/zstd/zstd-1.5.4.ebuild deleted file mode 100644 index b933a78b2570..000000000000 --- a/app-arch/zstd/zstd-1.5.4.ebuild +++ /dev/null @@ -1,82 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -inherit multilib-minimal toolchain-funcs usr-ldscript - -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 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" -IUSE="+lzma lz4 static-libs zlib" - -RDEPEND=" - lzma? ( app-arch/xz-utils ) - lz4? ( app-arch/lz4 ) - zlib? ( sys-libs/zlib ) -" -DEPEND="${RDEPEND}" - -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 \ - HAVE_LZMA="$(multilib_native_usex lzma 1 0)" \ - HAVE_LZ4="$(multilib_native_usex lz4 1 0)" \ - HAVE_ZLIB="$(multilib_native_usex zlib 1 0)" \ - "${@}" -} - -multilib_src_compile() { - local libzstd_targets=( libzstd{,.a}-mt ) - - mymake -C lib ${libzstd_targets[@]} libzstd.pc - - if multilib_is_native_abi ; then - mymake zstd - mymake -C contrib/pzstd - fi -} - -multilib_src_test() { - if multilib_is_native_abi ; then - # 'test' runs more tests than 'check'. - mymake -C tests test - mymake -C contrib/pzstd test - else - mymake check - fi -} - -multilib_src_install() { - mymake -C lib DESTDIR="${D}" install - - if multilib_is_native_abi ; then - mymake -C programs DESTDIR="${D}" install - - gen_usr_ldscript -a zstd - - 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 -} -- cgit v1.2.3