1{ lib 2, substituteAll 3, buildPythonApplication 4, fetchPypi 5, joblib 6, segments 7, attrs 8, espeak-ng 9, pytestCheckHook 10, pytest-cov 11}: 12 13buildPythonApplication rec { 14 pname = "phonemizer"; 15 version = "2.2.2"; 16 17 src = fetchPypi { 18 inherit pname version; 19 sha256 = "ae252f0bc7633e172b08622f318e7e112cde847e9281d4675ea7210157325146"; 20 }; 21 22 postPatch = '' 23 sed -i -e '/\'pytest-runner\'/d setup.py 24 ''; 25 26 patches = [ 27 (substituteAll { 28 src = ./backend-paths.patch; 29 espeak = "${lib.getBin espeak-ng}/bin/espeak"; 30 # override festival path should you try to integrate it 31 festival = ""; 32 }) 33 ./remove-intertwined-festival-test.patch 34 ]; 35 36 propagatedBuildInputs = [ 37 joblib 38 segments 39 attrs 40 ]; 41 42 preCheck = '' 43 export HOME=$TMPDIR 44 ''; 45 46 checkInputs = [ 47 pytestCheckHook 48 pytest-cov 49 ]; 50 51 # We tried to package festvial, but were unable to get the backend running, 52 # so let's disable related tests. 53 pytestFlagsArray = [ 54 "--ignore=test/test_festival.py" 55 ]; 56 57 disabledTests = [ 58 "test_festival" 59 "test_relative" 60 "test_absolute" 61 "test_readme_festival_syll" 62 ]; 63 64 meta = with lib; { 65 homepage = "https://github.com/bootphon/phonemizer"; 66 description = "Simple text to phones converter for multiple languages"; 67 license = licenses.gpl3; 68 maintainers = with maintainers; [ ]; 69 }; 70}