diff options
author | 2024-08-13 21:31:22 +0300 | |
---|---|---|
committer | 2024-08-13 21:31:22 +0300 | |
commit | 4563695e65202c361e2923022a87bda73fdbd304 (patch) | |
tree | 45050fc9921e2d8654160dc2f98b32e3cd4c5f56 /app-arch | |
parent | dev-ruby/rspectacular: treeclean (diff) | |
download | gentoo-4563695e65202c361e2923022a87bda73fdbd304.tar.gz gentoo-4563695e65202c361e2923022a87bda73fdbd304.tar.bz2 gentoo-4563695e65202c361e2923022a87bda73fdbd304.zip |
app-arch/7zip: add 24.08
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
Diffstat (limited to 'app-arch')
-rw-r--r-- | app-arch/7zip/7zip-24.08.ebuild | 110 | ||||
-rw-r--r-- | app-arch/7zip/Manifest | 2 |
2 files changed, 112 insertions, 0 deletions
diff --git a/app-arch/7zip/7zip-24.08.ebuild b/app-arch/7zip/7zip-24.08.ebuild new file mode 100644 index 000000000000..59e13dc0c5e5 --- /dev/null +++ b/app-arch/7zip/7zip-24.08.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 b9f9fdee7c9d..a3172bd3e9b9 100644 --- a/app-arch/7zip/Manifest +++ b/app-arch/7zip/Manifest @@ -1,2 +1,4 @@ DIST 7z2407-linux-x64.tar.xz 1554932 BLAKE2B 9229fdac09148c50032656743aba0f8ce1ec06b7fd2dad2c693dc299c5f83fc093ba047e9c3c3971bf4cc9387b0db52c84167202ed7fcecfcc6f5bc508d04ada SHA512 31b5bb832e73f3c2fd0437873fe6130b8d1bd1bea8320d1b27d06bf40dd737758732eb3664fab2c36417b96ffc5daca6607b6f1aefdaa9e697122da60e37a728 DIST 7z2407-src.tar.xz 1488556 BLAKE2B 42b4f9553aaa4797e80a2d50073ff0e77b5261e50766f8c596a632fb013ac1514a2963f27b924485f07728d13a4536c69911867e3728e8f8604ec25fc4c6824e SHA512 0299e5c1e1dfd33ecf22077f812da1f25bf2146a713c7a7e2498d639520f21f029e853914e66a84d1edfc5d721e1f3d914a3171ab336a406a94bc82d5b2d8e5d +DIST 7z2408-linux-x64.tar.xz 1556956 BLAKE2B 177b355830201e48d314667c1936e3ca0b624b3fd47b8696df78cc27bb559fd239c1ab2146a88111c3bd1ef1396e694d235babb9b8391fc55cac89c97d7990bd SHA512 00b8d2b89e1410e360cf034c44a43cb88927d76317ee291519ef1f39e3cab68b5549de66f0f6b867f0367d50e7661f484e0a0f7afdd2ecb963804e44c789d7ce +DIST 7z2408-src.tar.xz 1493700 BLAKE2B fd22a302044ca8655187573173fdc13ae93efaf907cb60076600013e3f463912b876cc3764853ce9d1850fc10dc264cd96917ef6dca9332541db292aee3f1ab4 SHA512 889e9aeaa629d6474a609a15066b2fa7b1353fa5e7255e044297591f565b08b16b885d44f4c4a046f2f9da189599ace300cf61fd9ac0e7bc316fb9d96a18a039 |