2023-11-07 04:27:58 +00:00
|
|
|
{ stdenv, lib, fetchurl, fetchpatch
|
2021-01-22 03:07:47 +00:00
|
|
|
, SDL, libogg, libvorbis, smpeg, libmikmod
|
2021-12-16 07:54:55 +00:00
|
|
|
, fluidsynth, pkg-config
|
2021-01-22 03:07:47 +00:00
|
|
|
, enableNativeMidi ? false
|
|
|
|
}:
|
2009-03-03 13:27:40 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2013-09-06 01:47:49 +00:00
|
|
|
pname = "SDL_mixer";
|
|
|
|
version = "1.2.12";
|
2006-09-12 00:15:05 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2019-08-15 12:41:18 +00:00
|
|
|
url = "http://www.libsdl.org/projects/${pname}/release/${pname}-${version}.tar.gz";
|
2013-09-06 01:47:49 +00:00
|
|
|
sha256 = "0alrhqgm40p4c92s26mimg9cm1y7rzr6m0p49687jxd9g6130i0n";
|
2006-09-12 00:15:05 +00:00
|
|
|
};
|
2008-02-06 21:17:42 +00:00
|
|
|
|
2023-11-07 04:27:58 +00:00
|
|
|
patches = [
|
|
|
|
# Fixes implicit declaration of `Mix_QuitFluidSynth`, which causes build failures with clang.
|
|
|
|
# https://github.com/libsdl-org/SDL_mixer/issues/287
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fluidsynth-fix-implicit-declaration.patch";
|
|
|
|
url = "https://github.com/libsdl-org/SDL_mixer/commit/05b12a3c22c0746c29dc5478f5b7fbd8a51a1303.patch";
|
|
|
|
hash = "sha256-MDuViLD1w1tAVLoX2yFeJ865v21S2roi0x7Yi7GYRVU=";
|
|
|
|
})
|
|
|
|
# Backport of 2.0 fixes for incompatible function pointer conversions, fixing builds with clang.
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fluidsynth-fix-function-pointer-conversions.patch";
|
|
|
|
url = "https://github.com/libsdl-org/SDL_mixer/commit/0c504159d212b710a47cb25c669b21730fc78edd.patch";
|
|
|
|
hash = "sha256-FSj7JLE2MbGVYCspoq3trXP5Ho+lAtnro2IUOHkto/U";
|
|
|
|
})
|
|
|
|
# Backport of MikMod fixes, which includes incompatible function pointer conversions.
|
|
|
|
(fetchpatch {
|
|
|
|
name = "mikmod-fixes.patch";
|
|
|
|
url = "https://github.com/libsdl-org/SDL_mixer/commit/a3e5ff8142cf3530cddcb27b58f871f387796ab6.patch";
|
|
|
|
hash = "sha256-dqD8hxx6U2HaelUx0WsGPiWuso++LjwasaAeTTGqdbk";
|
|
|
|
})
|
|
|
|
# More incompatible function pointer conversion fixes (this time in Vorbis-decoding code).
|
|
|
|
(fetchpatch {
|
|
|
|
name = "vorbis-fix-function-pointer-conversion.patch";
|
|
|
|
url = "https://github.com/libsdl-org/SDL_mixer/commit/9e6d7b67a00656a68ea0c2eace75c587871549b9.patch";
|
|
|
|
hash = "sha256-rZI3bFb/KxnduTkA/9CISccKHUgrX22KXg69sl/uXvU=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "vorbis-fix-function-pointer-conversion-header-part.patch";
|
|
|
|
url = "https://github.com/libsdl-org/SDL_mixer/commit/03bd4ca6aa38c1a382c892cef86296cd621ecc1d.patch";
|
|
|
|
hash = "sha256-7HrSHYFYVgpamP7Q9znrFZMZ72jvz5wYpJEPqWev/I4=";
|
|
|
|
})
|
|
|
|
(fetchpatch {
|
|
|
|
name = "vorbis-fix-function-pointer-signature.patch";
|
|
|
|
url = "https://github.com/libsdl-org/SDL_mixer/commit/d28cbc34d63dd20b256103c3fe506ecf3d34d379.patch";
|
|
|
|
hash = "sha256-sGbtF+Tcjf+6a28nJgawefeeKXnhcwu7G55e94oS9AU=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-12-16 07:54:55 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2021-01-22 03:07:47 +00:00
|
|
|
buildInputs = [ SDL libogg libvorbis fluidsynth smpeg libmikmod ];
|
2008-02-06 21:17:42 +00:00
|
|
|
|
2021-01-22 03:07:47 +00:00
|
|
|
configureFlags = [ "--disable-music-ogg-shared" "--disable-music-mod-shared" ]
|
2017-11-11 01:22:15 +00:00
|
|
|
++ lib.optional enableNativeMidi " --enable-music-native-midi-gpl"
|
2017-11-13 04:23:47 +00:00
|
|
|
++ lib.optionals stdenv.isDarwin [ "--disable-sdltest" "--disable-smpegtest" ];
|
2008-02-06 21:17:42 +00:00
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2009-03-03 13:27:40 +00:00
|
|
|
description = "SDL multi-channel audio mixer library";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://www.libsdl.org/projects/SDL_mixer/";
|
2013-09-06 01:47:49 +00:00
|
|
|
maintainers = with maintainers; [ lovek323 ];
|
2017-03-18 23:22:48 +00:00
|
|
|
platforms = platforms.unix;
|
2018-08-19 08:13:58 +00:00
|
|
|
license = licenses.zlib;
|
2008-02-06 21:17:42 +00:00
|
|
|
};
|
2009-03-03 13:27:40 +00:00
|
|
|
}
|