build script: update sdl2_mixer target

* enable mikmod dependency
* add missing dependencies to .pc file
This commit is contained in:
alexey.lysiuk 2020-12-19 11:57:18 +02:00
parent d81e9f10df
commit fa7655209d
1 changed files with 3 additions and 5 deletions

View File

@ -1310,6 +1310,7 @@ class Sdl2ImageTarget(ConfigureMakeStaticDependencyTarget):
class Sdl2MixerTarget(ConfigureMakeStaticDependencyTarget):
def __init__(self, name='sdl2_mixer'):
super().__init__(name)
self.options['--enable-music-mod-mikmod'] = 'yes'
def prepare_source(self, builder: 'Builder'):
builder.download_source(
@ -1318,9 +1319,7 @@ class Sdl2MixerTarget(ConfigureMakeStaticDependencyTarget):
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')
self.environment['LDFLAGS'] = builder.run_pkg_config('--libs', 'fluidsynth')
super().configure(builder)
@ -1330,8 +1329,7 @@ class Sdl2MixerTarget(ConfigureMakeStaticDependencyTarget):
@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 + 'Requires.private: fluidsynth libmikmod libmodplug libmpg123 opusfile vorbisfile\n'
return line