evcc: 0.131.4 -> 0.131.5
[NixPkgs.git] / pkgs / by-name / li / livecaptions / package.nix
blob1dc03b3e5d85f12699e1141e69f2cd5e584c5efc
2   lib,
3   stdenv,
4   fetchFromGitHub,
5   fetchurl,
6   meson,
7   ninja,
8   pkg-config,
9   cmake,
10   appstream-glib,
11   desktop-file-utils,
12   wrapGAppsHook4,
13   onnxruntime,
14   libadwaita,
15   libpulseaudio,
16   xorg,
17 }: let
18   aprilAsr = fetchFromGitHub {
19     name = "april-asr";
20     owner = "abb128";
21     repo = "april-asr";
22     rev = "3308e68442664552de593957cad0fa443ea183dd";
23     hash = "sha256-/cOZ2EcZu/Br9v0ComxnOegcEtlC9e8FYt3XHfah7mE=";
24   };
26   stdenv.mkDerivation (finalAttrs: {
27     pname = "livecaptions";
28     version = "0.4.2";
30     src = fetchFromGitHub {
31       owner = "abb128";
32       repo = "LiveCaptions";
33       rev = "v${finalAttrs.version}";
34       hash = "sha256-bLWJQgZopuQ0t2pexazUTj1+C2weRMrL3PUhIHZ0W5M=";
35     };
37     model = fetchurl {
38       name = "april-english-dev-01110_en.april";
39       url = "https://april.sapples.net/april-english-dev-01110_en.april";
40       hash = "sha256-d+uV0PpPdwijfoaMImUwHubELcsl5jymPuo9nLrbwfM=";
41     };
43     nativeBuildInputs = [
44       meson
45       ninja
46       pkg-config
47       cmake
48       appstream-glib # appstreamcli
49       desktop-file-utils # update-desktop-database
50       wrapGAppsHook4
51     ];
53     buildInputs = [
54       onnxruntime
55       libadwaita
56       libpulseaudio
57       xorg.libX11
58     ];
60     postUnpack = ''
61       rm -r source/subprojects/april-asr
62       ln -s ${aprilAsr} source/subprojects/april-asr
63     '';
65     preFixup = ''
66       gappsWrapperArgs+=(
67         --set APRIL_MODEL_PATH ${finalAttrs.model}
68       )
69     '';
71     meta = with lib; {
72       description = "Linux Desktop application that provides live captioning";
73       homepage = "https://github.com/abb128/LiveCaptions";
74       license = licenses.gpl3Plus;
75       platforms = platforms.linux;
76       maintainers = with maintainers; [Scrumplex];
77       mainProgram = "livecaptions";
78     };
79   })