Martin Weinelt 2023-06-30 00:48:56 +02:00
parent faa7d81bd1
commit 1fd038e11b
No known key found for this signature in database
GPG key ID: 87C1E9888F856759
2 changed files with 20 additions and 14 deletions

View file

@ -10,6 +10,7 @@
, librosa , librosa
, numpy , numpy
, onnxruntime , onnxruntime
, piper-phonemize
, pytorch-lightning , pytorch-lightning
, torch , torch
}: }:
@ -48,6 +49,7 @@ buildPythonPackage {
librosa librosa
numpy numpy
onnxruntime onnxruntime
piper-phonemize
pytorch-lightning pytorch-lightning
torch torch
]; ];

View file

@ -1,17 +1,24 @@
{ lib { lib
, stdenv , stdenv
, fetchFromGitHub , fetchFromGitHub
# build time
, cmake , cmake
, pkg-config , pkg-config
, espeak-ng
# runtime
, onnxruntime , onnxruntime
, pcaudiolib , pcaudiolib
, piper-phonemize
, spdlog
# tests
, piper-train , piper-train
}: }:
let let
pname = "piper"; pname = "piper";
version = "0.0.2"; version = "1.2.0";
in in
stdenv.mkDerivation { stdenv.mkDerivation {
inherit pname version; inherit pname version;
@ -19,30 +26,27 @@ stdenv.mkDerivation {
src = fetchFromGitHub { src = fetchFromGitHub {
owner = "rhasspy"; owner = "rhasspy";
repo = "piper"; repo = "piper";
rev = "70afec58bc131010c8993c154ff02a78d1e7b8b0"; rev = "refs/tags/v${version}";
hash = "sha256-zTW7RGcV8Hh7G6Braf27F/8s7nNjAqagp7tmrKO10BY="; hash = "sha256-6WNWqJt0PO86vnf+3iHaRRg2KwBOEj4aicmB+P2phlk=";
}; };
sourceRoot = "source/src/cpp"; sourceRoot = "source/src/cpp";
patches = [
./fix-compilation-with-newer-onnxruntime.patch
];
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace "/usr/local/include/onnxruntime" "${onnxruntime}"
'';
nativeBuildInputs = [ nativeBuildInputs = [
cmake cmake
pkg-config pkg-config
]; ];
buildInputs = [ buildInputs = [
espeak-ng
onnxruntime onnxruntime
pcaudiolib pcaudiolib
piper-phonemize
piper-phonemize.espeak-ng
spdlog
];
env.NIX_CFLAGS_COMPILE = builtins.toString [
"-isystem ${lib.getDev piper-phonemize}/include/piper-phonemize"
]; ];
installPhase = '' installPhase = ''