From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1649361-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 607F21581C1
	for <garchives@archives.gentoo.org>; Wed,  3 Jul 2024 19:09:24 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 96830E2A76;
	Wed,  3 Jul 2024 19:09:23 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.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 26E70E2A76
	for <gentoo-commits@lists.gentoo.org>; Wed,  3 Jul 2024 19:09:23 +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 4CC63340DC8
	for <gentoo-commits@lists.gentoo.org>; Wed,  3 Jul 2024 19:09:22 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id A5520154E
	for <gentoo-commits@lists.gentoo.org>; Wed,  3 Jul 2024 19:09:20 +0000 (UTC)
From: "Arthur Zamarin" <arthurzam@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, "Arthur Zamarin" <arthurzam@gentoo.org>
Message-ID: <1720033752.939dceaa741a1e8ef1d699b0eca904d49e374513.arthurzam@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: app-arch/7zip/
X-VCS-Repository: repo/gentoo
X-VCS-Files: app-arch/7zip/7zip-24.07.ebuild app-arch/7zip/Manifest
X-VCS-Directories: app-arch/7zip/
X-VCS-Committer: arthurzam
X-VCS-Committer-Name: Arthur Zamarin
X-VCS-Revision: 939dceaa741a1e8ef1d699b0eca904d49e374513
X-VCS-Branch: master
Date: Wed,  3 Jul 2024 19:09:20 +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: 1fb741a0-223f-4e42-a5c3-3f41579042de
X-Archives-Hash: 9dfb511566c781dcdf953d8eb6843dfe

commit:     939dceaa741a1e8ef1d699b0eca904d49e374513
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Wed Jul  3 19:06:33 2024 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Wed Jul  3 19:09:12 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=939dceaa

app-arch/7zip: add 24.07

Closes: https://bugs.gentoo.org/935412
Signed-off-by: Arthur Zamarin <arthurzam <AT> gentoo.org>

 app-arch/7zip/7zip-24.07.ebuild | 110 ++++++++++++++++++++++++++++++++++++++++
 app-arch/7zip/Manifest          |   2 +
 2 files changed, 112 insertions(+)

diff --git a/app-arch/7zip/7zip-24.07.ebuild b/app-arch/7zip/7zip-24.07.ebuild
new file mode 100644
index 000000000000..59e13dc0c5e5
--- /dev/null
+++ b/app-arch/7zip/7zip-24.07.ebuild
@@ -0,0 +1,110 @@
+# Copyright 2023-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit edos2unix flag-o-matic toolchain-funcs
+
+NO_DOT_PV=$(ver_rs 1- '')
+DESCRIPTION="Free file archiver for extremely high compression"
+HOMEPAGE="https://www.7-zip.org/ https://sourceforge.net/projects/sevenzip/"
+# linux-x64 tarball is only used for docs
+SRC_URI="
+	https://downloads.sourceforge.net/sevenzip/7-Zip/${PV}/7z${NO_DOT_PV}-src.tar.xz
+	https://downloads.sourceforge.net/sevenzip/7-Zip/${PV}/7z${NO_DOT_PV}-linux-x64.tar.xz
+"
+S="${WORKDIR}"
+
+LICENSE="LGPL-2 BSD rar? ( unRAR )"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64"
+IUSE="uasm jwasm rar"
+REQUIRED_USE="?? ( uasm jwasm )"
+
+DOCS=( readme.txt History.txt License.txt )
+HTML_DOCS=( MANUAL )
+
+DEPEND="${RDEPEND}"
+BDEPEND="
+	uasm? ( dev-lang/uasm )
+	jwasm? ( dev-lang/jwasm )
+"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-24.05-respect-build-env.patch"
+)
+
+# TODO(NRK): also build and install the library
+# TODO(NRK): make it so this package can be used as a drop-in replacement
+# for app-arch/p7zip ??
+
+pkg_setup() {
+	# instructions in DOC/readme.txt, Compiling 7-Zip for Unix/Linux
+	# TLDR; every combination of options (clang|gcc)+(asm/noasm)
+	# has a dedicated makefile & builddir
+	mfile="cmpl"
+	if tc-is-clang; then
+		mfile="${mfile}_clang"
+		bdir=c
+	elif tc-is-gcc; then
+		mfile="${mfile}_gcc"
+		bdir=g
+	else
+		die "Unsupported compiler: $(tc-getCC)"
+	fi
+	if use jwasm || use uasm ; then
+		mfile="${mfile}_x64"
+		bdir="${bdir}_x64"
+	fi
+	export mfile="${mfile}.mak"
+	export bdir
+}
+
+src_prepare() {
+	# patch doesn't deal with CRLF even if file+patch match
+	# not even with --ignore-whitespace, --binary or --force
+	pushd "./CPP/7zip" || die "Unable to switch directory"
+	edos2unix ./7zip_gcc.mak ./var_gcc{,_x64}.mak ./var_clang{,_x64}.mak
+	sed -i -e 's/-Werror //g' ./7zip_gcc.mak || die "Error removing -Werror"
+	popd >/dev/null || die "Unable to switch directory"
+
+	default
+}
+
+src_compile() {
+	pushd "./CPP/7zip/Bundles/Alone2" || die "Unable to switch directory"
+
+	# avoid executable stack when using uasm/jwasm, harmless otherwise
+	append-ldflags -Wl,-z,noexecstack
+	export G_CFLAGS=${CFLAGS}
+	export G_CXXFLAGS=${CXXFLAGS}
+	export G_LDFLAGS=${LDFLAGS}
+
+	local args=(
+		-f "../../${mfile}"
+		CC=$(tc-getCC)
+		CXX=$(tc-getCXX)
+	)
+	# NOTE: makefile doesn't check the value of DISABLE_RAR_COMPRESS, only
+	# whether it's defined or not. so in case user has `rar` enabled
+	# DISABLE_RAR_COMPRESS (and DISABLE_RAR) needs to stay undefined.
+	if ! use rar; then
+		# disables non-free rar code but allows listing and extracting
+		# non-compressed rar archives
+		args+=( DISABLE_RAR_COMPRESS=1 )
+	fi
+	if use jwasm; then
+		args+=( USE_JWASM=1 )
+	elif use uasm; then
+		args+=( MY_ASM=uasm )
+	fi
+
+	mkdir -p "${bdir}" || die  # Bug: https://bugs.gentoo.org/933619
+	emake ${args[@]}
+	popd > /dev/null || die "Unable to switch directory"
+}
+
+src_install() {
+	dobin "./CPP/7zip/Bundles/Alone2/b/${bdir}/7zz"
+	einstalldocs
+}

diff --git a/app-arch/7zip/Manifest b/app-arch/7zip/Manifest
index d0f226033c4e..763dd2f63f9e 100644
--- a/app-arch/7zip/Manifest
+++ b/app-arch/7zip/Manifest
@@ -4,3 +4,5 @@ DIST 7z2405-linux-x64.tar.xz 1553872 BLAKE2B d6c0bd4eb81f4112bfe50bf6affc68021b0
 DIST 7z2405-src.tar.xz 1486772 BLAKE2B 609c7ae8b89e56e747ebfecb25108d8918138f48f0f2ed73183c76101ddd3615aafb9eb7823be0de2a434b450587e01f476d2ed092628a311b6e4ed091e06260 SHA512 d340adfa68e818dd3d3aa411780c81532fa37b6649178b81ec3739725f83e0bc3c01744612b2d467f4d0c2cc984dd35488406d7baee185cf372acebd9c0123a7
 DIST 7z2406-linux-x64.tar.xz 1551724 BLAKE2B e4cc8141b074209b58018e6aeb4b91f140160d5d52e1fba59da2d0cfcd41c488cbfa4bda99bdedd4915ca3c3bcca50e7f7f4289f44ce120577c8b632d2f7bf07 SHA512 fce2b8e9f26f092209613dc058a267ddf24c474a80b7e9837014fdaeab53bb892b7181561ca90048ca593fe29e010b8221e078c9c3ab9815baf23bc9caf3e829
 DIST 7z2406-src.tar.xz 1487008 BLAKE2B 0f8dd19a031520a9c233725e376bca06c91b9b513bc802a54b92ea046ae3dda69a293561938a1e4467d01333d46427bfee7a055c8b62cab7a9d04cf8262fe4eb SHA512 02c6d7d045ba0dc0e8533f471f3c138f0d6549b59594095cb81a2f0e602627bd6a49df3fd680e21400a908006121ff7ba370086db9bde639f79b821bb4c9707a
+DIST 7z2407-linux-x64.tar.xz 1554932 BLAKE2B 9229fdac09148c50032656743aba0f8ce1ec06b7fd2dad2c693dc299c5f83fc093ba047e9c3c3971bf4cc9387b0db52c84167202ed7fcecfcc6f5bc508d04ada SHA512 31b5bb832e73f3c2fd0437873fe6130b8d1bd1bea8320d1b27d06bf40dd737758732eb3664fab2c36417b96ffc5daca6607b6f1aefdaa9e697122da60e37a728
+DIST 7z2407-src.tar.xz 1488556 BLAKE2B 42b4f9553aaa4797e80a2d50073ff0e77b5261e50766f8c596a632fb013ac1514a2963f27b924485f07728d13a4536c69911867e3728e8f8604ec25fc4c6824e SHA512 0299e5c1e1dfd33ecf22077f812da1f25bf2146a713c7a7e2498d639520f21f029e853914e66a84d1edfc5d721e1f3d914a3171ab336a406a94bc82d5b2d8e5d