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