|
| 1 | +From ef8fbea5ff37a4145bdbed91fdc8a6bdfdfc81ea Mon Sep 17 00:00:00 2001 |
| 2 | +From: Patrick Poitras <patrick@pfpoitras.com> |
| 3 | +Date: Wed, 6 May 2026 19:14:43 -0700 |
| 4 | +Subject: [PATCH] Disable piper |
| 5 | + |
| 6 | +--- |
| 7 | + setup/build.py | 8 ++++++++ |
| 8 | + setup/commands.py | 5 ----- |
| 9 | + setup/resources.py | 2 +- |
| 10 | + src/calibre/gui2/tts/types.py | 5 +++-- |
| 11 | + src/calibre/test_build.py | 3 ++- |
| 12 | + src/calibre/utils/run_tests.py | 5 +++-- |
| 13 | + 6 files changed, 17 insertions(+), 11 deletions(-) |
| 14 | + |
| 15 | +diff --git a/setup/build.py b/setup/build.py |
| 16 | +index 956ad7504f..54a5f1236a 100644 |
| 17 | +--- a/setup/build.py |
| 18 | ++++ b/setup/build.py |
| 19 | +@@ -444,6 +444,14 @@ def run(self, opts): |
| 20 | + continue |
| 21 | + if not is_ext_allowed(self.compiling_for, ext): |
| 22 | + continue |
| 23 | ++################################################################################ |
| 24 | ++# Void linux patch. The piper extension relies on `onnx` which isn't |
| 25 | ++# packaged for void. It would also require espeak-ng > 1.52 also unpackaged |
| 26 | ++# (last release is Dec 2024 and is missing the |
| 27 | ++# espeak_TextToPhonemesWithTerminator() function.) |
| 28 | ++################################################################################ |
| 29 | ++ if ext.name == "piper": |
| 30 | ++ continue |
| 31 | + if ext.error: |
| 32 | + if ext.optional: |
| 33 | + self.warn(ext.error) |
| 34 | +diff --git a/setup/commands.py b/setup/commands.py |
| 35 | +index faba5b437a..96e5682ce6 100644 |
| 36 | +--- a/setup/commands.py |
| 37 | ++++ b/setup/commands.py |
| 38 | +@@ -31,7 +31,6 @@ |
| 39 | + 'manual', |
| 40 | + 'mathjax', |
| 41 | + 'osx', |
| 42 | +- 'piper_voices', |
| 43 | + 'pot', |
| 44 | + 'publish', |
| 45 | + 'publish_betas', |
| 46 | +@@ -95,10 +94,6 @@ |
| 47 | + |
| 48 | + hyphenation = Hyphenation() |
| 49 | + |
| 50 | +-from setup.piper import PiperVoices |
| 51 | +- |
| 52 | +-piper_voices = PiperVoices() |
| 53 | +- |
| 54 | + from setup.liberation import LiberationFonts |
| 55 | + |
| 56 | + liberation_fonts = LiberationFonts() |
| 57 | +diff --git a/setup/resources.py b/setup/resources.py |
| 58 | +index fbd918c5df..64a60bd0bf 100644 |
| 59 | +--- a/setup/resources.py |
| 60 | ++++ b/setup/resources.py |
| 61 | +@@ -104,7 +104,7 @@ def run(self, opts): |
| 62 | + class Resources(Command): # {{{ |
| 63 | + |
| 64 | + description = 'Compile various needed calibre resources' |
| 65 | +- sub_commands = ['liberation_fonts', 'mathjax', 'rapydscript', 'hyphenation', 'piper_voices'] |
| 66 | ++ sub_commands = ['liberation_fonts', 'mathjax', 'rapydscript', 'hyphenation'] |
| 67 | + |
| 68 | + def run(self, opts): |
| 69 | + from calibre.utils.serialize import msgpack_dumps |
| 70 | +diff --git a/src/calibre/gui2/tts/types.py b/src/calibre/gui2/tts/types.py |
| 71 | +index a9ef058ae4..0db9b3dcc3 100644 |
| 72 | +--- a/src/calibre/gui2/tts/types.py |
| 73 | ++++ b/src/calibre/gui2/tts/types.py |
| 74 | +@@ -236,8 +236,9 @@ def qt_engine_metadata(name: str, human_name: str, desc: str, allows_choosing_au |
| 75 | + continue |
| 76 | + |
| 77 | + try: |
| 78 | +- import calibre_extensions.piper as check_that_piper_imports |
| 79 | +- del check_that_piper_imports |
| 80 | ++ # import calibre_extensions.piper as check_that_piper_imports |
| 81 | ++ # del check_that_piper_imports |
| 82 | ++ pass |
| 83 | + except ImportError: |
| 84 | + pass |
| 85 | + else: |
| 86 | +diff --git a/src/calibre/test_build.py b/src/calibre/test_build.py |
| 87 | +index b60e2f1cd6..bfbed35e56 100644 |
| 88 | +--- a/src/calibre/test_build.py |
| 89 | ++++ b/src/calibre/test_build.py |
| 90 | +@@ -158,7 +158,8 @@ def test_plugins(self): |
| 91 | + # Just check that the DLL can be loaded |
| 92 | + ctypes.CDLL(os.path.join(plugins_loc, name + ('.dylib' if ismacos else '.so'))) |
| 93 | + continue |
| 94 | +- import_module('calibre_extensions.' + name) |
| 95 | ++ if 'piper' not in name: |
| 96 | ++ import_module('calibre_extensions.' + name) |
| 97 | + |
| 98 | + def test_lxml(self): |
| 99 | + from calibre.utils.cleantext import test_clean_xml_chars |
| 100 | +diff --git a/src/calibre/utils/run_tests.py b/src/calibre/utils/run_tests.py |
| 101 | +index 19853589ff..7e880dff58 100644 |
| 102 | +--- a/src/calibre/utils/run_tests.py |
| 103 | ++++ b/src/calibre/utils/run_tests.py |
| 104 | +@@ -190,8 +190,9 @@ def test_import_of_all_python_modules(self): |
| 105 | + 'calibre.utils.linux_trash', 'calibre.utils.open_with.linux', |
| 106 | + 'calibre.gui2.linux_file_dialogs', |
| 107 | + } |
| 108 | +- if 'SKIP_SPEECH_TESTS' in os.environ: |
| 109 | +- exclude_packages.add('calibre.gui2.tts') |
| 110 | ++ exclude_packages.add('calibre.gui2.tts') |
| 111 | ++ exclude_packages.add('calibre.utils.tts') |
| 112 | ++ exclude_modules.add('calibre.gui2.tts.piper') |
| 113 | + if not isbsd: |
| 114 | + exclude_modules.add('calibre.devices.usbms.hal') |
| 115 | + d = os.path.dirname |
| 116 | +-- |
| 117 | +2.54.0 |
| 118 | + |
0 commit comments