summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/gruut-ipa/default.nix
blob: 862c0750a82d5a17c9395971b6f5c0f17ad53861 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  espeak,
  numpy,
  python,
  unittestCheckHook,
}:

buildPythonPackage rec {
  pname = "gruut-ipa";
  version = "0.13.0";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "rhasspy";
    repo = "gruut-ipa";
    rev = "v${version}";
    hash = "sha256-Q2UKELoG8OaAPxIrZNCpXgeWZ2fCzb3g3SOVzCm/gg0=";
  };

  postPatch = ''
    patchShebangs bin/*
    substituteInPlace bin/speak-ipa \
      --replace '${"\${src_dir}:"}' "$out/${python.sitePackages}:" \
      --replace "do espeak" "do ${espeak}/bin/espeak"
  '';

  propagatedBuildInputs = [ numpy ];

  nativeCheckInputs = [ unittestCheckHook ];

  pythonImportsCheck = [ "gruut_ipa" ];

  meta = {
    description = "Library for manipulating pronunciations using the International Phonetic Alphabet (IPA)";
    mainProgram = "gruut-ipa";
    homepage = "https://github.com/rhasspy/gruut-ipa";
    license = lib.licenses.mit;
    teams = [ lib.teams.tts ];
  };
}