diff --git a/pkgdef/SDL2_mixer.sh b/pkgdef/SDL2_mixer.sh index e7d1b5f..5a6eba0 100644 --- a/pkgdef/SDL2_mixer.sh +++ b/pkgdef/SDL2_mixer.sh @@ -9,8 +9,8 @@ variant latest fetch_hg https://hg.libsdl.org/SDL_mixer # Disable dependencies on external libraries for sound file formats: config_options=" - --disable-music-mod --disable-music-mp3 - --disable-music-flac-shared --disable-music-ogg-shared + --disable-music-mod --disable-music-flac-shared + --disable-music-ogg-shared " # ...except ones we have installed: @@ -28,4 +28,10 @@ else config_options+=" --disable-music-midi-fluidsynth" fi +if chocpkg installed ${PACKAGE_TYPE}:libmad; then + config_options+=" --enable-music-mp3 --enable-music-mp3-mad-gpl" +else + config_options+=" --disable-music-mp3 --disable-music-mp3-mad-gpl" +fi + build_autotools $config_options diff --git a/pkgdef/libmad.sh b/pkgdef/libmad.sh new file mode 100644 index 0000000..ed186d1 --- /dev/null +++ b/pkgdef/libmad.sh @@ -0,0 +1,25 @@ +description "MPEG Audio Decoder library" +check_library mad +variant stable fetch_download \ + ftp://ftp.mars.org/pub/mpeg/libmad-0.15.1b.tar.gz \ + bbfac3ed6bfbc2823d3775ebb931087371e142bb0e9bb1bee51a76a6e0078690 +build_autotools + +prebuild_setup() { + cp configure configure.orig + # libmad hasn't had a new release in 14 years, so we must manually + # patch the configure script to remove all these compiler flags which + # don't work any more (especially in clang): + sed configure ' + s/-fforce-mem// + s/-fthread-jumps// + s/-fcse-follow-jumps// + s/-fcse-skip-blocks// + s/-fregmove// + s/-fexpensive-optimizations// + s/-fschedule-insns2// + s/-fstrength-reduce// + s/-march=i486// + ' +} +