2023-01-12 05:29:59 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2023-06-30 00:48:56 +02:00
|
|
|
|
|
|
|
# build time
|
2023-01-12 05:29:59 +01:00
|
|
|
, cmake
|
2023-01-21 13:45:38 +01:00
|
|
|
, pkg-config
|
2023-06-30 00:48:56 +02:00
|
|
|
|
|
|
|
# runtime
|
2023-10-23 01:06:42 +02:00
|
|
|
, fmt
|
2023-01-12 05:29:59 +01:00
|
|
|
, onnxruntime
|
|
|
|
, pcaudiolib
|
2023-06-30 00:48:56 +02:00
|
|
|
, piper-phonemize
|
|
|
|
, spdlog
|
|
|
|
|
|
|
|
# tests
|
2023-06-09 22:01:20 +02:00
|
|
|
, piper-train
|
2023-01-12 05:29:59 +01:00
|
|
|
}:
|
|
|
|
|
2023-08-02 15:09:30 +02:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2023-06-09 22:01:20 +02:00
|
|
|
pname = "piper";
|
2023-11-14 21:49:04 +01:00
|
|
|
version = "2023.11.14-2";
|
2023-01-12 05:29:59 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rhasspy";
|
2023-06-09 22:01:20 +02:00
|
|
|
repo = "piper";
|
2023-10-23 01:06:42 +02:00
|
|
|
rev = "refs/tags/${finalAttrs.version}";
|
2023-11-14 21:49:04 +01:00
|
|
|
hash = "sha256-3ynWyNcdf1ffU3VoDqrEMrm5Jo5Zc5YJcVqwLreRCsI=";
|
2023-01-12 05:29:59 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
2023-01-21 13:45:38 +01:00
|
|
|
pkg-config
|
2023-01-12 05:29:59 +01:00
|
|
|
];
|
|
|
|
|
2023-10-23 01:06:42 +02:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DFMT_DIR=${fmt}"
|
|
|
|
"-DSPDLOG_DIR=${spdlog.src}"
|
|
|
|
"-DPIPER_PHONEMIZE_DIR=${piper-phonemize}"
|
|
|
|
];
|
|
|
|
|
2023-01-12 05:29:59 +01:00
|
|
|
buildInputs = [
|
|
|
|
onnxruntime
|
|
|
|
pcaudiolib
|
2023-06-30 00:48:56 +02:00
|
|
|
piper-phonemize
|
|
|
|
piper-phonemize.espeak-ng
|
|
|
|
spdlog
|
|
|
|
];
|
|
|
|
|
|
|
|
env.NIX_CFLAGS_COMPILE = builtins.toString [
|
|
|
|
"-isystem ${lib.getDev piper-phonemize}/include/piper-phonemize"
|
2023-01-12 05:29:59 +01:00
|
|
|
];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
2023-06-09 22:01:20 +02:00
|
|
|
install -m 0755 piper $out/bin
|
2023-01-12 05:29:59 +01:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2023-01-13 01:08:23 +01:00
|
|
|
passthru.tests = {
|
2023-06-09 22:01:20 +02:00
|
|
|
inherit piper-train;
|
2023-01-13 01:08:23 +01:00
|
|
|
};
|
|
|
|
|
2023-01-12 05:29:59 +01:00
|
|
|
meta = with lib; {
|
2023-08-02 15:09:30 +02:00
|
|
|
changelog = "https://github.com/rhasspy/piper/releases/tag/v${finalAttrs.version}";
|
2023-01-12 05:29:59 +01:00
|
|
|
description = "A fast, local neural text to speech system";
|
2023-06-09 22:01:20 +02:00
|
|
|
homepage = "https://github.com/rhasspy/piper";
|
2023-01-12 05:29:59 +01:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ hexa ];
|
2023-11-23 22:09:35 +01:00
|
|
|
mainProgram = "piper";
|
2023-01-12 05:29:59 +01:00
|
|
|
};
|
2023-08-02 15:09:30 +02:00
|
|
|
})
|