python310Packages.piper-phonemize: init

Python bindings for phonemization library used by the Piper text to
speech system.
This commit is contained in:
Martin Weinelt 2023-06-30 01:44:52 +02:00
parent 14329c27de
commit faa7d81bd1
No known key found for this signature in database
GPG key ID: 87C1E9888F856759
3 changed files with 42 additions and 16 deletions

View file

@ -37,11 +37,6 @@ stdenv.mkDerivation rec {
hash = "sha256-cMer7CSLOXv3jc9huVA3Oy5cjXjOX9XuEXpIWau1BNQ=";
};
outputs = [
"out"
"dev"
];
nativeBuildInputs = [
cmake
pkg-config
@ -52,17 +47,9 @@ stdenv.mkDerivation rec {
onnxruntime
];
ainstallPhase = ''
runHook preInstall
install -d $out/lib
install ./libpiper_phonemize.so $out/lib
install -d $dev/include/piper_phonemize
install -D ../src/*.hpp $dev/include
runHook postInstall
'';
passthru = {
espeak-ng = espeak-ng';
};
meta = with lib; {
description = "C++ library for converting text to phonemes for Piper";

View file

@ -0,0 +1,34 @@
{ buildPythonPackage
, onnxruntime-native
, piper-phonemize-native
, pybind11
, setuptools
}:
buildPythonPackage {
inherit (piper-phonemize-native) pname version src;
format = "pyproject";
nativeBuildInputs = [
pybind11
setuptools
];
buildInputs = [
onnxruntime-native
piper-phonemize-native
piper-phonemize-native.espeak-ng
];
pythonImportsCheck = [
"piper_phonemize"
];
# no tests
doCheck = false;
meta = {
description = "Phonemization libary used by Piper text to speech system";
inherit (piper-phonemize-native.meta) homepage license maintainers;
};
}

View file

@ -7965,6 +7965,11 @@ self: super: with self; {
pipenv-poetry-migrate = callPackage ../development/python-modules/pipenv-poetry-migrate { };
piper-phonemize = callPackage ../development/python-modules/piper-phonemize {
onnxruntime-native = pkgs.onnxruntime;
piper-phonemize-native = pkgs.piper-phonemize;
};
piper-train = callPackage ../development/python-modules/piper-train { };
pip-api = callPackage ../development/python-modules/pip-api { };