about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/audio/bambootracker/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/audio/bambootracker/default.nix')
-rw-r--r--nixpkgs/pkgs/applications/audio/bambootracker/default.nix25
1 files changed, 19 insertions, 6 deletions
diff --git a/nixpkgs/pkgs/applications/audio/bambootracker/default.nix b/nixpkgs/pkgs/applications/audio/bambootracker/default.nix
index 5d89813216dc..09be8faa8a0f 100644
--- a/nixpkgs/pkgs/applications/audio/bambootracker/default.nix
+++ b/nixpkgs/pkgs/applications/audio/bambootracker/default.nix
@@ -1,7 +1,8 @@
 { mkDerivation
-, lib
 , stdenv
+, lib
 , fetchFromGitHub
+, fetchpatch
 , qmake
 , pkg-config
 , qttools
@@ -21,10 +22,15 @@ mkDerivation rec {
     sha256 = "0iddqfw951dw9xpl4w7310sl4z544507ppb12i8g4fzvlxfw2ifc";
   };
 
-  postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
-    substituteInPlace BambooTracker/BambooTracker.pro \
-      --replace '# Temporary known-error downgrades here' 'CPP_WARNING_FLAGS += -Wno-missing-braces'
-  '';
+  # TODO Remove when updating past 0.4.6
+  # Fixes build failure on darwin
+  patches = [
+    (fetchpatch {
+      name = "bambootracker-Add_braces_in_initialization_of_std-array.patch";
+      url = "https://github.com/rerrahkr/BambooTracker/commit/0fc96c60c7ae6c2504ee696bb7dec979ac19717d.patch";
+      sha256 = "1z28af46mqrgnyrr4i8883gp3wablkk8rijnj0jvpq01s4m2sfjn";
+    })
+  ];
 
   nativeBuildInputs = [ qmake qttools pkg-config ];
 
@@ -34,12 +40,19 @@ mkDerivation rec {
 
   postConfigure = "make qmake_all";
 
+  # installs app bundle on darwin, re-extract the binary
+  # wrapQtAppsHook fails to wrap mach-o binaries, manually call wrapper (https://github.com/NixOS/nixpkgs/issues/102044)
+  postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
+    mv $out/bin/BambooTracker{.app/Contents/MacOS/BambooTracker,}
+    rm -r $out/bin/BambooTracker.app
+    wrapQtApp $out/bin/BambooTracker
+  '';
+
   meta = with lib; {
     description = "A tracker for YM2608 (OPNA) which was used in NEC PC-8801/9801 series computers";
     homepage = "https://rerrahkr.github.io/BambooTracker";
     license = licenses.gpl2Only;
     platforms = platforms.all;
     maintainers = with maintainers; [ OPNA2608 ];
-    broken = stdenv.isDarwin;
   };
 }