2023-01-20 10:41:00 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
2023-02-02 18:25:31 +00:00
|
|
|
, pkg-config
|
2023-01-20 10:41:00 +00:00
|
|
|
, espeak-ng
|
|
|
|
, onnxruntime
|
|
|
|
, pcaudiolib
|
2023-07-15 17:15:38 +00:00
|
|
|
, piper-train
|
2023-01-20 10:41:00 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2023-07-15 17:15:38 +00:00
|
|
|
pname = "piper";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "0.0.2";
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
inherit pname version;
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rhasspy";
|
2023-07-15 17:15:38 +00:00
|
|
|
repo = "piper";
|
|
|
|
rev = "70afec58bc131010c8993c154ff02a78d1e7b8b0";
|
|
|
|
hash = "sha256-zTW7RGcV8Hh7G6Braf27F/8s7nNjAqagp7tmrKO10BY=";
|
2023-01-20 10:41:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
sourceRoot = "source/src/cpp";
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace CMakeLists.txt \
|
|
|
|
--replace "/usr/local/include/onnxruntime" "${onnxruntime}"
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2023-02-02 18:25:31 +00:00
|
|
|
pkg-config
|
2023-01-20 10:41:00 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
espeak-ng
|
|
|
|
onnxruntime
|
|
|
|
pcaudiolib
|
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
2023-07-15 17:15:38 +00:00
|
|
|
install -m 0755 piper $out/bin
|
2023-01-20 10:41:00 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests = {
|
2023-07-15 17:15:38 +00:00
|
|
|
inherit piper-train;
|
2023-01-20 10:41:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
2023-07-15 17:15:38 +00:00
|
|
|
changelog = "https://github.com/rhasspy/piper/releases/tag/v${version}";
|
2023-01-20 10:41:00 +00:00
|
|
|
description = "A fast, local neural text to speech system";
|
2023-07-15 17:15:38 +00:00
|
|
|
homepage = "https://github.com/rhasspy/piper";
|
2023-01-20 10:41:00 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ hexa ];
|
|
|
|
};
|
|
|
|
}
|