diff options
author | Martin Matouš <m@matous.dev> | 2023-09-03 16:52:21 +0200 |
---|---|---|
committer | Martin Matouš <m@matous.dev> | 2023-09-03 16:54:16 +0200 |
commit | 2d22b3eb5edb6b4fea5e44f940201587af1f5a06 (patch) | |
tree | b3c16900c4b62005673ac3a58a1a21859b174c35 /app-arch | |
parent | www-apps/pleroma: add 2.5.5, drop 2.5.4 (diff) | |
download | guru-2d22b3eb5edb6b4fea5e44f940201587af1f5a06.tar.gz guru-2d22b3eb5edb6b4fea5e44f940201587af1f5a06.tar.bz2 guru-2d22b3eb5edb6b4fea5e44f940201587af1f5a06.zip |
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š <m@matous.dev>
Diffstat (limited to 'app-arch')
-rw-r--r-- | app-arch/7zip/7zip-23.01.ebuild | 16 | ||||
-rw-r--r-- | app-arch/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 191ccaaee..38a77c1c4 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 000000000..2615a9e34 --- /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) |