mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2024-11-22 20:11:51 +00:00
build script: add sdl2_mixer target
This commit is contained in:
parent
24a02f447e
commit
ac993a2901
1 changed files with 30 additions and 0 deletions
30
build.py
30
build.py
|
@ -1307,6 +1307,35 @@ class Sdl2ImageTarget(ConfigureMakeStaticDependencyTarget):
|
||||||
return line + 'Requires.private: libwebp\n' if line.startswith('Requires:') else line
|
return line + 'Requires.private: libwebp\n' if line.startswith('Requires:') else line
|
||||||
|
|
||||||
|
|
||||||
|
class Sdl2MixerTarget(ConfigureMakeStaticDependencyTarget):
|
||||||
|
def __init__(self, name='sdl2_mixer'):
|
||||||
|
super().__init__(name)
|
||||||
|
|
||||||
|
def prepare_source(self, builder: 'Builder'):
|
||||||
|
builder.download_source(
|
||||||
|
'https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.4.tar.gz',
|
||||||
|
'b4cf5a382c061cd75081cf246c2aa2f9df8db04bdda8dcdc6b6cca55bede2419')
|
||||||
|
|
||||||
|
def configure(self, builder: 'Builder'):
|
||||||
|
# Set LDFLAGS explicitly to help with FluidSynth and FLAC detection
|
||||||
|
args = (builder.bin_path + 'pkg-config', '--libs', 'fluidsynth')
|
||||||
|
libs = subprocess.check_output(args, cwd=builder.build_path)
|
||||||
|
self.environment['LDFLAGS'] = libs.decode('ascii').strip('\n')
|
||||||
|
|
||||||
|
super().configure(builder)
|
||||||
|
|
||||||
|
def detect(self, builder: 'Builder') -> bool:
|
||||||
|
return os.path.exists(builder.source_path + 'SDL2_mixer.pc.in')
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def _process_pkg_config(pcfile: str, line: str) -> str:
|
||||||
|
if line.startswith('Requires:'):
|
||||||
|
# Add fluidsynth as private dependency which pulls most of necessary libraries
|
||||||
|
return line + 'Requires.private: fluidsynth mpg123' + os.linesep
|
||||||
|
|
||||||
|
return line
|
||||||
|
|
||||||
|
|
||||||
class SndFileTarget(CMakeStaticDependencyTarget):
|
class SndFileTarget(CMakeStaticDependencyTarget):
|
||||||
def __init__(self, name='sndfile'):
|
def __init__(self, name='sndfile'):
|
||||||
super().__init__(name)
|
super().__init__(name)
|
||||||
|
@ -1703,6 +1732,7 @@ class Builder(object):
|
||||||
SamplerateTarget(),
|
SamplerateTarget(),
|
||||||
Sdl2Target(),
|
Sdl2Target(),
|
||||||
Sdl2ImageTarget(),
|
Sdl2ImageTarget(),
|
||||||
|
Sdl2MixerTarget(),
|
||||||
SndFileTarget(),
|
SndFileTarget(),
|
||||||
VorbisTarget(),
|
VorbisTarget(),
|
||||||
VpxTarget(),
|
VpxTarget(),
|
||||||
|
|
Loading…
Reference in a new issue