From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1603502-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id A4DE4158041
	for <garchives@archives.gentoo.org>; Sat, 24 Feb 2024 10:14:01 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id E2F97E2A27;
	Sat, 24 Feb 2024 10:14:00 +0000 (UTC)
Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id C3C43E2A27
	for <gentoo-commits@lists.gentoo.org>; Sat, 24 Feb 2024 10:14:00 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id EBE08343019
	for <gentoo-commits@lists.gentoo.org>; Sat, 24 Feb 2024 10:13:59 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 546DB137F
	for <gentoo-commits@lists.gentoo.org>; Sat, 24 Feb 2024 10:13:58 +0000 (UTC)
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" <sam@gentoo.org>
Message-ID: <1708769501.a34162ecb85645cad876c4e6c7e0507a349afb9e.sam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: app-arch/xz-utils/
X-VCS-Repository: repo/gentoo
X-VCS-Files: app-arch/xz-utils/Manifest app-arch/xz-utils/xz-utils-5.6.0.ebuild
X-VCS-Directories: app-arch/xz-utils/
X-VCS-Committer: sam
X-VCS-Committer-Name: Sam James
X-VCS-Revision: a34162ecb85645cad876c4e6c7e0507a349afb9e
X-VCS-Branch: master
Date: Sat, 24 Feb 2024 10:13:58 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 47729ebd-4ec2-466e-8dfc-f04b205bc86d
X-Archives-Hash: 0b1e1bc1bce097b4c04321c8d2be3d32

commit:     a34162ecb85645cad876c4e6c7e0507a349afb9e
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Feb 24 10:11:32 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Feb 24 10:11:41 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a34162ec

app-arch/xz-utils: add 5.6.0 🚀

First stable release of the improvements mentioned in 708e8c2d8e43ede23fdffb92b8505d35e0aeddc8.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 app-arch/xz-utils/Manifest              |   2 +
 app-arch/xz-utils/xz-utils-5.6.0.ebuild | 141 ++++++++++++++++++++++++++++++++
 2 files changed, 143 insertions(+)

diff --git a/app-arch/xz-utils/Manifest b/app-arch/xz-utils/Manifest
index 56ebdba5daf8..f3e269689121 100644
--- a/app-arch/xz-utils/Manifest
+++ b/app-arch/xz-utils/Manifest
@@ -6,3 +6,5 @@ DIST xz-5.5.1alpha.tar.gz 3020057 BLAKE2B 1a2106b9e43cb06ddde0f8a9fc86754fe2d335
 DIST xz-5.5.1alpha.tar.gz.sig 566 BLAKE2B 760946fd09eccd0a221d117cc1f5b656aba5bbbfa911d987fd93c54d9905a1e51dd8c24b6927cc97dda344f2efa774b556e6919bdf0b298fa6370ac8d3a56f76 SHA512 714f07b510a4a8ff0d533e6278cd25f8ed407b3c84b6172ce9d4e9fc2dfe8b0be9849eb008ee3b7ac900f34f85946336277a2700dc5133c6dcae144b8aba6dd7
 DIST xz-5.5.2beta.tar.gz 2995626 BLAKE2B 3fb1c61fbe39f1a6e74729459b0f0593699ba9f380cf072d74982bd42fd67a807988dce521e85dd1437675dd19c485ad1cdba248e82ff72975cd50edd3e522f8 SHA512 8495d98a7a50292380cbac6ae1ce4d0709cf84bca9cd639bf9252ff18d647306ca1ac4f5b258a686bca324653c8cd31c2f4d4877a15fa7300dd82a416abe59a9
 DIST xz-5.5.2beta.tar.gz.sig 566 BLAKE2B b4ab96a737b607b830c507d9df42a4e0ad463bb98fb3747f1c7b953f6738ea555e96a7324e08848617752209f05d3ee3a70936972e7d866dec58d3e0db8ddfcd SHA512 86acaba3d1c86134e9e68c9940c280f19d0fdd01897e7f6545fc6cf7d6a1034fe7a2a511f618af04e6da80a31fade608765d493b5f5c32d3684a2db46f196f28
+DIST xz-5.6.0.tar.gz 3036813 BLAKE2B 7b7ed5da5711fee6e53af1c72a6f4aff569d7cf986bca8cd3f3104cbb73342e81306295903a8660476d228344eb17d08e2a005230c06ac7e3d9e27bbaba0e075 SHA512 1ef3cd3607818314e55b28c20263a9088d4b6e5362a45fbd37c17e799e26b4a7579928b99925ffe71e7804b0db2f65936f66a825bac9b23b7b0664f902925de8
+DIST xz-5.6.0.tar.gz.sig 566 BLAKE2B 6c073c620b03751fcb40f47612acf96bee67f9dd5c38aa8ccd1f140cf3183ba009b60496fe319c14d9a32bd6cc6563f142d1716d9ae1e0554f77114dc9fc8f21 SHA512 2800c3f440b6b17b61c418e12945f136535cc5a59069be2ee0de37e312e9ad16a29338152990eeb22ebe6cc3513679bdc40336cfa089a279d3b3476ac9d13ed0

diff --git a/app-arch/xz-utils/xz-utils-5.6.0.ebuild b/app-arch/xz-utils/xz-utils-5.6.0.ebuild
new file mode 100644
index 000000000000..f3c9351bf44b
--- /dev/null
+++ b/app-arch/xz-utils/xz-utils-5.6.0.ebuild
@@ -0,0 +1,141 @@
+# 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/jiatan.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
+		mirror://sourceforge/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-jiatan )"
+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
+	# 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)
+}