about summary refs log tree commit diff
path: root/nixpkgs/pkgs/misc/deepspeech/default.nix
blob: eddeea6eb5428e9197b574b94573199f06c3f12e (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
{ stdenv, lib, fetchurl, autoPatchelfHook }:

stdenv.mkDerivation rec {
  pname = "deepspeech";
  version = "0.9.3";

  src = fetchurl {
    url = "https://github.com/mozilla/DeepSpeech/releases/download/v${version}/native_client.amd64.cpu.linux.tar.xz";
    sha256 = "1qy2gspprcxi76jk06ljp028xl0wkk1m3mqaxyf5qbhhfbvvpfap";
  };
  setSourceRoot = "sourceRoot=`pwd`";

  nativeBuildInputs = [
    autoPatchelfHook
  ];

  buildInputs = [
    stdenv.cc.cc.lib
  ];

  installPhase = ''
    install -D deepspeech $out/bin/deepspeech
    install -D deepspeech.h $out/include/deepspeech.h
    install -D libdeepspeech.so $out/lib/libdeepspeech.so
  '';

  meta = with lib; {
    homepage = https://github.com/mozilla/DeepSpeech;
    description = "Open source embedded (offline, on-device) speech-to-text engine, which can run in real time on broad range of devices";
    license = licenses.mpl20;
    platforms = [ "x86_64-linux" ];
    maintainers = with maintainers; [ rvolosatovs ];
  };
}