Merge pull request #265998 from reckenrode/SDL_mixer-fix

SDL_mixer: fix build with clang 16

authored by Weijia Wang and committed by GitHub 62b155b8 f29194bf

+39 -1
+39 -1
pkgs/development/libraries/SDL_mixer/default.nix
··· 1 - { stdenv, lib, fetchurl 1 + { stdenv, lib, fetchurl, fetchpatch 2 2 , SDL, libogg, libvorbis, smpeg, libmikmod 3 3 , fluidsynth, pkg-config 4 4 , enableNativeMidi ? false ··· 12 12 url = "http://www.libsdl.org/projects/${pname}/release/${pname}-${version}.tar.gz"; 13 13 sha256 = "0alrhqgm40p4c92s26mimg9cm1y7rzr6m0p49687jxd9g6130i0n"; 14 14 }; 15 + 16 + patches = [ 17 + # Fixes implicit declaration of `Mix_QuitFluidSynth`, which causes build failures with clang. 18 + # https://github.com/libsdl-org/SDL_mixer/issues/287 19 + (fetchpatch { 20 + name = "fluidsynth-fix-implicit-declaration.patch"; 21 + url = "https://github.com/libsdl-org/SDL_mixer/commit/05b12a3c22c0746c29dc5478f5b7fbd8a51a1303.patch"; 22 + hash = "sha256-MDuViLD1w1tAVLoX2yFeJ865v21S2roi0x7Yi7GYRVU="; 23 + }) 24 + # Backport of 2.0 fixes for incompatible function pointer conversions, fixing builds with clang. 25 + (fetchpatch { 26 + name = "fluidsynth-fix-function-pointer-conversions.patch"; 27 + url = "https://github.com/libsdl-org/SDL_mixer/commit/0c504159d212b710a47cb25c669b21730fc78edd.patch"; 28 + hash = "sha256-FSj7JLE2MbGVYCspoq3trXP5Ho+lAtnro2IUOHkto/U"; 29 + }) 30 + # Backport of MikMod fixes, which includes incompatible function pointer conversions. 31 + (fetchpatch { 32 + name = "mikmod-fixes.patch"; 33 + url = "https://github.com/libsdl-org/SDL_mixer/commit/a3e5ff8142cf3530cddcb27b58f871f387796ab6.patch"; 34 + hash = "sha256-dqD8hxx6U2HaelUx0WsGPiWuso++LjwasaAeTTGqdbk"; 35 + }) 36 + # More incompatible function pointer conversion fixes (this time in Vorbis-decoding code). 37 + (fetchpatch { 38 + name = "vorbis-fix-function-pointer-conversion.patch"; 39 + url = "https://github.com/libsdl-org/SDL_mixer/commit/9e6d7b67a00656a68ea0c2eace75c587871549b9.patch"; 40 + hash = "sha256-rZI3bFb/KxnduTkA/9CISccKHUgrX22KXg69sl/uXvU="; 41 + }) 42 + (fetchpatch { 43 + name = "vorbis-fix-function-pointer-conversion-header-part.patch"; 44 + url = "https://github.com/libsdl-org/SDL_mixer/commit/03bd4ca6aa38c1a382c892cef86296cd621ecc1d.patch"; 45 + hash = "sha256-7HrSHYFYVgpamP7Q9znrFZMZ72jvz5wYpJEPqWev/I4="; 46 + }) 47 + (fetchpatch { 48 + name = "vorbis-fix-function-pointer-signature.patch"; 49 + url = "https://github.com/libsdl-org/SDL_mixer/commit/d28cbc34d63dd20b256103c3fe506ecf3d34d379.patch"; 50 + hash = "sha256-sGbtF+Tcjf+6a28nJgawefeeKXnhcwu7G55e94oS9AU="; 51 + }) 52 + ]; 15 53 16 54 nativeBuildInputs = [ pkg-config ]; 17 55 buildInputs = [ SDL libogg libvorbis fluidsynth smpeg libmikmod ];