summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-arch/xz-utils')
-rw-r--r--app-arch/xz-utils/Manifest10
-rw-r--r--app-arch/xz-utils/files/xz-utils-5.2.5-xzgrep-ZDI-CAN-16587.patch88
-rw-r--r--app-arch/xz-utils/metadata.xml27
-rw-r--r--app-arch/xz-utils/xz-utils-5.2.5-r2.ebuild118
-rw-r--r--app-arch/xz-utils/xz-utils-5.4.2.ebuild140
-rw-r--r--app-arch/xz-utils/xz-utils-5.4.7.ebuild (renamed from app-arch/xz-utils/xz-utils-5.2.6.ebuild)67
-rw-r--r--app-arch/xz-utils/xz-utils-5.6.2.ebuild179
-rw-r--r--app-arch/xz-utils/xz-utils-9999.ebuild110
8 files changed, 471 insertions, 268 deletions
diff --git a/app-arch/xz-utils/Manifest b/app-arch/xz-utils/Manifest
index 3bbab17e9c45..97458d71004e 100644
--- a/app-arch/xz-utils/Manifest
+++ b/app-arch/xz-utils/Manifest
@@ -1,4 +1,6 @@
-DIST xz-5.2.5.tar.gz 1791345 BLAKE2B aded57324e129572c41646b3cc3b0b59a459452d9338d9245663b63dac2a463fb1f1b2b1d2d4ad3c09cb71fb8439df52cd94f24db99e782fc899b94a288a3043 SHA512 7443674247deda2935220fbc4dfc7665e5bb5a260be8ad858c8bd7d7b9f0f868f04ea45e62eb17c0a5e6a2de7c7500ad2d201e2d668c48ca29bd9eea5a73a3ce
-DIST xz-5.2.5.tar.gz.sig 566 BLAKE2B 8b40d8d7913eaebe2595ea41a735d972d1969d8b58f42b2bee6591b51e2e626473fc85d64f1bbbff3cba6b0e1b4423556d6ddaf16f646ccc18ba1bad5cf45d83 SHA512 3aa21484bef0282ed0b83e3fcd5cf3d87bf51fa68e24d55bb11f91bc96f0ac29f468949bc4c8cc20fbd6ad12f5735686fe09ee42efe2b8d728010da9668aa5a9
-DIST xz-5.2.6.tar.gz 2069602 BLAKE2B 3cc160dc76944ad2a181fbfb23ce386dbbd04e75bbeb0b159aaaf82e2e8157ea8b2bb80b216d79a7c25339bfbd13bd9d8c261789829cc7c3cb86fc893a7b4b94 SHA512 090958dd6c202c989746686094c86707ad4ae835026640080fc0a9d0fad699821b7d5cb3a67e6700661a0938818ba153662366f89ab8ec47e0bae4a3fe9b1961
-DIST xz-5.2.6.tar.gz.sig 566 BLAKE2B 7c6114d93b4e3c8553108da3985029fc4585bfea5d72fc5028024221e91cc43c3b6cd3b7d169e4c8afed445a6beef7c255ef8420c5266a22ee9449a57cacec5d SHA512 50a1ac0f8f87f8c04c25c69870ba054094abf20b668bdecd42ed247a2eff24b8e52178b6442da84c125a9401a6f98d40ca76b27453833a30807c83128ab70eee
+DIST xz-5.4.2.tar.gz 2799022 BLAKE2B 3c622b0823f0cbb5fbc5eaa0372fc2f0fefe0950d131417f831bce47b6d9747d145429f0649de106819331f9ae6a289c497182c7b6d1e211513308dd083a9b72 SHA512 149f980338bea3d66de1ff5994b2b236ae1773135eda68b62b009df0c9dcdf5467f8cb2c06da95a71b6556d60bd3d21f475feced34d5dfdb80ee95416a2f9737
+DIST xz-5.4.2.tar.gz.sig 566 BLAKE2B 95c9c70fdd25b92095dd9691e4d9d4306a3f982becfe7bd42ca6132a76f29be2c2bc66f4fc2bda547058c18e227292f4185799eb905084fc3ab415ae867b4b1b SHA512 30e965c228ed3a8ecb804db8eb11703a765b7ee934030ea69bb3940b630811eb71bf74fd20371ef7759761904ece4f0144a0b00be4d843cf98299fd016f161aa
+DIST xz-5.4.7.tar.gz 2798247 BLAKE2B e02f3a62c81882c83254e1c94f002aadcd59479dbd031a4d5ea68ce3303c066c298c2709845f2d4ef436511b21d35ab66a080542ac70aaf6c0a0daf448a47d02 SHA512 82c3e5d39fbaa5dcd61b45d5db99d740d811323456a9af3b1acfccbe66b074d1650bc810ee8272a8ae0a1bcf116fc73fc09297b8acb4c6568cf912708306e8ea
+DIST xz-5.4.7.tar.gz.sig 566 BLAKE2B 525eeeddb219c6e46ef2079af0cd28c8514969ce33b2ab61ccae59ae26289e7ddbd29dd492f88f4e4da9db750dd60ce1831a23a0275cdac39bd5b29c663d1a72 SHA512 00e9004739a168fd8a1ca4bb8b8a9de456bbef2576565722158140f341e94f461dab05c6e457f62a1613229419a978898e878007872571afdc1bb8a9582fa00a
+DIST xz-5.6.2.tar.gz 2355785 BLAKE2B d2d5f9772714b5b5993ec26c313bd27dc10d88928d9d3a1c71b78f80797e376cf065dcdd0c2c7977a83b67cbe2558140c74c5df44a9408e5a72529212c2205ad SHA512 c32c32c95e3541b906e0284e66a953ace677e0ce6af2084e7b122600047bf7542c1b0fabb5909b19ff79fba6def530be674df1c675b22a47a8d57f3f0b736a82
+DIST xz-5.6.2.tar.gz.sig 566 BLAKE2B 9b1f19d0449de18057eb5bd3cceaa073fc245e9a05fb19fabdac98b1d2e708b39c8070130c522b78ff75df724e207f978d8da65e2ccb1c6fa295aa892eda0d23 SHA512 f3d1055a2a6e96eec2fd5c0b733f2ab5e150bac9645f1fe9a7558ed6f34a241b4f57e17fd4504f311be26cf1e2b9b797f2e78b1b9d2db02e9cd0c1548cb6160b
diff --git a/app-arch/xz-utils/files/xz-utils-5.2.5-xzgrep-ZDI-CAN-16587.patch b/app-arch/xz-utils/files/xz-utils-5.2.5-xzgrep-ZDI-CAN-16587.patch
deleted file mode 100644
index 7293a982c269..000000000000
--- a/app-arch/xz-utils/files/xz-utils-5.2.5-xzgrep-ZDI-CAN-16587.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-https://bugs.gentoo.org/837155
-https://git.tukaani.org/?p=xz.git;a=commitdiff;h=69d1b3fc29677af8ade8dc15dba83f0589cb63d6;hp=bd93b776c1bd15e90661033c918cdeb354dbcc38
-
-From: Lasse Collin <lasse.collin@tukaani.org>
-Date: Tue, 29 Mar 2022 19:19:12 +0300
-Subject: [PATCH 1/1] xzgrep: Fix escaping of malicious filenames
- (ZDI-CAN-16587).
-
-Malicious filenames can make xzgrep to write to arbitrary files
-or (with a GNU sed extension) lead to arbitrary code execution.
-
-xzgrep from XZ Utils versions up to and including 5.2.5 are
-affected. 5.3.1alpha and 5.3.2alpha are affected as well.
-This patch works for all of them.
-
-This bug was inherited from gzip's zgrep. gzip 1.12 includes
-a fix for zgrep.
-
-The issue with the old sed script is that with multiple newlines,
-the N-command will read the second line of input, then the
-s-commands will be skipped because it's not the end of the
-file yet, then a new sed cycle starts and the pattern space
-is printed and emptied. So only the last line or two get escaped.
-
-One way to fix this would be to read all lines into the pattern
-space first. However, the included fix is even simpler: All lines
-except the last line get a backslash appended at the end. To ensure
-that shell command substitution doesn't eat a possible trailing
-newline, a colon is appended to the filename before escaping.
-The colon is later used to separate the filename from the grep
-output so it is fine to add it here instead of a few lines later.
-
-The old code also wasn't POSIX compliant as it used \n in the
-replacement section of the s-command. Using \<newline> is the
-POSIX compatible method.
-
-LC_ALL=C was added to the two critical sed commands. POSIX sed
-manual recommends it when using sed to manipulate pathnames
-because in other locales invalid multibyte sequences might
-cause issues with some sed implementations. In case of GNU sed,
-these particular sed scripts wouldn't have such problems but some
-other scripts could have, see:
-
- info '(sed)Locale Considerations'
-
-This vulnerability was discovered by:
-cleemy desu wayo working with Trend Micro Zero Day Initiative
-
-Thanks to Jim Meyering and Paul Eggert discussing the different
-ways to fix this and for coordinating the patch release schedule
-with gzip.
---- a/src/scripts/xzgrep.in
-+++ b/src/scripts/xzgrep.in
-@@ -180,22 +180,26 @@ for i; do
- { test $# -eq 1 || test $no_filename -eq 1; }; then
- eval "$grep"
- else
-+ # Append a colon so that the last character will never be a newline
-+ # which would otherwise get lost in shell command substitution.
-+ i="$i:"
-+
-+ # Escape & \ | and newlines only if such characters are present
-+ # (speed optimization).
- case $i in
- (*'
- '* | *'&'* | *'\'* | *'|'*)
-- i=$(printf '%s\n' "$i" |
-- sed '
-- $!N
-- $s/[&\|]/\\&/g
-- $s/\n/\\n/g
-- ');;
-+ i=$(printf '%s\n' "$i" | LC_ALL=C sed 's/[&\|]/\\&/g; $!s/$/\\/');;
- esac
-- sed_script="s|^|$i:|"
-+
-+ # $i already ends with a colon so don't add it here.
-+ sed_script="s|^|$i|"
-
- # Fail if grep or sed fails.
- r=$(
- exec 4>&1
-- (eval "$grep" 4>&-; echo $? >&4) 3>&- | sed "$sed_script" >&3 4>&-
-+ (eval "$grep" 4>&-; echo $? >&4) 3>&- |
-+ LC_ALL=C sed "$sed_script" >&3 4>&-
- ) || r=2
- exit $r
- fi >&3 5>&-
diff --git a/app-arch/xz-utils/metadata.xml b/app-arch/xz-utils/metadata.xml
index 75ad4f69f981..3b217f332fdd 100644
--- a/app-arch/xz-utils/metadata.xml
+++ b/app-arch/xz-utils/metadata.xml
@@ -1,16 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
-<maintainer type="project">
- <email>base-system@gentoo.org</email>
- <name>Gentoo Base System</name>
-</maintainer>
-<use>
- <flag name="extra-filters">Build additional filters that are not
- used in any of the default xz presets. This includes delta
- and BCJ coders, additional match finders and SHA256 checks.</flag>
-</use>
-<upstream>
- <remote-id type="cpe">cpe:/a:tukaani:xz</remote-id>
-</upstream>
+ <maintainer type="project">
+ <email>base-system@gentoo.org</email>
+ <name>Gentoo Base System</name>
+ </maintainer>
+ <use>
+ <flag name="extra-filters">Build additional filters that are not
+ used in any of the default xz presets. This includes delta
+ and BCJ coders, additional match finders and SHA256 checks.</flag>
+ <flag name="pgo">Optimize the build using Profile Guided Optimization (PGO)</flag>
+ </use>
+ <upstream>
+ <remote-id type="cpe">cpe:/a:tukaani:xz</remote-id>
+ <remote-id type="sourceforge">lzmautils</remote-id>
+ <remote-id type="github">tukaani-project/xz</remote-id>
+ </upstream>
</pkgmetadata>
diff --git a/app-arch/xz-utils/xz-utils-5.2.5-r2.ebuild b/app-arch/xz-utils/xz-utils-5.2.5-r2.ebuild
deleted file mode 100644
index 752953853e1d..000000000000
--- a/app-arch/xz-utils/xz-utils-5.2.5-r2.ebuild
+++ /dev/null
@@ -1,118 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-# Remember: we cannot leverage autotools in this ebuild in order
-# to avoid circular deps with autotools
-
-EAPI=7
-
-inherit libtool multilib multilib-minimal preserve-libs usr-ldscript
-
-if [[ ${PV} == 9999 ]] ; then
- EGIT_REPO_URI="https://git.tukaani.org/xz.git"
- inherit git-r3 autotools
-
- # bug #272880 and bug #286068
- BDEPEND="sys-devel/gettext >=sys-devel/libtool-2"
-else
- VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/lassecollin.asc
- inherit verify-sig
-
- MY_P="${PN/-utils}-${PV/_}"
- SRC_URI="https://tukaani.org/xz/${MY_P}.tar.gz"
- SRC_URI+=" verify-sig? ( https://tukaani.org/xz/${MY_P}.tar.gz.sig )"
-
- if [[ ${PV} != *_alpha* ]] && [[ ${PV} != *_beta* ]] ; then
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
- fi
- S="${WORKDIR}/${MY_P}"
-fi
-
-DESCRIPTION="Utils for managing LZMA compressed files"
-HOMEPAGE="https://tukaani.org/xz/"
-
-# See top-level COPYING file as it outlines the various pieces and their licenses.
-LICENSE="public-domain LGPL-2.1+ GPL-2+"
-SLOT="0"
-IUSE="+extra-filters nls static-libs"
-
-RDEPEND="!<app-arch/lzma-4.63
- !<app-arch/p7zip-4.57
- !<app-i18n/man-pages-de-2.16"
-DEPEND="${RDEPEND}"
-BDEPEND="verify-sig? ( sec-keys/openpgp-keys-lassecollin )"
-
-# Tests currently do not account for smaller feature set
-RESTRICT="!extra-filters? ( test )"
-
-PATCHES=(
- "${FILESDIR}"/${P}-xzgrep-ZDI-CAN-16587.patch
-)
-
-src_prepare() {
- default
-
- if [[ ${PV} == 9999 ]] ; then
- eautopoint
- eautoreconf
- else
- # Allow building shared libs on Solaris/x64
- elibtoolize
- fi
-}
-
-multilib_src_configure() {
- local myconf=(
- --enable-threads
- $(use_enable nls)
- $(use_enable static-libs static)
- )
-
- if ! multilib_is_native_abi ; then
- myconf+=(
- --disable-{xz,xzdec,lzmadec,lzmainfo,lzma-links,scripts}
- )
- fi
-
- if ! use extra-filters ; then
- myconf+=(
- # LZMA1 + LZMA2 for standard .lzma & .xz files
- --enable-encoders=lzma1,lzma2
- --enable-decoders=lzma1,lzma2
-
- # those are used by default, depending on preset
- --enable-match-finders=hc3,hc4,bt4
-
- # CRC64 is used by default, though some (old?) files use CRC32
- --enable-checks=crc32,crc64
- )
- fi
-
- if [[ ${CHOST} == *-solaris* ]] ; then
- export gl_cv_posix_shell="${EPREFIX}"/bin/sh
-
- # Undo Solaris-based defaults pointing to /usr/xpg5/bin
- myconf+=( --disable-path-for-script )
- fi
-
- ECONF_SOURCE="${S}" econf "${myconf[@]}"
-}
-
-multilib_src_install() {
- default
-
- gen_usr_ldscript -a lzma
-}
-
-multilib_src_install_all() {
- find "${ED}" -type f -name '*.la' -delete || die
- rm "${ED}"/usr/share/doc/${PF}/COPYING* || die
-}
-
-pkg_preinst() {
- preserve_old_lib /usr/$(get_libdir)/liblzma$(get_libname 0)
-}
-
-pkg_postinst() {
- preserve_old_lib_notify /usr/$(get_libdir)/liblzma$(get_libname 0)
-}
diff --git a/app-arch/xz-utils/xz-utils-5.4.2.ebuild b/app-arch/xz-utils/xz-utils-5.4.2.ebuild
new file mode 100644
index 000000000000..f518ba04f8dd
--- /dev/null
+++ b/app-arch/xz-utils/xz-utils-5.4.2.ebuild
@@ -0,0 +1,140 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# Remember: we cannot leverage autotools in this ebuild in order
+# to avoid circular deps with autotools
+
+EAPI=8
+
+inherit flag-o-matic libtool multilib multilib-minimal preserve-libs toolchain-funcs
+
+if [[ ${PV} == 9999 ]] ; then
+ # Per tukaani.org, git.tukaani.org is a mirror of github and
+ # may be behind.
+ EGIT_REPO_URI="
+ https://github.com/tukaani-project/xz
+ https://git.tukaani.org/xz.git
+ "
+ inherit git-r3 autotools
+
+ # bug #272880 and bug #286068
+ BDEPEND="sys-devel/gettext >=dev-build/libtool-2"
+else
+ VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/lassecollin.asc
+ inherit verify-sig
+
+ MY_P="${PN/-utils}-${PV/_}"
+ SRC_URI="
+ https://github.com/tukaani-project/xz/releases/download/v${PV/_}/${MY_P}.tar.gz
+ https://downloads.sourceforge.net/lzmautils/${MY_P}.tar.gz
+ https://tukaani.org/xz/${MY_P}.tar.gz
+ verify-sig? (
+ https://github.com/tukaani-project/xz/releases/download/v${PV/_}/${MY_P}.tar.gz.sig
+ https://tukaani.org/xz/${MY_P}.tar.gz.sig
+ )
+ "
+
+ if [[ ${PV} != *_alpha* && ${PV} != *_beta* ]] ; then
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+ fi
+
+ S="${WORKDIR}/${MY_P}"
+fi
+
+DESCRIPTION="Utils for managing LZMA compressed files"
+HOMEPAGE="https://tukaani.org/xz/"
+
+# See top-level COPYING file as it outlines the various pieces and their licenses.
+LICENSE="public-domain LGPL-2.1+ GPL-2+"
+SLOT="0"
+IUSE="doc +extra-filters pgo nls static-libs"
+
+if [[ ${PV} != 9999 ]] ; then
+ BDEPEND+=" verify-sig? ( >=sec-keys/openpgp-keys-lassecollin-20230213 )"
+fi
+
+src_prepare() {
+ default
+
+ if [[ ${PV} == 9999 ]] ; then
+ eautopoint
+ eautoreconf
+ else
+ # Allow building shared libs on Solaris/x64
+ elibtoolize
+ fi
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --enable-threads
+ $(multilib_native_use_enable doc)
+ $(use_enable nls)
+ $(use_enable static-libs static)
+ )
+
+ if ! multilib_is_native_abi ; then
+ myconf+=(
+ --disable-{xz,xzdec,lzmadec,lzmainfo,lzma-links,scripts}
+ )
+ fi
+
+ if ! use extra-filters ; then
+ myconf+=(
+ # LZMA1 + LZMA2 for standard .lzma & .xz files
+ --enable-encoders=lzma1,lzma2
+ --enable-decoders=lzma1,lzma2
+
+ # those are used by default, depending on preset
+ --enable-match-finders=hc3,hc4,bt4
+
+ # CRC64 is used by default, though some (old?) files use CRC32
+ --enable-checks=crc32,crc64
+ )
+ fi
+
+ if [[ ${CHOST} == *-solaris* ]] ; then
+ export gl_cv_posix_shell="${EPREFIX}"/bin/sh
+
+ # Undo Solaris-based defaults pointing to /usr/xpg5/bin
+ myconf+=( --disable-path-for-script )
+ fi
+
+ ECONF_SOURCE="${S}" econf "${myconf[@]}"
+}
+
+multilib_src_compile() {
+ # -fprofile-partial-training because upstream note the test suite isn't super comprehensive
+ # See https://documentation.suse.com/sbp/all/html/SBP-GCC-10/index.html#sec-gcc10-pgo
+ local pgo_generate_flags=$(usev pgo "-fprofile-update=atomic -fprofile-dir=${T}/${ABI}-pgo -fprofile-generate=${T}/${ABI}-pgo $(test-flags-CC -fprofile-partial-training)")
+ local pgo_use_flags=$(usev pgo "-fprofile-use=${T}/${ABI}-pgo -fprofile-dir=${T}/${ABI}-pgo $(test-flags-CC -fprofile-partial-training)")
+
+ emake CFLAGS="${CFLAGS} ${pgo_generate_flags}"
+
+ if use pgo ; then
+ emake CFLAGS="${CFLAGS} ${pgo_generate_flags}" -k check
+
+ if tc-is-clang; then
+ llvm-profdata merge "${T}"/${ABI}-pgo --output="${T}"/${ABI}-pgo/default.profdata || die
+ fi
+
+ emake clean
+ emake CFLAGS="${CFLAGS} ${pgo_use_flags}"
+ fi
+}
+
+multilib_src_install_all() {
+ find "${ED}" -type f -name '*.la' -delete || die
+
+ if use doc ; then
+ rm "${ED}"/usr/share/doc/${PF}/COPYING* || die
+ fi
+}
+
+pkg_preinst() {
+ preserve_old_lib /usr/$(get_libdir)/liblzma$(get_libname 0)
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /usr/$(get_libdir)/liblzma$(get_libname 0)
+}
diff --git a/app-arch/xz-utils/xz-utils-5.2.6.ebuild b/app-arch/xz-utils/xz-utils-5.4.7.ebuild
index 6da152d612d9..cd73493d1889 100644
--- a/app-arch/xz-utils/xz-utils-5.2.6.ebuild
+++ b/app-arch/xz-utils/xz-utils-5.4.7.ebuild
@@ -1,29 +1,41 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Remember: we cannot leverage autotools in this ebuild in order
# to avoid circular deps with autotools
-EAPI=7
+EAPI=8
-inherit libtool multilib multilib-minimal preserve-libs usr-ldscript
+inherit flag-o-matic libtool multilib multilib-minimal preserve-libs toolchain-funcs
if [[ ${PV} == 9999 ]] ; then
- EGIT_REPO_URI="https://git.tukaani.org/xz.git"
+ # Per tukaani.org, git.tukaani.org is a mirror of github and
+ # may be behind.
+ EGIT_REPO_URI="
+ https://github.com/tukaani-project/xz
+ https://git.tukaani.org/xz.git
+ "
inherit git-r3 autotools
# bug #272880 and bug #286068
- BDEPEND="sys-devel/gettext >=sys-devel/libtool-2"
+ BDEPEND="sys-devel/gettext >=dev-build/libtool-2"
else
- VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/lassecollin.asc
+ VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/lassecollin.asc
inherit verify-sig
MY_P="${PN/-utils}-${PV/_}"
- SRC_URI="https://tukaani.org/xz/${MY_P}.tar.gz"
- SRC_URI+=" verify-sig? ( https://tukaani.org/xz/${MY_P}.tar.gz.sig )"
+ SRC_URI="
+ https://github.com/tukaani-project/xz/releases/download/v${PV/_}/${MY_P}.tar.gz
+ https://downloads.sourceforge.net/lzmautils/${MY_P}.tar.gz
+ https://tukaani.org/xz/${MY_P}.tar.gz
+ verify-sig? (
+ https://github.com/tukaani-project/xz/releases/download/v${PV/_}/${MY_P}.tar.gz.sig
+ https://tukaani.org/xz/${MY_P}.tar.gz.sig
+ )
+ "
if [[ ${PV} != *_alpha* && ${PV} != *_beta* ]] ; then
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
fi
S="${WORKDIR}/${MY_P}"
@@ -35,19 +47,12 @@ HOMEPAGE="https://tukaani.org/xz/"
# See top-level COPYING file as it outlines the various pieces and their licenses.
LICENSE="public-domain LGPL-2.1+ GPL-2+"
SLOT="0"
-IUSE="+extra-filters nls static-libs"
+IUSE="doc +extra-filters pgo nls static-libs"
-RDEPEND="!<app-arch/lzma-4.63
- !<app-arch/p7zip-4.57
- !<app-i18n/man-pages-de-2.16"
-DEPEND="${RDEPEND}"
if [[ ${PV} != 9999 ]] ; then
- BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-lassecollin )"
+ BDEPEND+=" verify-sig? ( >=sec-keys/openpgp-keys-lassecollin-20240529 )"
fi
-# Tests currently do not account for smaller feature set
-RESTRICT="!extra-filters? ( test )"
-
src_prepare() {
default
@@ -63,6 +68,7 @@ src_prepare() {
multilib_src_configure() {
local myconf=(
--enable-threads
+ $(multilib_native_use_enable doc)
$(use_enable nls)
$(use_enable static-libs static)
)
@@ -97,15 +103,32 @@ multilib_src_configure() {
ECONF_SOURCE="${S}" econf "${myconf[@]}"
}
-multilib_src_install() {
- default
+multilib_src_compile() {
+ # -fprofile-partial-training because upstream note the test suite isn't super comprehensive
+ # See https://documentation.suse.com/sbp/all/html/SBP-GCC-10/index.html#sec-gcc10-pgo
+ local pgo_generate_flags=$(usev pgo "-fprofile-update=atomic -fprofile-dir=${T}/${ABI}-pgo -fprofile-generate=${T}/${ABI}-pgo $(test-flags-CC -fprofile-partial-training)")
+ local pgo_use_flags=$(usev pgo "-fprofile-use=${T}/${ABI}-pgo -fprofile-dir=${T}/${ABI}-pgo $(test-flags-CC -fprofile-partial-training)")
+
+ emake CFLAGS="${CFLAGS} ${pgo_generate_flags}"
+
+ if use pgo ; then
+ emake CFLAGS="${CFLAGS} ${pgo_generate_flags}" -k check
- gen_usr_ldscript -a lzma
+ if tc-is-clang; then
+ llvm-profdata merge "${T}"/${ABI}-pgo --output="${T}"/${ABI}-pgo/default.profdata || die
+ fi
+
+ emake clean
+ emake CFLAGS="${CFLAGS} ${pgo_use_flags}"
+ fi
}
multilib_src_install_all() {
find "${ED}" -type f -name '*.la' -delete || die
- rm "${ED}"/usr/share/doc/${PF}/COPYING* || die
+
+ if use doc ; then
+ rm "${ED}"/usr/share/doc/${PF}/COPYING* || die
+ fi
}
pkg_preinst() {
diff --git a/app-arch/xz-utils/xz-utils-5.6.2.ebuild b/app-arch/xz-utils/xz-utils-5.6.2.ebuild
new file mode 100644
index 000000000000..923a92ff82a9
--- /dev/null
+++ b/app-arch/xz-utils/xz-utils-5.6.2.ebuild
@@ -0,0 +1,179 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# Remember: we cannot leverage autotools in this ebuild in order
+# to avoid circular deps with autotools
+
+EAPI=8
+
+inherit flag-o-matic libtool multilib multilib-minimal preserve-libs toolchain-funcs
+
+if [[ ${PV} == 9999 ]] ; then
+ # Per tukaani.org, git.tukaani.org is a mirror of github and
+ # may be behind.
+ EGIT_REPO_URI="
+ https://github.com/tukaani-project/xz
+ https://git.tukaani.org/xz.git
+ "
+ inherit git-r3 autotools
+
+ # bug #272880 and bug #286068
+ BDEPEND="sys-devel/gettext >=dev-build/libtool-2"
+else
+ VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/lassecollin.asc
+ inherit verify-sig
+
+ MY_P="${PN/-utils}-${PV/_}"
+ SRC_URI="
+ https://github.com/tukaani-project/xz/releases/download/v${PV/_}/${MY_P}.tar.gz
+ https://downloads.sourceforge.net/lzmautils/${MY_P}.tar.gz
+ https://tukaani.org/xz/${MY_P}.tar.gz
+ verify-sig? (
+ https://github.com/tukaani-project/xz/releases/download/v${PV/_}/${MY_P}.tar.gz.sig
+ https://tukaani.org/xz/${MY_P}.tar.gz.sig
+ )
+ "
+
+ if [[ ${PV} != *_alpha* && ${PV} != *_beta* ]] ; then
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
+ fi
+
+ S="${WORKDIR}/${MY_P}"
+fi
+
+DESCRIPTION="Utils for managing LZMA compressed files"
+HOMEPAGE="https://tukaani.org/xz/"
+
+# See top-level COPYING file as it outlines the various pieces and their licenses.
+LICENSE="0BSD LGPL-2.1+ GPL-2+ doc? ( CC-BY-SA-4.0 )"
+SLOT="0"
+IUSE="cpu_flags_arm_crc32 doc +extra-filters pgo nls static-libs"
+
+if [[ ${PV} != 9999 ]] ; then
+ BDEPEND+=" verify-sig? ( >=sec-keys/openpgp-keys-lassecollin-20240529 )"
+fi
+
+src_prepare() {
+ default
+
+ if [[ ${PV} == 9999 ]] ; then
+ eautopoint
+ eautoreconf
+ else
+ # Allow building shared libs on Solaris/x64
+ elibtoolize
+ fi
+}
+
+multilib_src_configure() {
+ local myconf=(
+ --enable-threads
+ $(multilib_native_use_enable doc)
+ $(use_enable nls)
+ $(use_enable static-libs static)
+ $(use_enable cpu_flags_arm_crc32 arm64-crc32)
+ )
+
+ if ! multilib_is_native_abi ; then
+ myconf+=(
+ --disable-{xz,xzdec,lzmadec,lzmainfo,lzma-links,scripts}
+ )
+ fi
+
+ if ! use extra-filters ; then
+ myconf+=(
+ # LZMA1 + LZMA2 for standard .lzma & .xz files
+ --enable-encoders=lzma1,lzma2
+ --enable-decoders=lzma1,lzma2
+
+ # those are used by default, depending on preset
+ --enable-match-finders=hc3,hc4,bt4
+
+ # CRC64 is used by default, though some (old?) files use CRC32
+ --enable-checks=crc32,crc64
+ )
+ fi
+
+ if [[ ${CHOST} == *-solaris* ]] ; then
+ export gl_cv_posix_shell="${EPREFIX}"/bin/sh
+
+ # Undo Solaris-based defaults pointing to /usr/xpg5/bin
+ myconf+=( --disable-path-for-script )
+ fi
+
+ ECONF_SOURCE="${S}" econf "${myconf[@]}"
+}
+
+multilib_src_compile() {
+ # -fprofile-partial-training because upstream note the test suite isn't super comprehensive
+ # TODO: revisit that now we have the tar/xz loop below?
+ # See https://documentation.suse.com/sbp/all/html/SBP-GCC-10/index.html#sec-gcc10-pgo
+ local pgo_generate_flags=$(usev pgo "-fprofile-update=atomic -fprofile-dir=${T}/${ABI}-pgo -fprofile-generate=${T}/${ABI}-pgo $(test-flags-CC -fprofile-partial-training)")
+ local pgo_use_flags=$(usev pgo "-fprofile-use=${T}/${ABI}-pgo -fprofile-dir=${T}/${ABI}-pgo $(test-flags-CC -fprofile-partial-training)")
+
+ emake CFLAGS="${CFLAGS} ${pgo_generate_flags}"
+
+ if use pgo ; then
+ emake CFLAGS="${CFLAGS} ${pgo_generate_flags}" -k check
+
+ if multilib_is_native_abi ; then
+ (
+ shopt -s globstar
+
+ tar \
+ --sort=name --mtime=@2718281828 \
+ -cf xz-pgo-test-01.tar \
+ {"${S}","${BUILD_DIR}"}/**/*.[cho] \
+ {"${S}","${BUILD_DIR}"}/**/*.so* \
+ {"${S}","${BUILD_DIR}"}/**/**.txt \
+ {"${S}","${BUILD_DIR}"}/tests/files \
+
+ stat --printf="xz-pgo-test-01.tar.tar size: %s\n" xz-pgo-test-01.tar
+ md5sum xz-pgo-test-01.tar
+ )
+
+ local test_variants=(
+ # Borrowed from ALT Linux
+ # https://packages.altlinux.org/en/sisyphus/srpms/xz/specfiles/#line-80
+ '-0 -C none'
+ '-2 -C crc32'
+ '-6 --arm --lzma2 -C crc64'
+ '-6 --x86 --lzma2=lc=4 -C sha256'
+ '-7e --format=lzma'
+
+ # Our own variants
+ ''
+ '-9e'
+ '--x86 --lzma2=preset=9e'
+ )
+ local test_variant
+ for test_variant in "${test_variants[@]}" ; do
+ "${BUILD_DIR}"/src/xz/xz -c ${test_variant} xz-pgo-test-01.tar | "${BUILD_DIR}"/src/xz/xz -c -d - > /dev/null
+ assert "Testing '${test_variant}' variant failed"
+ done
+ fi
+
+ if tc-is-clang; then
+ llvm-profdata merge "${T}"/${ABI}-pgo --output="${T}"/${ABI}-pgo/default.profdata || die
+ fi
+
+ emake clean
+ emake CFLAGS="${CFLAGS} ${pgo_use_flags}"
+ fi
+}
+
+multilib_src_install_all() {
+ find "${ED}" -type f -name '*.la' -delete || die
+
+ if use doc ; then
+ rm "${ED}"/usr/share/doc/${PF}/COPYING* || die
+ fi
+}
+
+pkg_preinst() {
+ preserve_old_lib /usr/$(get_libdir)/liblzma$(get_libname 0)
+}
+
+pkg_postinst() {
+ preserve_old_lib_notify /usr/$(get_libdir)/liblzma$(get_libname 0)
+}
diff --git a/app-arch/xz-utils/xz-utils-9999.ebuild b/app-arch/xz-utils/xz-utils-9999.ebuild
index 6da152d612d9..923a92ff82a9 100644
--- a/app-arch/xz-utils/xz-utils-9999.ebuild
+++ b/app-arch/xz-utils/xz-utils-9999.ebuild
@@ -1,29 +1,41 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
# Remember: we cannot leverage autotools in this ebuild in order
# to avoid circular deps with autotools
-EAPI=7
+EAPI=8
-inherit libtool multilib multilib-minimal preserve-libs usr-ldscript
+inherit flag-o-matic libtool multilib multilib-minimal preserve-libs toolchain-funcs
if [[ ${PV} == 9999 ]] ; then
- EGIT_REPO_URI="https://git.tukaani.org/xz.git"
+ # Per tukaani.org, git.tukaani.org is a mirror of github and
+ # may be behind.
+ EGIT_REPO_URI="
+ https://github.com/tukaani-project/xz
+ https://git.tukaani.org/xz.git
+ "
inherit git-r3 autotools
# bug #272880 and bug #286068
- BDEPEND="sys-devel/gettext >=sys-devel/libtool-2"
+ BDEPEND="sys-devel/gettext >=dev-build/libtool-2"
else
- VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/lassecollin.asc
+ VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/lassecollin.asc
inherit verify-sig
MY_P="${PN/-utils}-${PV/_}"
- SRC_URI="https://tukaani.org/xz/${MY_P}.tar.gz"
- SRC_URI+=" verify-sig? ( https://tukaani.org/xz/${MY_P}.tar.gz.sig )"
+ SRC_URI="
+ https://github.com/tukaani-project/xz/releases/download/v${PV/_}/${MY_P}.tar.gz
+ https://downloads.sourceforge.net/lzmautils/${MY_P}.tar.gz
+ https://tukaani.org/xz/${MY_P}.tar.gz
+ verify-sig? (
+ https://github.com/tukaani-project/xz/releases/download/v${PV/_}/${MY_P}.tar.gz.sig
+ https://tukaani.org/xz/${MY_P}.tar.gz.sig
+ )
+ "
if [[ ${PV} != *_alpha* && ${PV} != *_beta* ]] ; then
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+ KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
fi
S="${WORKDIR}/${MY_P}"
@@ -33,21 +45,14 @@ DESCRIPTION="Utils for managing LZMA compressed files"
HOMEPAGE="https://tukaani.org/xz/"
# See top-level COPYING file as it outlines the various pieces and their licenses.
-LICENSE="public-domain LGPL-2.1+ GPL-2+"
+LICENSE="0BSD LGPL-2.1+ GPL-2+ doc? ( CC-BY-SA-4.0 )"
SLOT="0"
-IUSE="+extra-filters nls static-libs"
+IUSE="cpu_flags_arm_crc32 doc +extra-filters pgo nls static-libs"
-RDEPEND="!<app-arch/lzma-4.63
- !<app-arch/p7zip-4.57
- !<app-i18n/man-pages-de-2.16"
-DEPEND="${RDEPEND}"
if [[ ${PV} != 9999 ]] ; then
- BDEPEND+=" verify-sig? ( sec-keys/openpgp-keys-lassecollin )"
+ BDEPEND+=" verify-sig? ( >=sec-keys/openpgp-keys-lassecollin-20240529 )"
fi
-# Tests currently do not account for smaller feature set
-RESTRICT="!extra-filters? ( test )"
-
src_prepare() {
default
@@ -63,8 +68,10 @@ src_prepare() {
multilib_src_configure() {
local myconf=(
--enable-threads
+ $(multilib_native_use_enable doc)
$(use_enable nls)
$(use_enable static-libs static)
+ $(use_enable cpu_flags_arm_crc32 arm64-crc32)
)
if ! multilib_is_native_abi ; then
@@ -97,15 +104,70 @@ multilib_src_configure() {
ECONF_SOURCE="${S}" econf "${myconf[@]}"
}
-multilib_src_install() {
- default
-
- gen_usr_ldscript -a lzma
+multilib_src_compile() {
+ # -fprofile-partial-training because upstream note the test suite isn't super comprehensive
+ # TODO: revisit that now we have the tar/xz loop below?
+ # See https://documentation.suse.com/sbp/all/html/SBP-GCC-10/index.html#sec-gcc10-pgo
+ local pgo_generate_flags=$(usev pgo "-fprofile-update=atomic -fprofile-dir=${T}/${ABI}-pgo -fprofile-generate=${T}/${ABI}-pgo $(test-flags-CC -fprofile-partial-training)")
+ local pgo_use_flags=$(usev pgo "-fprofile-use=${T}/${ABI}-pgo -fprofile-dir=${T}/${ABI}-pgo $(test-flags-CC -fprofile-partial-training)")
+
+ emake CFLAGS="${CFLAGS} ${pgo_generate_flags}"
+
+ if use pgo ; then
+ emake CFLAGS="${CFLAGS} ${pgo_generate_flags}" -k check
+
+ if multilib_is_native_abi ; then
+ (
+ shopt -s globstar
+
+ tar \
+ --sort=name --mtime=@2718281828 \
+ -cf xz-pgo-test-01.tar \
+ {"${S}","${BUILD_DIR}"}/**/*.[cho] \
+ {"${S}","${BUILD_DIR}"}/**/*.so* \
+ {"${S}","${BUILD_DIR}"}/**/**.txt \
+ {"${S}","${BUILD_DIR}"}/tests/files \
+
+ stat --printf="xz-pgo-test-01.tar.tar size: %s\n" xz-pgo-test-01.tar
+ md5sum xz-pgo-test-01.tar
+ )
+
+ local test_variants=(
+ # Borrowed from ALT Linux
+ # https://packages.altlinux.org/en/sisyphus/srpms/xz/specfiles/#line-80
+ '-0 -C none'
+ '-2 -C crc32'
+ '-6 --arm --lzma2 -C crc64'
+ '-6 --x86 --lzma2=lc=4 -C sha256'
+ '-7e --format=lzma'
+
+ # Our own variants
+ ''
+ '-9e'
+ '--x86 --lzma2=preset=9e'
+ )
+ local test_variant
+ for test_variant in "${test_variants[@]}" ; do
+ "${BUILD_DIR}"/src/xz/xz -c ${test_variant} xz-pgo-test-01.tar | "${BUILD_DIR}"/src/xz/xz -c -d - > /dev/null
+ assert "Testing '${test_variant}' variant failed"
+ done
+ fi
+
+ if tc-is-clang; then
+ llvm-profdata merge "${T}"/${ABI}-pgo --output="${T}"/${ABI}-pgo/default.profdata || die
+ fi
+
+ emake clean
+ emake CFLAGS="${CFLAGS} ${pgo_use_flags}"
+ fi
}
multilib_src_install_all() {
find "${ED}" -type f -name '*.la' -delete || die
- rm "${ED}"/usr/share/doc/${PF}/COPYING* || die
+
+ if use doc ; then
+ rm "${ED}"/usr/share/doc/${PF}/COPYING* || die
+ fi
}
pkg_preinst() {