summary refs log tree commit diff
path: root/pkgs/applications/audio/ft2-clone
diff options
context:
space:
mode:
authorFrancesco Gazzetta <fgaz@fgaz.me>2021-01-02 18:39:18 +0100
committerFrancesco Gazzetta <fgaz@fgaz.me>2021-01-02 18:55:09 +0100
commit5ec0a5636e79ee16ea5f1a4022e77e5bd6a521b4 (patch)
treef876463f6fda5533256f4d38f2d9857b52f02aaa /pkgs/applications/audio/ft2-clone
parent62f0b749d253dc73e4063e242b7848b599c5a57d (diff)
downloadnixpkgs-5ec0a5636e79ee16ea5f1a4022e77e5bd6a521b4.tar
nixpkgs-5ec0a5636e79ee16ea5f1a4022e77e5bd6a521b4.tar.gz
nixpkgs-5ec0a5636e79ee16ea5f1a4022e77e5bd6a521b4.tar.bz2
nixpkgs-5ec0a5636e79ee16ea5f1a4022e77e5bd6a521b4.tar.lz
nixpkgs-5ec0a5636e79ee16ea5f1a4022e77e5bd6a521b4.tar.xz
nixpkgs-5ec0a5636e79ee16ea5f1a4022e77e5bd6a521b4.tar.zst
nixpkgs-5ec0a5636e79ee16ea5f1a4022e77e5bd6a521b4.zip
ft2-clone: fix darwin
Diffstat (limited to 'pkgs/applications/audio/ft2-clone')
-rw-r--r--pkgs/applications/audio/ft2-clone/default.nix24
1 files changed, 23 insertions, 1 deletions
diff --git a/pkgs/applications/audio/ft2-clone/default.nix b/pkgs/applications/audio/ft2-clone/default.nix
index 6179ae71113..68b3871f29f 100644
--- a/pkgs/applications/audio/ft2-clone/default.nix
+++ b/pkgs/applications/audio/ft2-clone/default.nix
@@ -5,6 +5,10 @@
 , alsaLib
 , SDL2
 , libiconv
+, CoreAudio
+, CoreMIDI
+, CoreServices
+, Cocoa
 }:
 
 stdenv.mkDerivation rec {
@@ -18,10 +22,28 @@ stdenv.mkDerivation rec {
     sha256 = "0w3c1rgm8qlqi50gavrcjz40xb0nkis4i9mvpwmvzmdv9nipxry9";
   };
 
+  # Adapt the linux-only CMakeLists to darwin (more reliable than make-macos.sh)
+  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+    sed -i -e 's@__LINUX_ALSA__@__MACOSX_CORE__@' -e 's@asound@@' CMakeLists.txt
+  '';
+
   nativeBuildInputs = [ cmake ];
   buildInputs = [ SDL2 ]
     ++ stdenv.lib.optional stdenv.isLinux alsaLib
-    ++ stdenv.lib.optional stdenv.isDarwin libiconv;
+    ++ stdenv.lib.optionals stdenv.isDarwin [
+         libiconv
+         CoreAudio
+         CoreMIDI
+         CoreServices
+         Cocoa
+       ];
+
+  NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin [
+    "-framework CoreAudio"
+    "-framework CoreMIDI"
+    "-framework CoreServices"
+    "-framework Cocoa"
+  ];
 
   passthru.tests = {
     ft2-clone-starts = nixosTests.ft2-clone;