about summary refs log tree commit diff
path: root/pkgs/applications/audio
diff options
context:
space:
mode:
authorSandro <sandro.jaeckel@gmail.com>2023-01-09 01:00:24 +0100
committerGitHub <noreply@github.com>2023-01-09 01:00:24 +0100
commitbc9a00ed26b554b904128b65a66a49d6a06f23ba (patch)
treeea0df2465a9d67f87458cd63b727f78ac65ccee6 /pkgs/applications/audio
parent42ed6597033ad9e7ed218ca592188cd6dcd116bf (diff)
parentdba05fbc27c6288f5170e7ecc85225ff23805a94 (diff)
Merge pull request #206003 from azuwis/MIDIVisualizer
Diffstat (limited to 'pkgs/applications/audio')
-rw-r--r--pkgs/applications/audio/midi-visualizer/default.nix44
1 files changed, 38 insertions, 6 deletions
diff --git a/pkgs/applications/audio/midi-visualizer/default.nix b/pkgs/applications/audio/midi-visualizer/default.nix
index a50e5dcd66908..1837cb1074813 100644
--- a/pkgs/applications/audio/midi-visualizer/default.nix
+++ b/pkgs/applications/audio/midi-visualizer/default.nix
@@ -1,5 +1,24 @@
-{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libX11, glfw, makeWrapper,
-  libXrandr, libXinerama, libXcursor, gtk3, ffmpeg-full, ...}:
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, pkg-config
+, libX11
+, glfw
+, makeWrapper
+, libXrandr
+, libXinerama
+, libXcursor
+, gtk3
+, ffmpeg-full
+, AppKit
+, Carbon
+, Cocoa
+, CoreAudio
+, CoreMIDI
+, CoreServices
+, Kernel
+}:
 
 stdenv.mkDerivation rec {
   pname = "MIDIVisualizer";
@@ -15,16 +34,29 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake pkg-config makeWrapper];
 
   buildInputs = [
-    libX11
     glfw
+    ffmpeg-full
+  ] ++ lib.optionals stdenv.isLinux [
+    libX11
     libXrandr
     libXinerama
     libXcursor
     gtk3
-    ffmpeg-full
+  ] ++ lib.optionals stdenv.isDarwin [
+    AppKit
+    Carbon
+    Cocoa
+    CoreAudio
+    CoreMIDI
+    CoreServices
+    Kernel
   ];
 
-  installPhase = ''
+  installPhase = if stdenv.isDarwin then ''
+    mkdir -p $out/Applications $out/bin
+    cp -r MIDIVisualizer.app $out/Applications/
+    ln -s ../Applications/MIDIVisualizer.app/Contents/MacOS/MIDIVisualizer $out/bin/
+  '' else ''
     mkdir -p $out/bin
     cp MIDIVisualizer $out/bin
 
@@ -36,7 +68,7 @@ stdenv.mkDerivation rec {
     description = "A small MIDI visualizer tool, using OpenGL";
     homepage = "https://github.com/kosua20/MIDIVisualizer";
     license = licenses.mit;
-    platforms = platforms.linux;
+    platforms = platforms.unix;
     maintainers = [ maintainers.ericdallo ];
   };
 }