-
-
Notifications
You must be signed in to change notification settings - Fork 20k
Expand file tree
/
Copy pathdefault.nix
More file actions
63 lines (55 loc) · 1.53 KB
/
Copy pathdefault.nix
File metadata and controls
63 lines (55 loc) · 1.53 KB
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
{ stdenv
, lib
, fetchFromGitHub
, fetchurl
, autoreconfHook
, pkg-config
, gst_all_1
, stt
, stt-models
, unstableGitUpdater
}:
stdenv.mkDerivation rec {
pname = "gst-deepspeech";
version = "unstable-2021-04-08";
outputs = [ "out" "dev" ];
src = fetchFromGitHub {
owner = "Elleo";
repo = "gst-deepspeech";
rev = "2aef372a7a1064c90ffb70c12721657bf92fca66";
sha256 = "9XGSUYV6jRMsMSA8TO7y7u9T7NihB4azzKJfZ/OPcLI=";
};
nativeBuildInputs = [
autoreconfHook
pkg-config
];
buildInputs = [
gst_all_1.gstreamer
gst_all_1.gst-plugins-base
stt
];
postPatch = ''
# https://github.com/Elleo/gst-deepspeech/pull/20
substituteInPlace src/gstdeepspeech.cc \
--replace "/usr/share/deepspeech/models/deepspeech-0.9.3-models.pbmm" "${stt-models.english.tflite}" \
--replace "/usr/share/deepspeech/models/deepspeech-0.9.3-models.scorer" "${stt-models.english.scorer}" \
--replace "#include <deepspeech.h>" "" \
--replace "DS_" "STT_"
substituteInPlace src/gstdeepspeech.h \
--replace '#include "deepspeech.h"' "#include <coqui-stt.h>"
substituteInPlace src/Makefile.am \
--replace "-ldeepspeech" "-lstt"
'';
passthru = {
updateScript = unstableGitUpdater {
url = "${src.meta.homepage}.git";
};
};
meta = {
description = "GStreamer plug-in for STT";
homepage = "https://github.com/Elleo/gst-deepspeech";
license = lib.licenses.lgpl2Plus;
maintainers = with lib.maintainers; [ jtojnar ];
platforms = stt.meta.platforms;
};
}