depot/third_party/nixpkgs/pkgs/applications/audio/midi-visualizer/default.nix
Default email 6d4aeb4377 Project import generated by Copybara.
GitOrigin-RevId: 0f213d0fee84280d8c3a97f7469b988d6fe5fcdf
2023-01-11 08:51:40 +01:00

74 lines
1.4 KiB
Nix

{ 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";
version = "6.5";
src = fetchFromGitHub {
owner = "kosua20";
repo = pname;
rev = "v${version}";
sha256 = "sha256-thRcRJ88bz3jwu6rKaQxt2MkBSf5Ri1jygkKDguP2eE=";
};
nativeBuildInputs = [ cmake pkg-config makeWrapper];
buildInputs = [
glfw
ffmpeg-full
] ++ lib.optionals stdenv.isLinux [
libX11
libXrandr
libXinerama
libXcursor
gtk3
] ++ lib.optionals stdenv.isDarwin [
AppKit
Carbon
Cocoa
CoreAudio
CoreMIDI
CoreServices
Kernel
];
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
wrapProgram $out/bin/MIDIVisualizer \
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_DATA_DIRS"
'';
meta = with lib; {
description = "A small MIDI visualizer tool, using OpenGL";
homepage = "https://github.com/kosua20/MIDIVisualizer";
license = licenses.mit;
platforms = platforms.unix;
maintainers = [ maintainers.ericdallo ];
};
}