about summary refs log tree commit diff
path: root/pkgs/applications/audio/lyrebird/default.nix
blob: 5eb2d745cdc32f70e8f18b039219835e4dd6b211 (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
{ python3Packages
, lib
, fetchFromGitHub
, makeDesktopItem
, wrapGAppsHook
, gtk3
, gobject-introspection
, sox
, pulseaudio
}:
let
  desktopItem = makeDesktopItem {
    name = "lyrebird";
    exec = "lyrebird";
    icon = "${placeholder "out"}/share/lyrebird/icon.png";
    desktopName = "Lyrebird";
    genericName = "Voice Changer";
    categories = [ "AudioVideo" "Audio" ];
  };
in
python3Packages.buildPythonApplication rec {
  pname = "lyrebird";
  version = "1.2.0";

  format = "other";
  doCheck = false;

  src = fetchFromGitHub {
    owner = "chxrlt";
    repo = "lyrebird";
    rev = "refs/tags/v${version}";
    sha256 = "sha256-VIYcOxvSpzRvJMzEv2i5b7t0WMF7aQxB4Y1jfvuZN/Y=";
  };

  propagatedBuildInputs = with python3Packages; [ toml pygobject3 ];

  nativeBuildInputs = [ wrapGAppsHook gobject-introspection ];

  buildInputs = [ gtk3 sox ];

  dontWrapGApps = true;
  makeWrapperArgs = [
    "--prefix 'PATH' ':' '${lib.makeBinPath [ sox pulseaudio ]}'"
    "--prefix 'PYTHONPATH' ':' '${placeholder "out"}/share/lyrebird'"
    "--chdir '${placeholder "out"}/share/lyrebird'"
    ''"''${gappsWrapperArgs[@]}"''
  ];

  installPhase = ''
    mkdir -p $out/{bin,share/{applications,lyrebird}}
    cp -at $out/share/lyrebird/ app icon.png
    cp -at $out/share/applications/ ${desktopItem}
    install -Dm755 app.py $out/bin/lyrebird
  '';

  meta = with lib; {
    description = "Simple and powerful voice changer for Linux, written in GTK 3";
    mainProgram = "lyrebird";
    homepage = "https://github.com/chxrlt/lyrebird";
    license = licenses.mit;
    maintainers = with maintainers; [ OPNA2608 ];
    platforms = platforms.linux;
  };
}