summaryrefslogtreecommitdiff
path: root/media-libs/sdl2-mixer
diff options
context:
space:
mode:
Diffstat (limited to 'media-libs/sdl2-mixer')
-rw-r--r--media-libs/sdl2-mixer/Manifest2
-rw-r--r--media-libs/sdl2-mixer/files/sdl2-mixer-2.0.4-fluidsynth.patch30
-rw-r--r--media-libs/sdl2-mixer/sdl2-mixer-2.0.4-r1.ebuild125
3 files changed, 157 insertions, 0 deletions
diff --git a/media-libs/sdl2-mixer/Manifest b/media-libs/sdl2-mixer/Manifest
index dc2d2f1391bd..c32921d3b17b 100644
--- a/media-libs/sdl2-mixer/Manifest
+++ b/media-libs/sdl2-mixer/Manifest
@@ -1,4 +1,6 @@
+AUX sdl2-mixer-2.0.4-fluidsynth.patch 1457 BLAKE2B 9b8914065ade05bcf70c3783ae22f732e5a401f74cdc39272865d5c6f0fa31c0ee89b16f642a5b5f69b77ecd9dc96cb7313d4dd6c55303efd5d128679f1cb6f3 SHA512 e268a5bf327f2203a7f48ed0cdc05f89fea778eac706555f21ee2b3cab761600988f385195c3078917c422bc70c7b96fff650a1a213370469fe07340dc7d7852
AUX sdl2-mixer-2.0.4-slibtool.patch 3794 BLAKE2B 5e6f316a32a7c58abdbf764ada81c85e9db6509f99b3a7054de08ea90f1bf54d12bad6f177e7d76181d76f6b0d218acd1f44e8d50e91f7b3ef74056ddf3acd0b SHA512 da520853a59036ea413cc24964798fe40414c072612e2fa0bf79373be669b76d6b07a3853123317f25eb82db1a4dbd105b23469e6da14bb0596242fc1a9060d7
DIST SDL2_mixer-2.0.4.tar.gz 11125077 BLAKE2B ccb55020e360fa000e82807b8c4e2371228291943d2dc7371606834ca0f781d4e82581b5427e9902156bf3072208db4ec07e95a06f206e40ff530f432dd9e491 SHA512 98c56069640668aaececa63748de21fc8f243c7d06386c45c43d0ee472bbb2595ccda644d9886ce5b95c3a3dee3c0a96903cf9a89ddc18d38f041133470699a3
+EBUILD sdl2-mixer-2.0.4-r1.ebuild 3541 BLAKE2B 96a385c6e4d3c45d0b884663d6178bec5363a082f488fb6613b335d72395ab9062f1d11878adfc48618a76361801d6e572b2126b469948895223c7df8ae450a5 SHA512 b51e3fded97aacd3907b96e0362252d53481907d92c2173ba0ebf92d7c5dfd0e42d40291c37c61a88e13c89c9cc4b69e213426d1b869dff15bf5e6a6f643c4ba
EBUILD sdl2-mixer-2.0.4.ebuild 3491 BLAKE2B 2f4d9ae4b9a0911f7721e355c48d8a60d4477f3f320b32fdeb9e7eb5e6ac147b5c57dcc03d115c20fe5df21f5812d3ff6b09acb9e4293edb199be5eff2f3419d SHA512 1b076b2813c946e514f13a950809ca5e3fedd67899c0110a99d88a6d7f6594be73a6d44f2bf41650bd7275123fff82f5dd5d6772e04f1717009a552a3a25ac55
MISC metadata.xml 672 BLAKE2B deb686ba387b3a1be2b2584f95c1058f5b94fc31f323b03c9e42868c4b06ebb13d40b94195e4791c7ca6ca5a36d757135cee3aeba422d24ed48d04269919010c SHA512 33a98a133bd53201fceba43b54dc44eb5ed83a3015f8d9729ffbd2a9fa400e75510a0e7b31ccd8bf21e430b7b843a6634637beba179ff724cd6b50536ecfe4ab
diff --git a/media-libs/sdl2-mixer/files/sdl2-mixer-2.0.4-fluidsynth.patch b/media-libs/sdl2-mixer/files/sdl2-mixer-2.0.4-fluidsynth.patch
new file mode 100644
index 000000000000..cd740ac85c11
--- /dev/null
+++ b/media-libs/sdl2-mixer/files/sdl2-mixer-2.0.4-fluidsynth.patch
@@ -0,0 +1,30 @@
+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] 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(-)
+
+diff --git a/src/codecs/music_fluidsynth.c b/src/codecs/music_fluidsynth.c
+index 8667f0d9..a47247f4 100644
+--- a/music_fluidsynth.c
++++ b/music_fluidsynth.c
+@@ -285,9 +285,10 @@ static void FLUIDSYNTH_Stop(void *context)
+ 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);
+ }
+
diff --git a/media-libs/sdl2-mixer/sdl2-mixer-2.0.4-r1.ebuild b/media-libs/sdl2-mixer/sdl2-mixer-2.0.4-r1.ebuild
new file mode 100644
index 000000000000..dcbbcee2dae0
--- /dev/null
+++ b/media-libs/sdl2-mixer/sdl2-mixer-2.0.4-r1.ebuild
@@ -0,0 +1,125 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+MY_P="SDL2_mixer-${PV}"
+inherit autotools multilib-minimal
+
+DESCRIPTION="Simple Direct Media Layer Mixer Library"
+HOMEPAGE="https://www.libsdl.org/projects/SDL_mixer/"
+SRC_URI="https://www.libsdl.org/projects/SDL_mixer/release/${MY_P}.tar.gz"
+
+LICENSE="ZLIB"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE="flac fluidsynth mad midi mikmod mod modplug mp3 opus playtools static-libs timidity tremor vorbis +wav"
+REQUIRED_USE="
+ midi? ( || ( timidity fluidsynth ) )
+ timidity? ( midi )
+ fluidsynth? ( midi )
+ mad? ( mp3 )
+ mod? ( || ( mikmod modplug ) )
+ mikmod? ( mod )
+ modplug? ( mod )
+ tremor? ( vorbis )
+"
+
+RDEPEND="
+ >=media-libs/libsdl2-2.0.7[${MULTILIB_USEDEP}]
+ flac? ( >=media-libs/flac-1.2.1-r5[${MULTILIB_USEDEP}] )
+ midi? (
+ fluidsynth? ( >=media-sound/fluidsynth-1.1.6-r1:=[${MULTILIB_USEDEP}] )
+ timidity? ( media-sound/timidity++ )
+ )
+ mod? (
+ mikmod? ( >=media-libs/libmikmod-3.3.6-r1[${MULTILIB_USEDEP}] )
+ modplug? ( >=media-libs/libmodplug-0.8.8.4-r1[${MULTILIB_USEDEP}] )
+ )
+ mp3? (
+ mad? ( >=media-libs/libmad-0.15.1b-r8[${MULTILIB_USEDEP}] )
+ !mad? ( media-sound/mpg123[${MULTILIB_USEDEP}] )
+ )
+ opus? ( >=media-libs/opusfile-0.2 )
+ vorbis? (
+ tremor? ( >=media-libs/tremor-0_pre20130223[${MULTILIB_USEDEP}] )
+ !tremor? (
+ >=media-libs/libvorbis-1.3.3-r1[${MULTILIB_USEDEP}]
+ >=media-libs/libogg-1.3.0[${MULTILIB_USEDEP}] )
+ )
+"
+DEPEND="${RDEPEND}"
+
+S="${WORKDIR}/${MY_P}"
+
+PATCHES=(
+ "${FILESDIR}/${PN}-2.0.4-slibtool.patch"
+ "${FILESDIR}/${PN}-2.0.4-fluidsynth.patch"
+)
+
+src_prepare() {
+ default
+
+ # for slibtool patch in 2.0.4, can drop in future with eautoreconf
+ rm aclocal.m4 || die
+ eautoreconf
+ multilib_copy_sources
+}
+
+multilib_src_configure() {
+ local myeconfargs=(
+ $(use_enable static-libs static)
+ --disable-sdltest
+ --enable-music-cmd
+ $(use_enable wav music-wave)
+ $(use_enable mod music-mod)
+ $(use_enable modplug music-mod-modplug)
+ --disable-music-mod-modplug-shared
+ $(use_enable mikmod music-mod-mikmod)
+ --disable-music-mod-mikmod-shared
+ $(use_enable midi music-midi)
+ $(use_enable timidity music-midi-timidity)
+ $(use_enable fluidsynth music-midi-fluidsynth)
+ --disable-music-midi-fluidsynth-shared
+ $(use_enable vorbis music-ogg)
+ $(use_enable tremor music-ogg-tremor)
+ --disable-music-ogg-shared
+ $(use_enable flac music-flac)
+ --disable-music-flac-shared
+ $(use_enable mp3 music-mp3)
+ $(use_enable !mad music-mp3-mpg123)
+ --disable-music-mp3-mpg123-shared
+ $(use_enable mad music-mp3-mad-gpl)
+ $(use_enable opus music-opus)
+ --disable-music-opus-shared
+ LIBMIKMOD_CONFIG=${EPREFIX}/usr/bin/${CHOST}-libmikmod-config
+ )
+ ECONF_SOURCE=${S} econf "${myeconfargs[@]}"
+}
+
+multilib_src_install() {
+ emake DESTDIR="${D}" install
+ if multilib_is_native_abi && use playtools ; then
+ emake DESTDIR="${D}" install-bin
+ fi
+}
+
+multilib_src_install_all() {
+ dodoc {CHANGES,README}.txt
+ find "${D}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ # bug 412035
+ # https://bugs.gentoo.org/show_bug.cgi?id=412035
+ if use midi && use fluidsynth; then
+ ewarn "FluidSynth support requires you to set the SDL_SOUNDFONTS"
+ ewarn "environment variable to the location of a SoundFont file"
+ ewarn "unless the game or application happens to do this for you."
+ if use timidity; then
+ ewarn "Failing to do so will result in Timidity being used instead."
+ else
+ ewarn "Failing to do so will result in silence."
+ fi
+ fi
+}