[gentoo-commits] repo/proj/guru:dev commit in: app-arch/7zip/files/, app-arch/7zip/

2024-04-05 Thread Arthur Zamarin
commit: 7eea88b8d9612ad0d838e69b7262773d6f2792a5
Author: Arthur Zamarin  gentoo  org>
AuthorDate: Fri Apr  5 15:21:26 2024 +
Commit: Arthur Zamarin  gentoo  org>
CommitDate: Fri Apr  5 15:21:26 2024 +
URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=7eea88b8

app-arch/7zip: treeclean (moved to ::gentoo)

Signed-off-by: Arthur Zamarin  gentoo.org>

 app-arch/7zip/7zip-23.01.ebuild| 102 -
 app-arch/7zip/Manifest |   2 -
 .../7zip/files/7zip-23.01-respect-build-env.patch  |  53 ---
 app-arch/7zip/metadata.xml |  24 -
 4 files changed, 181 deletions(-)

diff --git a/app-arch/7zip/7zip-23.01.ebuild b/app-arch/7zip/7zip-23.01.ebuild
deleted file mode 100644
index e06bd67cdb..00
--- a/app-arch/7zip/7zip-23.01.ebuild
+++ /dev/null
@@ -1,102 +0,0 @@
-# Copyright 2023-2024 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-inherit edos2unix toolchain-funcs flag-o-matic
-
-NO_DOT_PV=$(ver_rs 1- '')
-DESCRIPTION="A free file archiver for extremely high compression"
-HOMEPAGE="https://www.7-zip.org/ https://sourceforge.net/projects/sevenzip/;
-SRC_URI="
-   
https://sourceforge.net/projects/sevenzip/files/7-Zip/${PV}/7z${NO_DOT_PV}-src.tar.xz/download
 -> ${PN}-${PV}.tar.xz
-   
https://sourceforge.net/projects/sevenzip/files/7-Zip/${PV}/7z${NO_DOT_PV}-linux-x64.tar.xz/download
 -> ${PN}-${PV}-linux.tar.xz
-"
-LICENSE="LGPL-2 BSD rar? ( unRAR )"
-
-IUSE="uasm jwasm rar"
-REQUIRED_USE="?? ( uasm jwasm )"
-SLOT="0"
-KEYWORDS="~amd64"
-
-S="${WORKDIR}/CPP/7zip/"
-DOCS=( readme.txt History.txt License.txt )
-HTML_DOCS=( MANUAL )
-RESTRICT="mirror"
-
-DEPEND="${RDEPEND}"
-BDEPEND="
-   uasm? ( dev-lang/uasm )
-   jwasm? ( dev-lang/jwasm )
-"
-
-# 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
-   PATCHES+=( "${FILESDIR}/${P}-respect-build-env.patch" )
-
-   sed -i -e 's/-Werror //g' ./7zip_gcc.mak || die "Error removing -Werror"
-   default
-}
-
-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
deleted file mode 100644
index 39335efa32..00
--- a/app-arch/7zip/Manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-DIST 7zip-23.01-linux.tar.xz 1527700 BLAKE2B 
35dc74f0a7a4e586ea5ae969dce72c14e0231822630d2d70f24e1c911cea0492354a258ef65096a6ce0da1510117c12466bc6cda577cdf9e8e74ede17e47f23e
 SHA512 
d3549468de8fd161e4c9233fa0b170af1f28c74749d20f3d0eeb3873857f6c6d2cc0777d564e6a79be7cc21c9e982e10710a795320428dc51db809a8d0f9454e
-DIST 7zip-23.01.tar.xz 1378588 BLAKE2B 
348484b24b39db70e513fe50d79954ea0e2dd669f83e3601fa796c8f0ca4734132ca20fac8cda9b8ba550bad9146627fc0ae07056abb99028ef6d825b6a533bd
 SHA512 

[gentoo-commits] repo/proj/guru:dev commit in: app-arch/7zip/files/, app-arch/7zip/

2023-09-03 Thread Martin Matouš
commit: 2d22b3eb5edb6b4fea5e44f940201587af1f5a06
Author: Martin Matouš  matous  dev>
AuthorDate: Sun Sep  3 14:52:21 2023 +
Commit: Martin Matouš  matous  dev>
CommitDate: Sun Sep  3 14:54:16 2023 +
URL:https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=2d22b3eb

app-arch/7zip: respect build environment

Closes: https://bugs.gentoo.org/913186
Closes: https://bugs.gentoo.org/913188
Closes: https://bugs.gentoo.org/913189
Signed-off-by: Martin Matouš  matous.dev>

 app-arch/7zip/7zip-23.01.ebuild| 16 +++-
 .../7zip/files/7zip-23.01-respect-build-env.patch  | 98 ++
 2 files changed, 110 insertions(+), 4 deletions(-)

diff --git a/app-arch/7zip/7zip-23.01.ebuild b/app-arch/7zip/7zip-23.01.ebuild
index 191ccaaeee..38a77c1c4c 100644
--- a/app-arch/7zip/7zip-23.01.ebuild
+++ b/app-arch/7zip/7zip-23.01.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=8
 
-inherit toolchain-funcs
+inherit edos2unix toolchain-funcs
 
 NO_DOT_PV=$(ver_rs 1- '')
 DESCRIPTION="A free file archiver for extremely high compression"
@@ -45,14 +45,22 @@ pkg_setup() {
 }
 
 src_prepare() {
-   default
+   # 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
+   PATCHES+=( "${FILESDIR}/${P}-respect-build-env.patch" )
+
sed -i -e 's/-Werror //g' ./7zip_gcc.mak || die "Error removing -Werror"
-   sed -i -e 's/$(LFLAGS_STRIP)//g' ./7zip_gcc.mak \
-   || die "Error removing hardcoded strip"
+   default
 }
 
 src_compile() {
pushd "./Bundles/Alone2" || die "Unable to switch directory"
+   export G_CC=$(tc-getCC)
+   export G_CXX=$(tc-getCXX)
+   export G_CFLAGS=${CFLAGS}
+   export G_CXXFLAGS=${CXXFLAGS}
+   export G_LDFLAGS=${LDFLAGS}
# USE_JWASM=1 - if asm: use JWasm assembler instead of Asmc (not a 
gentoo package)
emake DISABLE_RAR=1 USE_JWASM=1 --file "../../${mfile}"
popd > /dev/null || die "Unable to switch directory"

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 00..2615a9e34a
--- /dev/null
+++ b/app-arch/7zip/files/7zip-23.01-respect-build-env.patch
@@ -0,0 +1,98 @@
+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)
+--- a/var_clang.mak
 b/var_clang.mak
+@@ -6,6 +6,6 @@ IS_ARM64=
+ CROSS_COMPILE=
+ MY_ARCH=
+ USE_ASM=
+-CC=$(CROSS_COMPILE)clang
+-CXX=$(CROSS_COMPILE)clang++
++CC=$(G_CC)
++CXX=$(G_CXX)
+ USE_CLANG=1
+--- a/var_clang_x64.mak
 b/var_clang_x64.mak
+@@ -6,7 +6,7 @@ IS_ARM64=
+ CROSS_COMPILE=
+ MY_ARCH=
+ USE_ASM=1
+-CC=$(CROSS_COMPILE)clang
+-CXX=$(CROSS_COMPILE)clang++
++CC=$(G_CC)
++CXX=$(G_CXX)
+ USE_CLANG=1
+
+--- a/var_gcc.mak
 b/var_gcc.mak
+@@ -6,7 +6,7 @@ IS_ARM64=
+ CROSS_COMPILE=
+ MY_ARCH=
+ USE_ASM=
+-CC=$(CROSS_COMPILE)gcc
+-CXX=$(CROSS_COMPILE)g++
++CC=$(G_CC)
++CXX=$(G_CXX)
+
+ # -march=armv8-a+crc+crypto
+--- a/var_gcc_x64.mak
 b/var_gcc_x64.mak
+@@ -6,5 +6,5 @@ IS_ARM64=
+ CROSS_COMPILE=
+ MY_ARCH=
+ USE_ASM=1
+-CC=$(CROSS_COMPILE)gcc
+-CXX=$(CROSS_COMPILE)g++
++CC=$(G_CC)
++CXX=$(G_CXX)