From 4ea6e0a1cb6abf3b4ff5a84566dce50dc978e024 Mon Sep 17 00:00:00 2001 From: i0ntempest Date: Fri, 1 Aug 2025 21:13:14 +1000 Subject: [PATCH] 7zip: support building on i386 --- archivers/7zip/Portfile | 10 +++++++++- archivers/7zip/files/patch-i386.patch | 21 +++++++++++++++++++++ 2 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 archivers/7zip/files/patch-i386.patch diff --git a/archivers/7zip/Portfile b/archivers/7zip/Portfile index a9bf4071dde..777ce51dd6a 100644 --- a/archivers/7zip/Portfile +++ b/archivers/7zip/Portfile @@ -41,9 +41,12 @@ checksums rmd160 dcdffbdbb6fc0a624c4d2d3c601c26dc38f2007a \ extract.mkdir yes patchfiles patch-7zip_gcc_mak.diff -# https://github.com/ip7z/7zip/pull/141 +# ppc support: https://github.com/ip7z/7zip/pull/141 patchfiles-append patch-powerpc.patch +# i386 support +patchfiles-append patch-i386.patch + post-patch { reinplace "s|#include |//#include |" \ ${worksrcpath}/CPP/7zip/Common/FileStreams.cpp \ @@ -74,6 +77,9 @@ build { if {${muniversal.build_arch} eq "x86_64"} { # file name is "x64" for x86_64 set arch_filename x64 + } elseif {${muniversal.build_arch} eq "i386"} { + # file name is "x86" for i386 + set arch_filename x86 } else { # arm64, ppc, ppc64 set arch_filename ${muniversal.build_arch} @@ -89,6 +95,8 @@ build { destroot { if {${muniversal.build_arch} eq "x86_64"} { set arch_filename x64 + } elseif {${muniversal.build_arch} eq "i386"} { + set arch_filename x86 } else { set arch_filename ${muniversal.build_arch} } diff --git a/archivers/7zip/files/patch-i386.patch b/archivers/7zip/files/patch-i386.patch new file mode 100644 index 00000000000..9311c5d98b3 --- /dev/null +++ b/archivers/7zip/files/patch-i386.patch @@ -0,0 +1,21 @@ +--- /dev/null ++++ CPP/7zip/cmpl_mac_x86.mak +@@ -0,0 +1,3 @@ ++include ../../var_mac_x86.mak ++include ../../warn_clang_mac.mak ++include makefile.gcc + +--- /dev/null ++++ CPP/7zip/var_mac_x86.mak +@@ -0,0 +1,11 @@ ++PLATFORM=x86 ++O=b/m_$(PLATFORM) ++IS_X64= ++IS_X86=1 ++IS_ARM64= ++CROSS_COMPILE= ++MY_ARCH=-arch i386 ++USE_ASM= ++CC=$(CROSS_COMPILE)clang ++CXX=$(CROSS_COMPILE)clang++ ++USE_CLANG=1