gruut: init at 1.2.2
This commit is contained in:
parent
0548185f5b
commit
b95b77bb98
74
pkgs/development/python-modules/gruut/default.nix
Normal file
74
pkgs/development/python-modules/gruut/default.nix
Normal 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;
|
||||
};
|
||||
}
|
30
pkgs/development/python-modules/gruut/language-pack.nix
Normal file
30
pkgs/development/python-modules/gruut/language-pack.nix
Normal 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;
|
||||
};
|
||||
}
|
@ -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 { };
|
||||
|
@ -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 { };
|
||||
|
Loading…
Reference in New Issue
Block a user