mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2025-01-19 06:30:53 +00:00
aedi: add 7zip target, 7zz executable only
This commit is contained in:
parent
9003287503
commit
3a1768e681
3 changed files with 90 additions and 1 deletions
|
@ -125,6 +125,7 @@ def targets():
|
|||
GlslangTarget(),
|
||||
P7ZipTarget(),
|
||||
PbzxTarget(),
|
||||
SeverZipTarget(),
|
||||
UnrarTarget(),
|
||||
ZipTarget(),
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ class P7ZipTarget(CMakeTarget):
|
|||
|
||||
def prepare_source(self, state: BuildState):
|
||||
state.download_source(
|
||||
'https://github.com/jinfeihan57/p7zip/archive/refs/tags/v17.04.tar.gz',
|
||||
'https://github.com/p7zip-project/p7zip/archive/refs/tags/v17.04.tar.gz',
|
||||
'ea029a2e21d2d6ad0a156f6679bd66836204aa78148a4c5e498fe682e77127ef')
|
||||
|
||||
def detect(self, state: BuildState) -> bool:
|
||||
|
@ -70,6 +70,48 @@ class PbzxTarget(SingleExeCTarget):
|
|||
return state.has_source_file('pbzx.c')
|
||||
|
||||
|
||||
class SeverZipTarget(MakeTarget):
|
||||
# Build with --os-version-x64=10.13 command line option
|
||||
|
||||
def __init__(self, name='7zip'):
|
||||
super().__init__(name)
|
||||
self.src_root = 'CPP/7zip/Bundles/Alone2'
|
||||
|
||||
def prepare_source(self, state: BuildState):
|
||||
state.download_source(
|
||||
'https://www.7-zip.org/a/7z2201-src.tar.xz',
|
||||
'393098730c70042392af808917e765945dc2437dee7aae3cfcc4966eb920fbc5',
|
||||
patches='7zip-fix-errors')
|
||||
|
||||
def detect(self, state: BuildState) -> bool:
|
||||
return state.has_source_file('CPP/7zip/cmpl_mac_arm64.mak')
|
||||
|
||||
def configure(self, state: BuildState):
|
||||
state.validate_minimum_version('10.13')
|
||||
super().configure(state)
|
||||
|
||||
def build(self, state: BuildState):
|
||||
environment = state.environment
|
||||
mak_suffix = self._arch_suffix(state)
|
||||
|
||||
opts = state.options
|
||||
opts['-f'] = None
|
||||
opts[f'../../cmpl_mac_{mak_suffix}.mak'] = None
|
||||
opts['CFLAGS_BASE_LIST'] = environment['CFLAGS'] + ' -c'
|
||||
opts['LDFLAGS_STATIC_2'] = environment['LDFLAGS']
|
||||
|
||||
super().build(state)
|
||||
|
||||
def post_build(self, state: BuildState):
|
||||
build_suffix = self._arch_suffix(state)
|
||||
self.copy_to_bin(state, f'{self.src_root}/b/m_{build_suffix}/7zz', '7zz')
|
||||
|
||||
@staticmethod
|
||||
def _arch_suffix(state: BuildState):
|
||||
arch = state.architecture()
|
||||
return 'x64' if arch == 'x86_64' else arch
|
||||
|
||||
|
||||
class UnrarTarget(MakeTarget):
|
||||
def __init__(self, name='unrar'):
|
||||
super().__init__(name)
|
||||
|
|
46
patch/7zip-fix-errors.diff
Normal file
46
patch/7zip-fix-errors.diff
Normal file
|
@ -0,0 +1,46 @@
|
|||
--- a/CPP/7zip/7zip_gcc.mak
|
||||
+++ b/CPP/7zip/7zip_gcc.mak
|
||||
@@ -17,10 +17,6 @@
|
||||
PROGPATH_STATIC = $(O)/$(PROG)s
|
||||
|
||||
|
||||
-ifneq ($(CC), xlc)
|
||||
-CFLAGS_WARN_WALL = -Wall -Werror -Wextra
|
||||
-endif
|
||||
-
|
||||
# for object file
|
||||
CFLAGS_BASE_LIST = -c
|
||||
# CFLAGS_BASE_LIST = -S
|
||||
--- a/CPP/7zip/Archive/ApfsHandler.cpp
|
||||
+++ b/CPP/7zip/Archive/ApfsHandler.cpp
|
||||
@@ -983,7 +983,7 @@
|
||||
INODE_ALLOCATION_SPILLEDOVER = 0x00010000,
|
||||
INODE_FAST_PROMOTE = 0x00020000,
|
||||
*/
|
||||
-INODE_HAS_UNCOMPRESSED_SIZE = 0x00040000,
|
||||
+INODE_HAS_UNCOMPRESSED_SIZE = 0x00040000
|
||||
/*
|
||||
INODE_IS_PURGEABLE = 0x00080000,
|
||||
INODE_WANTS_TO_BE_PURGEABLE = 0x00100000,
|
||||
--- a/CPP/7zip/Common/FileStreams.cpp
|
||||
+++ b/CPP/7zip/Common/FileStreams.cpp
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <pwd.h>
|
||||
|
||||
// for major()/minor():
|
||||
-#if defined(__FreeBSD__) || defined(BSD)
|
||||
+#if 1
|
||||
#include <sys/types.h>
|
||||
#else
|
||||
#include <sys/sysmacros.h>
|
||||
--- a/CPP/7zip/UI/Common/UpdateCallback.cpp
|
||||
+++ b/CPP/7zip/UI/Common/UpdateCallback.cpp
|
||||
@@ -9,7 +9,7 @@
|
||||
// #include <pwd.h>
|
||||
|
||||
// for major()/minor():
|
||||
-#if defined(__FreeBSD__) || defined(BSD)
|
||||
+#if 1
|
||||
#include <sys/types.h>
|
||||
#else
|
||||
#include <sys/sysmacros.h>
|
Loading…
Reference in a new issue