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