nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, stdenv
3, substituteAll
4, buildPythonApplication
5, fetchPypi
6, joblib
7, segments
8, attrs
9, dlinfo
10, typing-extensions
11, espeak-ng
12, pytestCheckHook
13, pytest-cov
14}:
15
16buildPythonApplication rec {
17 pname = "phonemizer";
18 version = "3.1.1";
19
20 src = fetchPypi {
21 inherit pname version;
22 sha256 = "sha256-PWVK0NLVa0Rx1xyUyQF2/RvUo3/geskn53FcEv0Jr0c=";
23 };
24
25 postPatch = ''
26 sed -i -e '/\'pytest-runner\'/d setup.py
27 '';
28
29 patches = [
30 (substituteAll {
31 src = ./backend-paths.patch;
32 libespeak = "${lib.getLib espeak-ng}/lib/libespeak-ng${stdenv.hostPlatform.extensions.sharedLibrary}";
33 # FIXME package festival
34 })
35 ./remove-intertwined-festival-test.patch
36 ];
37
38 propagatedBuildInputs = [
39 joblib
40 segments
41 attrs
42 dlinfo
43 typing-extensions
44 ];
45
46 preCheck = ''
47 export HOME=$TMPDIR
48 '';
49
50 checkInputs = [
51 pytestCheckHook
52 ];
53
54 # We tried to package festvial, but were unable to get the backend running,
55 # so let's disable related tests.
56 disabledTestPaths = [
57 "test/test_festival.py"
58 ];
59
60 disabledTests = [
61 "test_festival"
62 "test_festival_path"
63 "test_readme_festival_syll"
64 "test_unicode"
65 ];
66
67 meta = with lib; {
68 homepage = "https://github.com/bootphon/phonemizer";
69 changelog = "https://github.com/bootphon/phonemizer/blob/v${version}/CHANGELOG.md";
70 description = "Simple text to phones converter for multiple languages";
71 license = licenses.gpl3Plus;
72 maintainers = with maintainers; [ ];
73 };
74}