gruut: init at 1.2.2

This commit is contained in:
Martin Weinelt 2021-07-03 21:30:55 +02:00
parent 0548185f5b
commit b95b77bb98
No known key found for this signature in database
GPG Key ID: 87C1E9888F856759
4 changed files with 108 additions and 0 deletions

View File

@ -0,0 +1,74 @@
{ lib
, buildPythonPackage
, callPackage
, pythonOlder
, fetchFromGitHub
, Babel
, gruut-ipa
, jsonlines
, num2words
, python-crfsuite
, dataclasses
, python
}:
let
langPkgs = [
"cs"
"de"
"es"
"fr"
"it"
"nl"
"pt"
"ru"
"sv"
"sw"
];
in
buildPythonPackage rec {
pname = "gruut";
version = "1.2.0";
format = "setuptools";
src = fetchFromGitHub {
owner = "rhasspy";
repo = pname;
rev = "v${version}";
sha256 = "1763qmcd1gxap27jppqaywx03k5cagcl62z2p2qdiqigdksplm2g";
};
postPatch = ''
substituteInPlace requirements.txt \
--replace "Babel~=2.8.0" "Babel"
'';
propagatedBuildInputs = [
Babel
gruut-ipa
jsonlines
num2words
python-crfsuite
] ++ lib.optionals (pythonOlder "3.7") [
dataclasses
] ++ (map (lang: callPackage ./language-pack.nix {
inherit lang version format src;
}) langPkgs);
checkPhase = ''
runHook preCheck
${python.interpreter} -m unittest discover
runHook postCheck
'';
pythonImportsCheck = [
"gruut"
];
meta = with lib; {
description = "A tokenizer, text cleaner, and phonemizer for many human languages";
homepage = "https://github.com/rhasspy/gruut";
license = licenses.mit;
maintainers = teams.tts.members;
};
}

View File

@ -0,0 +1,30 @@
{ lib
, buildPythonPackage
, lang
, version
, format
, src
}:
buildPythonPackage rec {
pname = "gruut-lang-${lang}";
inherit version format src;
prePatch = ''
cd "${pname}"
'';
pythonImportsCheck = [
"gruut_lang_${lang}"
];
doCheck = false;
meta = with lib; {
description = "Language files for gruut tokenizer/phonemizer";
homepage = "https://github.com/rhasspy/gruut";
license = licenses.mit;
maintainers = teams.tts.members;
};
}

View File

@ -5562,6 +5562,8 @@ in
stdenv = stdenv_32bit;
};
gruut = with python3.pkgs; toPythonApplication gruut;
gruut-ipa = with python3.pkgs; toPythonApplication gruut-ipa;
gx = callPackage ../tools/package-management/gx { };

View File

@ -3131,6 +3131,8 @@ in {
grpcio-tools = callPackage ../development/python-modules/grpcio-tools { };
gruut = callPackage ../development/python-modules/gruut { };
gruut-ipa = callPackage ../development/python-modules/gruut-ipa { };
gsd = callPackage ../development/python-modules/gsd { };