mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2024-11-22 03:51:33 +00:00
aedi: add pbzx target
This commit is contained in:
parent
8e8ddd8435
commit
92e9a68ad9
2 changed files with 34 additions and 0 deletions
|
@ -108,6 +108,7 @@ def targets():
|
|||
NasmTarget(),
|
||||
NinjaTarget(),
|
||||
P7ZipTarget(),
|
||||
PbzxTarget(),
|
||||
PkgConfigTarget(),
|
||||
UnrarTarget(),
|
||||
YasmTarget(),
|
||||
|
|
|
@ -158,6 +158,39 @@ class P7ZipTarget(CMakeTarget):
|
|||
self.copy_to_bin(state, '7za')
|
||||
|
||||
|
||||
class PbzxTarget(MakeTarget):
|
||||
def __init__(self, name='pbzx'):
|
||||
super().__init__(name)
|
||||
|
||||
def prepare_source(self, state: BuildState):
|
||||
state.download_source(
|
||||
'https://github.com/nrosenstein-stuff/pbzx/archive/refs/tags/v1.0.2.tar.gz',
|
||||
'33db3cf9dc70ae704e1bbfba52c984f4c6dbfd0cc4449fa16408910e22b4fd90')
|
||||
|
||||
def detect(self, state: BuildState) -> bool:
|
||||
return state.has_source_file('pbzx.c')
|
||||
|
||||
def build(self, state: BuildState):
|
||||
c_compiler = state.c_compiler()
|
||||
assert c_compiler
|
||||
|
||||
args = [
|
||||
str(c_compiler),
|
||||
'-O3',
|
||||
'pbzx.c',
|
||||
'-lxar', '-llzma',
|
||||
'-o', self.name
|
||||
]
|
||||
|
||||
for var in ('CFLAGS', 'LDFLAGS'):
|
||||
args += shlex.split(state.environment[var])
|
||||
|
||||
subprocess.run(args, check=True, cwd=state.build_path)
|
||||
|
||||
def post_build(self, state: BuildState):
|
||||
self.copy_to_bin(state)
|
||||
|
||||
|
||||
class PkgConfigTarget(ConfigureMakeDependencyTarget):
|
||||
def __init__(self, name='pkg-config'):
|
||||
super().__init__(name)
|
||||
|
|
Loading…
Reference in a new issue