public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Arthur Zamarin" <arthurzam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-arch/7zip/files/, app-arch/7zip/
Date: Sat, 18 May 2024 07:55:32 +0000 (UTC)	[thread overview]
Message-ID: <1716018924.fb8a4dea17cbe68295417ad1f5b4cb37665d24bc.arthurzam@gentoo> (raw)

commit:     fb8a4dea17cbe68295417ad1f5b4cb37665d24bc
Author:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
AuthorDate: Sat May 18 07:55:05 2024 +0000
Commit:     Arthur Zamarin <arthurzam <AT> gentoo <DOT> org>
CommitDate: Sat May 18 07:55:24 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fb8a4dea

app-arch/7zip: add 24.05

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

 app-arch/7zip/7zip-24.05.ebuild                    | 109 +++++++++++++++++++++
 app-arch/7zip/Manifest                             |   2 +
 .../7zip/files/7zip-24.05-respect-build-env.patch  |  52 ++++++++++
 3 files changed, 163 insertions(+)

diff --git a/app-arch/7zip/7zip-24.05.ebuild b/app-arch/7zip/7zip-24.05.ebuild
new file mode 100644
index 000000000000..4393a0da0302
--- /dev/null
+++ b/app-arch/7zip/7zip-24.05.ebuild
@@ -0,0 +1,109 @@
+# 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"
+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}/${P}-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
+
+	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 bd132922c901..558db29a9ad6 100644
--- a/app-arch/7zip/Manifest
+++ b/app-arch/7zip/Manifest
@@ -1,2 +1,4 @@
 DIST 7z2301-linux-x64.tar.xz 1527700 BLAKE2B 35dc74f0a7a4e586ea5ae969dce72c14e0231822630d2d70f24e1c911cea0492354a258ef65096a6ce0da1510117c12466bc6cda577cdf9e8e74ede17e47f23e SHA512 d3549468de8fd161e4c9233fa0b170af1f28c74749d20f3d0eeb3873857f6c6d2cc0777d564e6a79be7cc21c9e982e10710a795320428dc51db809a8d0f9454e
 DIST 7z2301-src.tar.xz 1378588 BLAKE2B 348484b24b39db70e513fe50d79954ea0e2dd669f83e3601fa796c8f0ca4734132ca20fac8cda9b8ba550bad9146627fc0ae07056abb99028ef6d825b6a533bd SHA512 e39f660c023aa65e55388be225b5591fe2a5c9138693f3c9107e2eb4ce97fafde118d3375e01ada99d29de9633f56221b5b3d640c982178884670cd84c8aa986
+DIST 7z2405-linux-x64.tar.xz 1553872 BLAKE2B d6c0bd4eb81f4112bfe50bf6affc68021b03d059076af5519a41c8d471e978ad2b4acc8f67c650070f9d07c518741a0146579ddfb8d56fd125f6db0beece0990 SHA512 13f97236157e2761a0bf406b08fba13a1ecc6d5663fb38f8dfe3b87f3910ba34fd359d8b36bea5135319543f31ec1e210eb512ea9864d9b140c336b9e416c313
+DIST 7z2405-src.tar.xz 1486772 BLAKE2B 609c7ae8b89e56e747ebfecb25108d8918138f48f0f2ed73183c76101ddd3615aafb9eb7823be0de2a434b450587e01f476d2ed092628a311b6e4ed091e06260 SHA512 d340adfa68e818dd3d3aa411780c81532fa37b6649178b81ec3739725f83e0bc3c01744612b2d467f4d0c2cc984dd35488406d7baee185cf372acebd9c0123a7

diff --git a/app-arch/7zip/files/7zip-24.05-respect-build-env.patch b/app-arch/7zip/files/7zip-24.05-respect-build-env.patch
new file mode 100644
index 000000000000..d16b22bf1d4e
--- /dev/null
+++ b/app-arch/7zip/files/7zip-24.05-respect-build-env.patch
@@ -0,0 +1,52 @@
+Respect build environment settings
+
+Bug: https://bugs.gentoo.org/913186
+Bug: https://bugs.gentoo.org/913188
+Bug: https://bugs.gentoo.org/913189
+
+
+--- a/CPP/7zip/7zip_gcc.mak
++++ b/CPP/7zip/7zip_gcc.mak
+@@ -45,7 +45,6 @@
+ else
+ CFLAGS_DEBUG = -DNDEBUG
+ ifneq ($(CC), $(CROSS_COMPILE)clang)
+-LFLAGS_STRIP = -s
+ endif
+ endif
+
+@@ -104,14 +103,14 @@
+ LDFLAGS = -shared -DEF $(DEF_FILE) $(LDFLAGS_STATIC)
+ else
+ SHARED_EXT=.so
+-LDFLAGS = -shared -fPIC $(LDFLAGS_STATIC)
++LDFLAGS = -shared -fPIC $(G_LDFLAGS) $(LDFLAGS_STATIC)
+ CC_SHARED=-fPIC
+ endif
+
+
+ else
+
+-LDFLAGS = $(LDFLAGS_STATIC)
++LDFLAGS = $(G_LDFLAGS) $(LDFLAGS_STATIC)
+ # -z force-bti
+ # -s is not required for clang, do we need it for GCC ???
+
+@@ -169,7 +168,7 @@
+
+
+
+-CFLAGS = $(MY_ARCH_2) $(LOCAL_FLAGS) $(CFLAGS_BASE2) $(CFLAGS_BASE) $(FLAGS_FLTO) $(CC_SHARED) -o $@
++CFLAGS = $(MY_ARCH_2) $(LOCAL_FLAGS) $(CFLAGS_BASE2) $(CFLAGS_BASE) $(FLAGS_FLTO) $(CC_SHARED) $(G_CFLAGS) -o $@
+
+
+ ifdef IS_MINGW
+@@ -210,7 +209,7 @@
+ #-Wno-invalid-offsetof
+ #-Wno-reorder
+
+-CXXFLAGS = $(MY_ARCH_2) $(LOCAL_FLAGS) $(CXXFLAGS_BASE2) $(CFLAGS_BASE) $(FLAGS_FLTO) $(CXXFLAGS_EXTRA) $(CC_SHARED) $(CXX_WARN_FLAGS) $(CXX_STD_FLAGS) $(CXX_INCLUDE_FLAGS) -o $@
++CXXFLAGS = $(MY_ARCH_2) $(LOCAL_FLAGS) $(CXXFLAGS_BASE2) $(CFLAGS_BASE) $(FLAGS_FLTO) $(CXXFLAGS_EXTRA) $(CC_SHARED) $(CXX_WARN_FLAGS) $(CXX_STD_FLAGS) $(CXX_INCLUDE_FLAGS) $(G_CXXFLAGS) -o $@
+
+ STATIC_TARGET=
+ ifdef COMPL_STATIC


             reply	other threads:[~2024-05-18  7:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-18  7:55 Arthur Zamarin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-04-13  6:13 [gentoo-commits] repo/gentoo:master commit in: app-arch/7zip/files/, app-arch/7zip/ Arthur Zamarin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1716018924.fb8a4dea17cbe68295417ad1f5b4cb37665d24bc.arthurzam@gentoo \
    --to=arthurzam@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox