app-arch/7zip: add 26.03

Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
This commit is contained in:
Arthur Zamarin
2026-09-04 12:33:24 +03:00
parent 92736ba35d
commit 94d3039df1
2 changed files with 121 additions and 0 deletions

View File

@@ -0,0 +1,119 @@
# Copyright 2023-2026 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://github.com/ip7z/7zip/releases/download/${PV}/7z${NO_DOT_PV}-src.tar.xz
https://github.com/ip7z/7zip/releases/download/${PV}/7z${NO_DOT_PV}-linux-x64.tar.xz
"
S=${WORKDIR}
LICENSE="LGPL-2 BSD rar? ( unRAR )"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
IUSE="uasm jwasm rar +symlink"
REQUIRED_USE="?? ( uasm jwasm )"
DOCS=( readme.txt History.txt License.txt )
HTML_DOCS=( MANUAL )
BDEPEND="
app-arch/xz-utils[extra-filters(+)]
uasm? ( dev-lang/uasm )
jwasm? ( dev-lang/jwasm )
"
RDEPEND="
symlink? ( !app-arch/p7zip )
"
PATCHES=(
"${FILESDIR}/${PN}-24.05-respect-build-env.patch"
)
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. We only
# strictly need to convert the .mk files we patch but do everything
# to allow easily patching in future + facilitate user patches.
pushd "./CPP/7zip" || die "Unable to switch directory"
edos2unix $(find . -type 'f' || die)
sed -i -e 's/-Werror //g' ./7zip_gcc.mak || die "Error removing -Werror"
popd >/dev/null || die "Unable to switch directory"
default
}
src_compile() {
# 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
# Build executable and library
for i in "./CPP/7zip/Bundles/Alone2" "./CPP/7zip/Bundles/Format7zF" ; do
pushd "${i}" || die "Unable to switch directory"
mkdir -p "${bdir}" || die # Bug: https://bugs.gentoo.org/933619
emake ${args[@]}
popd > /dev/null || die "Unable to switch directory"
done
}
src_install() {
dobin "./CPP/7zip/Bundles/Alone2/b/${bdir}/7zz"
dolib.so "./CPP/7zip/Bundles/Format7zF/b/${bdir}/7z.so"
if use symlink; then
dosym 7zz /usr/bin/7z
dosym 7zz /usr/bin/7za
dosym 7zz /usr/bin/7zr
fi
einstalldocs
}

View File

@@ -1,2 +1,4 @@
DIST 7z2602-linux-x64.tar.xz 1571416 BLAKE2B 2f83d967b3a16d4aaf3a96ba7c242ff7fe3d9628a7a556f797ec509fe12a1e08b9b453f571fa2911a941244fb6482b99b294770736debfaeaa1b966003973e57 SHA512 1f8d3c90287f006501ed06da6e22687267e95b39a92267220ed5d2f218e950e5cecbb410aefef3c92a067857943f417767f410b07d74c0caa2b86f37b05d2a1e
DIST 7z2602-src.tar.xz 1543480 BLAKE2B 26fb72ffef65c316ff97959981e4f8eb4dbbd5ac09900d3c6ab880347ff23cc781f4b4196f138e8c558afa5c1fd738feebc73299f6be70d9787dfc9ffa9afc69 SHA512 85449360904b295cb47a86597cca5e6623f4119e4e5ad3491d67bea8cd416bad68c4bfb69b9ec521ccee6e431a080d9e8aa8f5eecb69d8305c66973048e56a16
DIST 7z2603-linux-x64.tar.xz 1575072 BLAKE2B d32fb9c8ae99acad2571d5a8f7be66bdcfa6804fbc1f70ab79be5551591b3ad49f34c216d69f6f7fe046725609bbc29248b27e233dcafb57cdc2c1e93006f4a7 SHA512 d02bf68d9b458480cee9916c199a80e8d4b520ad69fe7052ecf1a16e4dd4d0e7c1bd96b15c65b1b91d31565fb26d6c20e1bf2af7765d571ace8e59834f2dd612
DIST 7z2603-src.tar.xz 1552200 BLAKE2B d50364d6a3668ee4bc1528602eb779aafd6169e9a8a7fd2daaf1ebf10a963e8a9fa2a74b36219c34287b7ecae2bdab52abcfdb8840340181791994b087f44479 SHA512 469ebb37fb1495982ffee453cc6298dabb14b449e42fbe231001d0dae51ee3bcc83fdf46fec137a7cf7d6688a696b689a90d1aff3408d716e458b2ce064458c7