about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/SDL2_mixer
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-09-12 08:14:37 +0000
committerAlyssa Ross <hi@alyssa.is>2023-09-12 08:14:37 +0000
commit7d648ac22d941d0c7efdd987315ae0ddf9932ba0 (patch)
tree51a3e8126722c5a52a9a1e7e40b4eeaf4610db0b /nixpkgs/pkgs/development/libraries/SDL2_mixer
parentaa4353b499e6950b7333578f936455a628145c31 (diff)
parentdb9208ab987cdeeedf78ad9b4cf3c55f5ebd269b (diff)
downloadnixlib-7d648ac22d941d0c7efdd987315ae0ddf9932ba0.tar
nixlib-7d648ac22d941d0c7efdd987315ae0ddf9932ba0.tar.gz
nixlib-7d648ac22d941d0c7efdd987315ae0ddf9932ba0.tar.bz2
nixlib-7d648ac22d941d0c7efdd987315ae0ddf9932ba0.tar.lz
nixlib-7d648ac22d941d0c7efdd987315ae0ddf9932ba0.tar.xz
nixlib-7d648ac22d941d0c7efdd987315ae0ddf9932ba0.tar.zst
nixlib-7d648ac22d941d0c7efdd987315ae0ddf9932ba0.zip
Merge branch 'nixos-unstable' of https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/SDL2_mixer')
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL2_mixer/2_0.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL2_mixer/SDL_mixer-2.0-incompatible-pointer-comparison-fix.patch26
2 files changed, 38 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/SDL2_mixer/2_0.nix b/nixpkgs/pkgs/development/libraries/SDL2_mixer/2_0.nix
index 764a39219980..e75e0c9c5cc0 100644
--- a/nixpkgs/pkgs/development/libraries/SDL2_mixer/2_0.nix
+++ b/nixpkgs/pkgs/development/libraries/SDL2_mixer/2_0.nix
@@ -1,4 +1,5 @@
 { fetchurl
+, fetchpatch
 , lzwolf
 , SDL2_mixer
 , timidity
@@ -12,6 +13,17 @@ SDL2_mixer.overrideAttrs(oa: rec {
     sha256 = "0694vsz5bjkcdgfdra6x9fq8vpzrl8m6q96gh58df7065hw5mkxl";
   };
 
+  patches = [
+    # These patches fix incompatible function pointer conversion errors with clang 16.
+    (fetchpatch {
+      url = "https://github.com/libsdl-org/SDL_mixer/commit/4119ec3fe838d38d2433f4432cd18926bda5d093.patch";
+      stripLen = 2;
+      hash = "sha256-Ug1EEZIRcV8+e1MeMsGHuTW7Zn6j4szqujP8IkIq2VM=";
+    })
+    # Based on https://github.com/libsdl-org/SDL_mixer/commit/64ab759111ddb1b033bcce64e1a04e0cba6e498f
+    ./SDL_mixer-2.0-incompatible-pointer-comparison-fix.patch
+  ];
+
   # fix default path to timidity.cfg so MIDI files could be played
   postPatch = ''
     substituteInPlace timidity/options.h \
diff --git a/nixpkgs/pkgs/development/libraries/SDL2_mixer/SDL_mixer-2.0-incompatible-pointer-comparison-fix.patch b/nixpkgs/pkgs/development/libraries/SDL2_mixer/SDL_mixer-2.0-incompatible-pointer-comparison-fix.patch
new file mode 100644
index 000000000000..76fff3fa63e2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL2_mixer/SDL_mixer-2.0-incompatible-pointer-comparison-fix.patch
@@ -0,0 +1,26 @@
+--- a/music_mpg123.c	2018-10-31 10:59:00.000000000 -0400
++++ b/music_mpg123.c	2023-09-05 21:31:51.529191521 -0400
+@@ -48,7 +48,11 @@
+     int (*mpg123_open_handle)(mpg123_handle *mh, void *iohandle);
+     const char* (*mpg123_plain_strerror)(int errcode);
+     void (*mpg123_rates)(const long **list, size_t *number);
++#if (MPG123_API_VERSION >= 45) /* api (but not abi) change as of mpg123-1.26.0 */
++    int (*mpg123_read)(mpg123_handle *mh, void *outmemory, size_t outmemsize, size_t *done );
++#else
+     int (*mpg123_read)(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done );
++#endif
+     int (*mpg123_replace_reader_handle)( mpg123_handle *mh, ssize_t (*r_read) (void *, void *, size_t), off_t (*r_lseek)(void *, off_t, int), void (*cleanup)(void*) );
+     off_t (*mpg123_seek)( mpg123_handle *mh, off_t sampleoff, int whence );
+     const char* (*mpg123_strerror)(mpg123_handle *mh);
+@@ -95,7 +99,11 @@
+         FUNCTION_LOADER(mpg123_open_handle, int (*)(mpg123_handle *mh, void *iohandle))
+         FUNCTION_LOADER(mpg123_plain_strerror, const char* (*)(int errcode))
+         FUNCTION_LOADER(mpg123_rates, void (*)(const long **list, size_t *number));
++#if (MPG123_API_VERSION >= 45) /* api (but not abi) change as of mpg123-1.26.0 */
++        FUNCTION_LOADER(mpg123_read, int (*)(mpg123_handle *mh, void *outmemory, size_t outmemsize, size_t *done ))
++#else
+         FUNCTION_LOADER(mpg123_read, int (*)(mpg123_handle *mh, unsigned char *outmemory, size_t outmemsize, size_t *done ))
++#endif
+         FUNCTION_LOADER(mpg123_replace_reader_handle, int (*)( mpg123_handle *mh, ssize_t (*r_read) (void *, void *, size_t), off_t (*r_lseek)(void *, off_t, int), void (*cleanup)(void*) ))
+         FUNCTION_LOADER(mpg123_seek, off_t (*)( mpg123_handle *mh, off_t sampleoff, int whence ))
+         FUNCTION_LOADER(mpg123_strerror, const char* (*)(mpg123_handle *mh))