diff --git a/pkgs/tools/audio/wyoming/faster-whisper-entrypoint.patch b/pkgs/tools/audio/wyoming/faster-whisper-entrypoint.patch deleted file mode 100644 index 27a6bd082495..000000000000 --- a/pkgs/tools/audio/wyoming/faster-whisper-entrypoint.patch +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/setup.py b/setup.py -index 04eedbc..ee0b495 100644 ---- a/setup.py -+++ b/setup.py -@@ -35,4 +35,9 @@ setup( - "Programming Language :: Python :: 3.10", - ], - keywords="rhasspy wyoming whisper", -+ entry_points={ -+ 'console_scripts': [ -+ 'wyoming-faster-whisper = wyoming_faster_whisper:__main__.run' -+ ] -+ } - ) -diff --git a/wyoming_faster_whisper/__main__.py b/wyoming_faster_whisper/__main__.py -index 8a5039f..bd1e7b6 100755 ---- a/wyoming_faster_whisper/__main__.py -+++ b/wyoming_faster_whisper/__main__.py -@@ -131,8 +131,12 @@ async def main() -> None: - - # ----------------------------------------------------------------------------- - -+def run(): -+ asyncio.run(main()) -+ -+ - if __name__ == "__main__": - try: -- asyncio.run(main()) -+ run() - except KeyboardInterrupt: - pass diff --git a/pkgs/tools/audio/wyoming/faster-whisper.nix b/pkgs/tools/audio/wyoming/faster-whisper.nix index 4bc098240622..e7eecd18350d 100644 --- a/pkgs/tools/audio/wyoming/faster-whisper.nix +++ b/pkgs/tools/audio/wyoming/faster-whisper.nix @@ -1,31 +1,39 @@ { lib , python3 -, fetchPypi +, fetchFromGitHub , fetchpatch }: python3.pkgs.buildPythonApplication rec { pname = "wyoming-faster-whisper"; - version = "1.0.1"; - format = "setuptools"; + version = "1.0.2"; + pyproject = true; - src = fetchPypi { - pname = "wyoming_faster_whisper"; - inherit version; - hash = "sha256-wo62m8gIP9hXihkd8j2haVvz3TlJv3m5WWthTPFwesk="; + src = fetchFromGitHub { + owner = "rhasspy"; + repo = "wyoming-faster-whisper"; + rev = "refs/tags/v${version}"; + hash = "sha256-mKnWab3i6lEnCBbO3ucNmWIxaaWwQagzfDhaD1U3qow="; }; patches = [ - ./faster-whisper-entrypoint.patch + # add wyoming-faster-whisper executable + (fetchpatch { + url = "https://github.com/rhasspy/wyoming-faster-whisper/commit/a5715197abab34253d2864ed8cf406210834b4ec.patch"; + hash = "sha256-a9gmXMngwXo9ZJDbxl/pPzm6WSy5XeGbz/Xncj7bOog="; + }) # fix model retrieval on python3.11+ (fetchpatch { - url = "https://github.com/rhasspy/rhasspy3/commit/ea55a309e55384e6fd8c9f19534622968f8ed95b.patch"; - hash = "sha256-V9WXKE3+34KGubBS23vELTHjqU2RCTk3sX8GTjmH+AA="; - stripLen = 4; + url = "https://github.com/rhasspy/wyoming-faster-whisper/commit/d5229df2c3af536013bc931c1ed7cc239b618208.patch"; + hash = "sha256-CMpOJ1qSPcdtX2h2ecGmQ/haus/gaSH8r/PCFsMChRY="; }) ]; + nativeBuildInputs = with python3.pkgs; [ + setuptools + ]; + propagatedBuildInputs = with python3.pkgs; [ ctranslate2 tokenizers @@ -41,7 +49,7 @@ python3.pkgs.buildPythonApplication rec { meta = with lib; { description = "Wyoming Server for Faster Whisper"; - homepage = "https://pypi.org/project/wyoming-faster-whisper/"; + homepage = "https://github.com/rhasspy/wyoming-faster-whisper"; license = licenses.mit; maintainers = with maintainers; [ hexa ]; };