summary refs log tree commit diff
diff options
context:
space:
mode:
authorOPNA2608 <christoph.neidahl@gmail.com>2023-08-22 11:17:43 +0200
committerOPNA2608 <christoph.neidahl@gmail.com>2023-08-22 11:17:43 +0200
commit307c7f49379eae127b1e036f73d638cbd5018502 (patch)
tree4de45a777bf04b17f2b4894eeae759b8b4e300e7
parent199b89700d78a3ef66254723231452120284e156 (diff)
downloadnixpkgs-307c7f49379eae127b1e036f73d638cbd5018502.tar
nixpkgs-307c7f49379eae127b1e036f73d638cbd5018502.tar.gz
nixpkgs-307c7f49379eae127b1e036f73d638cbd5018502.tar.bz2
nixpkgs-307c7f49379eae127b1e036f73d638cbd5018502.tar.lz
nixpkgs-307c7f49379eae127b1e036f73d638cbd5018502.tar.xz
nixpkgs-307c7f49379eae127b1e036f73d638cbd5018502.tar.zst
nixpkgs-307c7f49379eae127b1e036f73d638cbd5018502.zip
ft2-clone: Apply patch to fix Darwin building
-rw-r--r--pkgs/applications/audio/ft2-clone/default.nix26
1 files changed, 15 insertions, 11 deletions
diff --git a/pkgs/applications/audio/ft2-clone/default.nix b/pkgs/applications/audio/ft2-clone/default.nix
index 6c63a584fc8..06a8c5daf9d 100644
--- a/pkgs/applications/audio/ft2-clone/default.nix
+++ b/pkgs/applications/audio/ft2-clone/default.nix
@@ -1,5 +1,6 @@
 { lib, stdenv
 , fetchFromGitHub
+, fetchpatch
 , cmake
 , nixosTests
 , alsa-lib
@@ -22,10 +23,20 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-tm0yTh46UKnsjH9hv3cMW0YL2x3OTRL+14x4c7w124U=";
   };
 
-  # Adapt the linux-only CMakeLists to darwin (more reliable than make-macos.sh)
-  postPatch = lib.optionalString stdenv.isDarwin ''
-    sed -i -e 's@__LINUX_ALSA__@__MACOSX_CORE__@' -e 's@asound@@' CMakeLists.txt
-  '';
+  patches = [
+    # Adapt CMake script to be Darwin-compatible
+    # https://github.com/8bitbubsy/ft2-clone/pull/30
+    (fetchpatch {
+      name = "0001-ft2-clone-Make-CMake-script-macOS-compatible.patch";
+      url = "https://github.com/8bitbubsy/ft2-clone/pull/30/commits/0033a567abf7ddbdb2bc59c7f730d22f986010aa.patch";
+      hash = "sha256-fhA+T6RI+Qmhr7mbG9lEA7esWskgK8+DkWzol0J2lUo=";
+    })
+    (fetchpatch {
+      name = "0002-ft2-clone-Fix-__MACOSX_CORE__-typo.patch";
+      url = "https://github.com/8bitbubsy/ft2-clone/pull/30/commits/fe50aff9233130150a6631875611c7db67a2d705.patch";
+      hash = "sha256-X4AVuJ0iRlpH1N/YzjdVk5+yv7eiDNoZkk0mhOizgOg=";
+    })
+  ];
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ SDL2 ]
@@ -38,13 +49,6 @@ stdenv.mkDerivation rec {
          Cocoa
        ];
 
-  NIX_LDFLAGS = lib.optionalString stdenv.isDarwin [
-    "-framework CoreAudio"
-    "-framework CoreMIDI"
-    "-framework CoreServices"
-    "-framework Cocoa"
-  ];
-
   passthru.tests = {
     ft2-clone-starts = nixosTests.ft2-clone;
   };