2021-07-03 20:20:09 +02:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pkgs
|
|
|
|
, python
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "gruut-ipa";
|
2021-07-15 22:30:19 +02:00
|
|
|
version = "0.9.3";
|
2021-07-03 20:20:09 +02:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rhasspy";
|
|
|
|
repo = pname;
|
2021-07-15 22:30:19 +02:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "sha256-d/AbvgAD3GHXpwhqjT5Xt9q7Kix+eFMX4kW2BywZWX0=";
|
2021-07-03 20:20:09 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs bin/speak-ipa
|
|
|
|
substituteInPlace bin/speak-ipa \
|
|
|
|
--replace '${"\${src_dir}:"}' "$out/lib/${python.libPrefix}/site-packages:" \
|
|
|
|
--replace "do espeak" "do ${pkgs.espeak}/bin/espeak"
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
install -m0755 bin/speak-ipa $out/bin/speak-ipa
|
|
|
|
'';
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
${python.interpreter} -m unittest discover
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"gruut_ipa"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Library for manipulating pronunciations using the International Phonetic Alphabet (IPA)";
|
|
|
|
homepage = "https://github.com/rhasspy/gruut-ipa";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = teams.tts.members;
|
|
|
|
};
|
|
|
|
}
|