nixos/alsa: reintroduce hardware.alsa.enablePersistence (#373529)
[NixPkgs.git] / pkgs / applications / audio / pianobooster / default.nix
blob3ec19cf487dc5e253d97f2f21da3661cb535368a
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   cmake,
6   pkg-config,
7   qttools,
8   alsa-lib,
9   ftgl,
10   libGLU,
11   qtbase,
12   rtmidi,
13   libjack2,
14   fluidsynth,
15   soundfont-fluid,
16   unzip,
17   wrapQtAppsHook,
20 stdenv.mkDerivation rec {
21   pname = "pianobooster";
22   version = "1.0.0";
24   src = fetchFromGitHub {
25     owner = "pianobooster";
26     repo = "PianoBooster";
27     rev = "v${version}";
28     hash = "sha256-1WOlAm/HXSL6QK0Kd1mnFEZxxpMseTG+6WzgMNWt+RA=";
29   };
31   postPatch = ''
32     substituteInPlace src/Settings.cpp src/GuiMidiSetupDialog.cpp \
33       --replace "/usr/share/soundfonts" "${soundfont-fluid}/share/soundfonts" \
34       --replace "FluidR3_GM.sf2" "FluidR3_GM2-2.sf2"
35   '';
37   nativeBuildInputs = [
38     cmake
39     pkg-config
40     qttools
41     wrapQtAppsHook
42   ];
44   buildInputs = [
45     alsa-lib
46     ftgl
47     libGLU
48     qtbase
49     rtmidi
50     libjack2
51     fluidsynth
52   ];
54   cmakeFlags = [
55     "-DOpenGL_GL_PREFERENCE=GLVND"
56     "-DUSE_JACK=ON"
57   ];
59   postInstall = ''
60     qtWrapperArgs+=(
61       --prefix PATH : "${lib.makeBinPath [ unzip ]}"
62     )
63   '';
65   meta = with lib; {
66     description = "MIDI file player that teaches you how to play the piano";
67     mainProgram = "pianobooster";
68     homepage = "https://github.com/pianobooster/PianoBooster";
69     license = licenses.gpl3Plus;
70     platforms = platforms.linux;
71     maintainers = with maintainers; [ orivej ];
72   };