1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 espeak,
6 numpy,
7 python,
8 unittestCheckHook,
9}:
10
11buildPythonPackage rec {
12 pname = "gruut-ipa";
13 version = "0.13.0";
14 format = "setuptools";
15
16 src = fetchFromGitHub {
17 owner = "rhasspy";
18 repo = "gruut-ipa";
19 rev = "v${version}";
20 hash = "sha256-Q2UKELoG8OaAPxIrZNCpXgeWZ2fCzb3g3SOVzCm/gg0=";
21 };
22
23 postPatch = ''
24 patchShebangs bin/*
25 substituteInPlace bin/speak-ipa \
26 --replace '${"\${src_dir}:"}' "$out/${python.sitePackages}:" \
27 --replace "do espeak" "do ${espeak}/bin/espeak"
28 '';
29
30 propagatedBuildInputs = [ numpy ];
31
32 nativeCheckInputs = [ unittestCheckHook ];
33
34 pythonImportsCheck = [ "gruut_ipa" ];
35
36 meta = with lib; {
37 description = "Library for manipulating pronunciations using the International Phonetic Alphabet (IPA)";
38 mainProgram = "gruut-ipa";
39 homepage = "https://github.com/rhasspy/gruut-ipa";
40 license = licenses.mit;
41 teams = [ teams.tts ];
42 };
43}