mirror of
https://github.com/ZDoom/zdoom-macos-deps.git
synced 2025-02-20 18:42:23 +00:00
aedi: update sdl2_mixer to 2.6.0
This commit is contained in:
parent
704db1efc2
commit
770d764a99
2 changed files with 18 additions and 44 deletions
|
@ -302,33 +302,35 @@ class Sdl2ImageTarget(CMakeStaticDependencyTarget):
|
|||
shutil.move(str(bad_cmake_files_path), str(good_cmake_files_path))
|
||||
|
||||
|
||||
class Sdl2MixerTarget(ConfigureMakeStaticDependencyTarget):
|
||||
class Sdl2MixerTarget(CMakeStaticDependencyTarget):
|
||||
def __init__(self, name='sdl2_mixer'):
|
||||
super().__init__(name)
|
||||
|
||||
def prepare_source(self, state: BuildState):
|
||||
state.download_source(
|
||||
'https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.4.tar.gz',
|
||||
'b4cf5a382c061cd75081cf246c2aa2f9df8db04bdda8dcdc6b6cca55bede2419',
|
||||
patches='sdl2_mixer-fix-fluidsynth')
|
||||
'https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.6.0/SDL2_mixer-2.6.0.tar.gz',
|
||||
'f94a4d3e878cb191c386a714be561838240012250fe17d496f4ff4341d59a391')
|
||||
|
||||
def configure(self, state: BuildState):
|
||||
state.options['--enable-music-mod-mikmod'] = 'yes'
|
||||
|
||||
# Set LDFLAGS explicitly to help with FluidSynth and FLAC detection
|
||||
state.environment['LDFLAGS'] = state.run_pkg_config('--libs', 'fluidsynth')
|
||||
opts = state.options
|
||||
opts['SDL2MIXER_DEPS_SHARED'] = 'NO'
|
||||
opts['SDL2MIXER_MP3_MPG123'] = 'YES'
|
||||
opts['SDL2MIXER_OPUS_SHARED'] = 'NO'
|
||||
opts['SDL2MIXER_SAMPLES'] = 'NO'
|
||||
opts['SDL2MIXER_VORBIS'] = 'VORBISFILE'
|
||||
opts['SDL2MIXER_VORBIS_VORBISFILE_SHARED'] = 'NO'
|
||||
opts['SDL2MIXER_MOD_XMP'] = 'YES'
|
||||
|
||||
super().configure(state)
|
||||
|
||||
def detect(self, state: BuildState) -> bool:
|
||||
return state.has_source_file('SDL2_mixer.pc.in')
|
||||
def post_build(self, state: BuildState):
|
||||
super().post_build(state)
|
||||
|
||||
@staticmethod
|
||||
def _process_pkg_config(pcfile: Path, line: str) -> str:
|
||||
if line.startswith('Requires:'):
|
||||
return line + 'Requires.private: fluidsynth libmikmod libmodplug libmpg123 opusfile vorbisfile\n'
|
||||
|
||||
return line
|
||||
self.write_pc_file(state, filename='SDL2_mixer.pc', name='SDL2_mixer',
|
||||
description='mixer library for Simple DirectMedia Layer',
|
||||
version='2.6.0', requires='sdl2 >= 2.0.9',
|
||||
requires_private='flac fluidsynth libmodplug libmpg123 libxmp opusfile vorbisfile',
|
||||
libs='-lSDL2_mixer', cflags='-I${includedir}/SDL2')
|
||||
|
||||
|
||||
class Sdl2NetTarget(ConfigureMakeStaticDependencyTarget):
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
From 6160668079f91d57a5d7bf0b40ffdd843be70daf Mon Sep 17 00:00:00 2001
|
||||
From: Sam Lantinga <slouken@libsdl.org>
|
||||
Date: Wed, 20 Jan 2021 10:17:10 -0800
|
||||
Subject: [PATCH 199/199] Fixed use-after-free in music_fluidsynth.c
|
||||
|
||||
Tom M.
|
||||
|
||||
There is a dangerous use-after-free in FLUIDSYNTH_Delete(): the settings object is deleted **before** the synth. Since the settings have been created first to initialize the synth, you must first delete the synth and then delete the settings. This currently crashes all applications that use fluidsynth 2.1.6 and SDL2_mixer. Please apply the attached patch and release a bug fix release.
|
||||
|
||||
Originally reported at https://github.com/FluidSynth/fluidsynth/issues/748
|
||||
---
|
||||
src/codecs/music_fluidsynth.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/music_fluidsynth.c
|
||||
+++ b/music_fluidsynth.c
|
||||
@@ -273,9 +273,10 @@ static void FLUIDSYNTH_Stop(void *contex
|
||||
static void FLUIDSYNTH_Delete(void *context)
|
||||
{
|
||||
FLUIDSYNTH_Music *music = (FLUIDSYNTH_Music *)context;
|
||||
+ fluid_settings_t *settings = fluidsynth.fluid_synth_get_settings(music->synth);
|
||||
fluidsynth.delete_fluid_player(music->player);
|
||||
- fluidsynth.delete_fluid_settings(fluidsynth.fluid_synth_get_settings(music->synth));
|
||||
fluidsynth.delete_fluid_synth(music->synth);
|
||||
+ fluidsynth.delete_fluid_settings(settings);
|
||||
SDL_free(music);
|
||||
}
|
||||
|
Loading…
Reference in a new issue