summaryrefslogtreecommitdiff
path: root/app-arch/7zip
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2024-04-06 00:30:33 +0100
committerV3n3RiX <venerix@koprulu.sector>2024-04-06 00:30:33 +0100
commit9323524b4d44f4ec3dc923bd8e9ea04bdde8a067 (patch)
tree8ca7b8c58d4e70389d5d4672ebd86cb475cf9f80 /app-arch/7zip
parent8c11cf748cc296d6338a189106a8cc9e3a1e0948 (diff)
gentoo auto-resync : 06:04:2024 - 00:30:33
Diffstat (limited to 'app-arch/7zip')
-rw-r--r--app-arch/7zip/7zip-23.01.ebuild109
-rw-r--r--app-arch/7zip/Manifest5
-rw-r--r--app-arch/7zip/files/7zip-23.01-respect-build-env.patch53
-rw-r--r--app-arch/7zip/metadata.xml28
4 files changed, 195 insertions, 0 deletions
diff --git a/app-arch/7zip/7zip-23.01.ebuild b/app-arch/7zip/7zip-23.01.ebuild
new file mode 100644
index 000000000000..631aad045b4c
--- /dev/null
+++ b/app-arch/7zip/7zip-23.01.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 used for docs
+SRC_URI="
+ mirror://sourceforge/sevenzip/7-Zip/${PV}/7z${NO_DOT_PV}-src.tar.xz
+ mirror://sourceforge/sevenzip/7-Zip/${PV}/7z${NO_DOT_PV}-linux-x64.tar.xz
+"
+S="${WORKDIR}/CPP/7zip"
+
+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
+ edos2unix ./7zip_gcc.mak ./var_gcc{,_x64}.mak ./var_clang{,_x64}.mak
+
+ default
+
+ sed -i -e 's/-Werror //g' ./7zip_gcc.mak || die "Error removing -Werror"
+}
+
+src_compile() {
+ pushd "./Bundles/Alone2" || die "Unable to switch directory"
+
+ 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 "./Bundles/Alone2/b/${bdir}/7zz"
+
+ pushd "${WORKDIR}" || die "Unable to switch directory"
+ einstalldocs
+}
diff --git a/app-arch/7zip/Manifest b/app-arch/7zip/Manifest
new file mode 100644
index 000000000000..fc601182eb0d
--- /dev/null
+++ b/app-arch/7zip/Manifest
@@ -0,0 +1,5 @@
+AUX 7zip-23.01-respect-build-env.patch 1538 BLAKE2B 59d6b0629943ad97df334b377f0df00ce746a43a3263f971b21c8ffa7813dc3dd3ae3adbada8e3459f1ae1bad24fafbdace7bbb1a123e5851e32876143b0e035 SHA512 1f83812d0c86cb586a6fdb4738e117a4fd6d6ba9a8e3ffdaa83620a8b81fa186216478ab7e4c119e5d3f43faa940acde8e4f9d29ae13dc7a7c326801b8cce923
+DIST 7z2301-linux-x64.tar.xz 1527700 BLAKE2B 35dc74f0a7a4e586ea5ae969dce72c14e0231822630d2d70f24e1c911cea0492354a258ef65096a6ce0da1510117c12466bc6cda577cdf9e8e74ede17e47f23e SHA512 d3549468de8fd161e4c9233fa0b170af1f28c74749d20f3d0eeb3873857f6c6d2cc0777d564e6a79be7cc21c9e982e10710a795320428dc51db809a8d0f9454e
+DIST 7z2301-src.tar.xz 1378588 BLAKE2B 348484b24b39db70e513fe50d79954ea0e2dd669f83e3601fa796c8f0ca4734132ca20fac8cda9b8ba550bad9146627fc0ae07056abb99028ef6d825b6a533bd SHA512 e39f660c023aa65e55388be225b5591fe2a5c9138693f3c9107e2eb4ce97fafde118d3375e01ada99d29de9633f56221b5b3d640c982178884670cd84c8aa986
+EBUILD 7zip-23.01.ebuild 2728 BLAKE2B c98a594833bb404c7858bc4802a385c0aa6959968293711b743490ade7266b386a4b9ceb840d5a45a38c17683de3448341586d12fb84e86a6ec8cb9f92b96d1a SHA512 db85a2833ed052708472cd062335608368f8f6691c7287474d20d4d8e8d6ec7062055494368a558fdd35b8b76566ee85a0ada62b0827757a1b7317fc5e07eb30
+MISC metadata.xml 967 BLAKE2B 5b54d1cc757cdc63407a51587389f9db032ae141fd9e19423185fd457f50c469ceb53095b128d8c6cd751cf3f0a87703dd36ba5d048dbfe9bea0ccd2354168b2 SHA512 c8c53c995f4bb5982461fa16dd50193f48c59aa15076bd78e38ccc4f0abf2190bf2b143df50e1c7911bd7814bd2ecb34892ee818b328764a9ff4ab2429718d37
diff --git a/app-arch/7zip/files/7zip-23.01-respect-build-env.patch b/app-arch/7zip/files/7zip-23.01-respect-build-env.patch
new file mode 100644
index 000000000000..c897cf625931
--- /dev/null
+++ b/app-arch/7zip/files/7zip-23.01-respect-build-env.patch
@@ -0,0 +1,53 @@
+Respect build environment settings
+
+Bug: https://bugs.gentoo.org/913186
+Bug: https://bugs.gentoo.org/913188
+Bug: https://bugs.gentoo.org/913189
+
+
+--- a/7zip_gcc.mak
++++ b/7zip_gcc.mak
+@@ -87,14 +87,14 @@ SHARED_EXT=.dll
+ 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 = $(LDFLAGS_STATIC) $(G_LDFLAGS)
+ # -s is not required for clang, do we need it for GCC ???
+
+ #-static -static-libgcc -static-libstdc++
+@@ -149,7 +149,7 @@ endif
+
+
+
+-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
+@@ -190,7 +190,7 @@ CXX_WARN_FLAGS =
+ #-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) -o $@
++CXXFLAGS = $(MY_ARCH_2) $(LOCAL_FLAGS) $(CXXFLAGS_BASE2) $(CFLAGS_BASE) $(FLAGS_FLTO) $(CXXFLAGS_EXTRA) $(CC_SHARED) $(CXX_WARN_FLAGS) $(CXX_STD_FLAGS) $(G_CXXFLAGS) -o $@
+
+ STATIC_TARGET=
+ ifdef COMPL_STATIC
+@@ -208,7 +208,7 @@ $(O):
+ # -Wl,--print-gc-sections
+
+ ifneq ($(CC), $(CROSS_COMPILE)clang)
+-LFLAGS_STRIP = -s
++
+ endif
+
+ LFLAGS_ALL = $(LFLAGS_STRIP) $(MY_ARCH_2) $(LDFLAGS) $(FLAGS_FLTO) $(LD_arch) $(OBJS) $(MY_LIBS) $(LIB2)
diff --git a/app-arch/7zip/metadata.xml b/app-arch/7zip/metadata.xml
new file mode 100644
index 000000000000..a4f1984333a5
--- /dev/null
+++ b/app-arch/7zip/metadata.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person" proxied="yes">
+ <email>nrk@disroot.org</email>
+ </maintainer>
+ <maintainer type="person">
+ <email>arthurzam@gentoo.org</email>
+ <name>Arthur Zamarin</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>sam@gentoo.org</email>
+ <name>Sam James</name>
+ </maintainer>
+ <use>
+ <flag name="rar">Enable support for non-free rar decoder</flag>
+ <flag name="uasm">Use <pkg>dev-lang/uasm</pkg> to include optimized code</flag>
+ <flag name="jwasm">Use <pkg>dev-lang/jwasm</pkg> to include optimized code (doesn't support AES)</flag>
+ </use>
+ <upstream>
+ <maintainer>
+ <name>Igor Pavlov</name>
+ </maintainer>
+ <remote-id type="sourceforge">sevenzip</remote-id>
+ <changelog>https://www.7-zip.org/history.txt</changelog>
+ <bugs-to>https://sourceforge.net/p/sevenzip/bugs/</bugs-to>
+ </upstream>
+</pkgmetadata>