about summary refs log tree commit diff
path: root/pkgs/by-name/sd/SDL2_mixer_2_0/package.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/sd/SDL2_mixer_2_0/package.nix')
-rw-r--r--pkgs/by-name/sd/SDL2_mixer_2_0/package.nix40
1 files changed, 40 insertions, 0 deletions
diff --git a/pkgs/by-name/sd/SDL2_mixer_2_0/package.nix b/pkgs/by-name/sd/SDL2_mixer_2_0/package.nix
new file mode 100644
index 0000000000000..9413b8dda96e6
--- /dev/null
+++ b/pkgs/by-name/sd/SDL2_mixer_2_0/package.nix
@@ -0,0 +1,40 @@
+# SDL2_mixer_2_0 pinned for lzwolf
+{
+  SDL2_mixer,
+  fetchFromGitHub,
+  fetchpatch,
+  lzwolf,
+  timidity,
+}:
+
+let
+  attrset = {
+    version = "2.0.4";
+
+    src = fetchFromGitHub {
+      owner = "libsdl-org";
+      repo = "SDL_mixer";
+      rev = "release-${attrset.version}";
+      hash = "sha256-vo9twUGeK2emDiGd9kSGuA/X8TxVmQrRFFm71zawWYM=";
+    };
+
+    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 \
+        --replace "/usr/share/timidity" "${timidity}/share/timidity"
+    '';
+
+    passthru.tests.lzwolf = lzwolf;
+  };
+in SDL2_mixer.overrideAttrs(_: attrset)