python3Packages.speechrecognition: cleanup, fix on darwin

This commit is contained in:
Gaetan Lepage
2026-05-27 21:52:09 +00:00
parent 063bacf73d
commit 99cfc03f72
@@ -2,31 +2,49 @@
lib,
buildPythonPackage,
fetchFromGitHub,
cacert,
cohere,
faster-whisper,
flac,
google-cloud-speech,
groq,
httpx,
openai-whisper,
openai,
pocketsphinx,
pyaudio,
pytest-httpserver,
pytestCheckHook,
requests,
respx,
# build-system
setuptools,
soundfile,
# dependencies
standard-aifc,
typing-extensions,
# optional-dependencies
# assemblyai
requests,
# audio
pyaudio,
# cohere
cohere,
# faster-whisper
faster-whisper,
# google-cloud
google-cloud-speech,
# grok
groq,
httpx,
# openai
openai,
# pocketsphinx
pocketsphinx,
# whisper-local
openai-whisper,
soundfile,
# tests
pytest-httpserver,
pytestCheckHook,
respx,
}:
buildPythonPackage (finalAttrs: {
pname = "speechrecognition";
version = "3.16.1";
pyproject = true;
__structuredAttrs = true;
src = fetchFromGitHub {
owner = "Uberi";
@@ -35,8 +53,8 @@ buildPythonPackage (finalAttrs: {
hash = "sha256-5BTwUzo2U7/VwmEqldxXddt/ByKebZKY1KhCEoIb9F8=";
};
# Remove Bundled binaries
postPatch = ''
# Remove Bundled binaries
rm speech_recognition/flac-*
rm -r third-party
@@ -75,12 +93,12 @@ buildPythonPackage (finalAttrs: {
nativeCheckInputs = [
groq
pocketsphinx
pytest-httpserver
pytestCheckHook
pocketsphinx
respx
]
++ lib.flatten (builtins.attrValues finalAttrs.passthru.optional-dependencies);
++ lib.concatAttrValues finalAttrs.passthru.optional-dependencies;
pythonImportsCheck = [ "speech_recognition" ];
@@ -94,6 +112,8 @@ buildPythonPackage (finalAttrs: {
"tests/recognizers/test_vosk.py"
];
__darwinAllowLocalNetworking = true;
meta = {
description = "Speech recognition module for Python, supporting several engines and APIs, online and offline";
homepage = "https://github.com/Uberi/speech_recognition";