about summary refs log tree commit diff
path: root/pkgs/applications/audio/viper4linux-gui/default.nix
blob: ee8593c8e62029f2d12c4f353b594b140572545a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
{ lib
, stdenv
, fetchFromGitHub
, copyDesktopItems
, pkg-config
, qtbase
, qtsvg
, qtmultimedia
, qmake
, gst_all_1
, libpulseaudio
, makeDesktopItem
, viper4linux
, wrapQtAppsHook
}:
let
  gstPluginPath = lib.makeSearchPathOutput "lib" "lib/gstreamer-1.0" (with gst_all_1; [ gstreamer gst-plugins-viperfx gst-plugins-base gst-plugins-good ]);
in
stdenv.mkDerivation rec {
  pname = "viper4linux-gui";
  version = "unstable-2022-04-23";

  src = fetchFromGitHub {
    owner = "Audio4Linux";
    repo = "Viper4Linux-GUI";
    rev = "2d0c84d7dda76c59e31c850e38120002eb779b7a";
    sha256 = "sha256-5YlLCF598i/sldczPEgCB+1KJDA7jqM964QDSNjgTKM=";
  };

  desktopItems = [
    (makeDesktopItem {
      name = pname;
      exec = "viper-gui";
      icon = "viper";
      desktopName = "viper4linux";
      genericName = "Equalizer";
      comment = meta.description;
      categories = [ "AudioVideo" "Audio" ];
      startupNotify = false;
    })
  ];

  nativeBuildInputs = [
    qmake
    pkg-config
    wrapQtAppsHook
    copyDesktopItems
  ];

  buildInputs = [
    qtbase
    qtmultimedia
    qtsvg
    gst_all_1.gstreamer
    gst_all_1.gst-plugins-bad
    gst_all_1.gst-plugins-viperfx
    libpulseaudio
    viper4linux
  ];

  qmakeFlags = [ "V4L_Frontend.pro" ];

  qtWrapperArgs = [
    "--prefix PATH : ${lib.makeBinPath [ viper4linux gst_all_1.gstreamer ]}"
    "--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : ${gstPluginPath}"
  ];

  installPhase = ''
    runHook preInstall
    install -D V4L_Frontend $out/bin/viper-gui
    install -D icons/viper.png $out/share/icons/viper.png
    runHook postInstall
  '';

  meta = with lib; {
    description = "Official UI for Viper4Linux2";
    homepage = "https://github.com/Audio4Linux/Viper4Linux-GUI";
    license = licenses.gpl3Plus;
    platforms = [ "x86_64-linux" ];
    maintainers = with maintainers; [ rewine ];
  };
}