piper deps aren't packaged in ::gentoo, and should be USE conditional anyway.
Rebased for 9.18, which adds the seq2seq extension (grammar checker): it
links onnxruntime too, so USE=-piper removes it as well.

https://bugs.gentoo.org/961974

--- a/setup/extensions.json
+++ b/setup/extensions.json
@@ -136,24 +136,6 @@
 		"needs_c++": "17"
     },
     {
-        "name": "piper",
-        "sources": "calibre/utils/tts/piper.cpp",
-        "headers": "calibre/utils/onnx_common.h",
-		"needs_c++": "17",
-        "libraries": "!piper_libs",
-        "lib_dirs": "!piper_lib_dirs",
-        "inc_dirs": "!piper_inc_dirs"
-    },
-    {
-        "name": "seq2seq",
-        "sources": "calibre/utils/grammar/seq2seq.cpp",
-        "headers": "calibre/utils/onnx_common.h",
-        "needs_c++": "17",
-        "libraries": "!onnx_libs",
-        "lib_dirs": "!onnx_lib_dirs",
-        "inc_dirs": "!onnx_inc_dirs"
-    },
-    {
         "name": "html_as_json",
         "sources": "calibre/srv/html_as_json.cpp",
 		"needs_c++": "11"
--- a/src/calibre/constants.py
+++ b/src/calibre/constants.py
@@ -278,8 +278,6 @@
             'rcc_backend',
             'icu',
             'speedup',
-            'piper',
-            'seq2seq',
             'html_as_json',
             'fast_css_transform',
             'translator',
--- a/src/calibre/utils/run_tests.py
+++ b/src/calibre/utils/run_tests.py
@@ -695,6 +695,7 @@
             }
         if 'SKIP_SPEECH_TESTS' in os.environ:
             exclude_packages.add('calibre.gui2.tts')
+            exclude_modules.add('calibre.utils.tts.piper')
         if not isbsd:
             exclude_modules.add('calibre.devices.usbms.hal')
         d = os.path.dirname
