aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/python-modules/phonemizer/default.nix
diff options
context:
space:
mode:
authorMx Kookie <kookie@spacekookie.de>2020-12-09 18:55:19 +0000
committerMx Kookie <kookie@spacekookie.de>2020-12-09 18:55:19 +0000
commit80d90d9b204f7c17912740f9f414fe5d59f293ba (patch)
tree5f2065a06e724270610760d59d01c6888b375a46 /infra/libkookie/nixpkgs/pkgs/development/python-modules/phonemizer/default.nix
parent3a31a84c7d3e589035ad08499206aac44a81f424 (diff)
parent83cbad92d73216bb0d9187c56cce0b91f9121d5a (diff)
Merge commit '83cbad92d73216bb0d9187c56cce0b91f9121d5a' into main
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/python-modules/phonemizer/default.nix')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/python-modules/phonemizer/default.nix73
1 files changed, 73 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/python-modules/phonemizer/default.nix b/infra/libkookie/nixpkgs/pkgs/development/python-modules/phonemizer/default.nix
new file mode 100644
index 000000000000..2d6531794313
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/development/python-modules/phonemizer/default.nix
@@ -0,0 +1,73 @@
+{ lib
+, substituteAll
+, buildPythonApplication
+, fetchPypi
+, python3Packages
+, pkgs
+, joblib
+, segments
+, attrs
+, espeak-ng
+, pytestCheckHook
+, pytestrunner
+, pytestcov
+}:
+
+buildPythonApplication rec {
+ pname = "phonemizer";
+ version = "2.2.1";
+
+ src = fetchPypi {
+ inherit pname version;
+ sha256 = "127n4f10zxq60qd8xvlc1amji4wbghqb90rfp25rzdk716kvgwab";
+ };
+
+ postPatch = ''
+ sed -i -e '/\'pytest-runner\'/d setup.py
+ '';
+
+ patches = [
+ (substituteAll {
+ src = ./backend-paths.patch;
+ espeak = "${lib.getBin espeak-ng}/bin/espeak";
+ # override festival path should you try to integrate it
+ festival = "";
+ })
+ ./remove-intertwined-festival-test.patch
+ ];
+
+ propagatedBuildInputs = [
+ joblib
+ segments
+ attrs
+ ];
+
+ preCheck = ''
+ export HOME=$TMPDIR
+ '';
+
+ checkInputs = [
+ pytestCheckHook
+ pytestcov
+ ];
+
+ # We tried to package festvial, but were unable to get the backend running,
+ # so let's disable related tests.
+ pytestFlagsArray = [
+ "--ignore=test/test_festival.py"
+ ];
+
+ disabledTests = [
+ "test_festival"
+ "test_relative"
+ "test_absolute"
+ "test_readme_festival_syll"
+ ];
+
+ meta = with lib; {
+ homepage = "https://github.com/bootphon/phonemizer";
+ description = "Simple text to phones converter for multiple languages";
+ license = licenses.gpl3;
+ maintainers = with maintainers; [ hexa ];
+ };
+}