summary refs log tree commit diff
path: root/pkgs/applications/audio/cheesecutter
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/audio/cheesecutter')
-rw-r--r--pkgs/applications/audio/cheesecutter/0001-Drop-baked-in-build-date-for-r13y.patch (renamed from pkgs/applications/audio/cheesecutter/0001-fix-impure-build-date-display.patch)13
-rw-r--r--pkgs/applications/audio/cheesecutter/0002-Prepend-libSDL.dylib-to-macOS-SDL-loader.patch25
-rw-r--r--pkgs/applications/audio/cheesecutter/default.nix45
3 files changed, 66 insertions, 17 deletions
diff --git a/pkgs/applications/audio/cheesecutter/0001-fix-impure-build-date-display.patch b/pkgs/applications/audio/cheesecutter/0001-Drop-baked-in-build-date-for-r13y.patch
index 2e2746f4341..9bc0e7b933e 100644
--- a/pkgs/applications/audio/cheesecutter/0001-fix-impure-build-date-display.patch
+++ b/pkgs/applications/audio/cheesecutter/0001-Drop-baked-in-build-date-for-r13y.patch
@@ -1,3 +1,13 @@
+From eb21fd64a19a0e10c4c3826fc71610fd5850fa2f Mon Sep 17 00:00:00 2001
+From: Christoph Neidahl <christoph.neidahl@gmail.com>
+Date: Sun, 13 Sep 2020 23:18:51 +0200
+Subject: [PATCH 1/2] Drop baked-in build date for r13y
+
+---
+ src/ct2util.d | 2 +-
+ src/ui/ui.d   | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
 diff --git a/src/ct2util.d b/src/ct2util.d
 index 523cadc..e462b09 100644
 --- a/src/ct2util.d
@@ -24,3 +34,6 @@ index e418dda..21af408 100644
  		screen.cprint(4, 0, 1, headerColor, hdr);
  		screen.cprint(screen.width - 14, 0, 1, headerColor, "F12 = Help");
  		int c1 = audio.player.isPlaying ? 13 : 12;
+-- 
+2.25.4
+
diff --git a/pkgs/applications/audio/cheesecutter/0002-Prepend-libSDL.dylib-to-macOS-SDL-loader.patch b/pkgs/applications/audio/cheesecutter/0002-Prepend-libSDL.dylib-to-macOS-SDL-loader.patch
new file mode 100644
index 00000000000..6e33307f9f5
--- /dev/null
+++ b/pkgs/applications/audio/cheesecutter/0002-Prepend-libSDL.dylib-to-macOS-SDL-loader.patch
@@ -0,0 +1,25 @@
+From abc5e8786d41803300b56ef40c08db0d867eb01a Mon Sep 17 00:00:00 2001
+From: Christoph Neidahl <christoph.neidahl@gmail.com>
+Date: Sun, 13 Sep 2020 23:22:33 +0200
+Subject: [PATCH 2/2] Prepend libSDL.dylib to macOS SDL loader
+
+---
+ src/derelict/sdl/sdl.d | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/derelict/sdl/sdl.d b/src/derelict/sdl/sdl.d
+index e31a52f..f7915b1 100644
+--- a/src/derelict/sdl/sdl.d
++++ b/src/derelict/sdl/sdl.d
+@@ -54,7 +54,7 @@ public:
+         super(
+             "sdl.dll",
+             "libSDL.so, libSDL.so.0, libSDL-1.2.so, libSDL-1.2.so.0",
+-            "@executable_path/../Frameworks/SDL.framework/SDL, /Library/Frameworks/SDL.framework/SDL, /System/Library/Frameworks/SDL.framework/SDL"
++            "@rpath/libSDL.dylib, @executable_path/../Frameworks/SDL.framework/SDL, /Library/Frameworks/SDL.framework/SDL, /System/Library/Frameworks/SDL.framework/SDL"
+         );
+     }
+ 
+-- 
+2.25.4
+
diff --git a/pkgs/applications/audio/cheesecutter/default.nix b/pkgs/applications/audio/cheesecutter/default.nix
index 732c2968fde..6c14cc67f81 100644
--- a/pkgs/applications/audio/cheesecutter/default.nix
+++ b/pkgs/applications/audio/cheesecutter/default.nix
@@ -1,26 +1,31 @@
-{ stdenv, lib, fetchFromGitHub, fetchpatch
-, acme, ldc, patchelf
+{ stdenv
+, lib
+, fetchFromGitHub
+, acme
+, ldc
+, patchelf
 , SDL
 }:
-
 stdenv.mkDerivation rec {
   pname = "cheesecutter";
-  version = "unstable-2019-12-06";
+  version = "unstable-2021-02-27";
 
   src = fetchFromGitHub {
     owner = "theyamo";
     repo = "CheeseCutter";
-    rev = "6b433c5512d693262742a93c8bfdfb353d4be853";
-    sha256 = "1szlcg456b208w1237581sg21x69mqlh8cr6v8yvbhxdz9swxnwy";
+    rev = "84450d3614b8fb2cabda87033baab7bedd5a5c98";
+    sha256 = "sha256:0q4a791nayya6n01l0f4kk497rdq6kiq0n72fqdpwqy138pfwydn";
   };
 
-  nativeBuildInputs = [ acme ldc patchelf ];
+  patches = [
+    ./0001-Drop-baked-in-build-date-for-r13y.patch
+  ]
+  ++ lib.optional stdenv.hostPlatform.isDarwin ./0002-Prepend-libSDL.dylib-to-macOS-SDL-loader.patch;
 
-  buildInputs = [ SDL ];
+  nativeBuildInputs = [ acme ldc ]
+    ++ lib.optional (!stdenv.hostPlatform.isDarwin) patchelf;
 
-  patches = [
-    ./0001-fix-impure-build-date-display.patch
-  ];
+  buildInputs = [ SDL ];
 
   makefile = "Makefile.ldc";
 
@@ -33,15 +38,21 @@ stdenv.mkDerivation rec {
     cp -r tunes/* $out/share/cheesecutter/example_tunes
   '';
 
-  postFixup = ''
-    rpath=$(patchelf --print-rpath $out/bin/ccutter)
-    patchelf --set-rpath "$rpath:${lib.makeLibraryPath buildInputs}" $out/bin/ccutter
-  '';
+  postFixup =
+    let
+      rpathSDL = lib.makeLibraryPath [ SDL ];
+    in
+    if stdenv.hostPlatform.isDarwin then ''
+      install_name_tool -add_rpath ${rpathSDL} $out/bin/ccutter
+    '' else ''
+      rpath=$(patchelf --print-rpath $out/bin/ccutter)
+      patchelf --set-rpath "$rpath:${rpathSDL}" $out/bin/ccutter
+    '';
 
   meta = with lib; {
-    description = "A tracker program for composing music for the SID chip.";
+    description = "A tracker program for composing music for the SID chip";
     homepage = "https://github.com/theyamo/CheeseCutter/";
-    license = licenses.gpl2;
+    license = licenses.gpl2Plus;
     platforms = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ];
     maintainers = with maintainers; [ OPNA2608 ];
   };