nixpkgs/pkgs/by-name/st/stt/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

42 lines
1.1 KiB
Nix

{ stdenv, lib, fetchurl, autoPatchelfHook, bzip2, xz }:
stdenv.mkDerivation rec {
pname = "stt";
version = "1.4.0";
src = fetchurl {
url = "https://github.com/coqui-ai/STT/releases/download/v${version}/native_client.tflite.Linux.tar.xz";
hash = "sha256-RVYc64pLYumQoVUEFZdxfUUaBMozaqgD0h/yiMaWN90=";
};
sourceRoot = ".";
nativeBuildInputs = [
autoPatchelfHook
];
buildInputs = [
bzip2
xz
(lib.getLib stdenv.cc.cc)
];
installPhase = ''
install -D stt $out/bin/stt
install -D coqui-stt.h $out/include/coqui-stt.h
install -D libkenlm.so $out/lib/libkenlm.so
install -D libsox.so.3 $out/lib/libsox.so.3
install -D libstt.so $out/lib/libstt.so
'';
meta = with lib; {
homepage = "https://github.com/coqui-ai/STT";
description = "Deep learning toolkit for Speech-to-Text, battle-tested in research and production";
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.mpl20;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ rvolosatovs ];
mainProgram = "stt";
};
}