[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
07/13: gnu: Add python-vosk.
From: |
guix-commits |
Subject: |
07/13: gnu: Add python-vosk. |
Date: |
Mon, 17 Oct 2022 04:45:55 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit a3e20f35f53ab0809d128a68694b5f94a000b6b7
Author: Nicolas Graves <ngraves@ngraves.fr>
AuthorDate: Thu Sep 29 11:00:20 2022 +0200
gnu: Add python-vosk.
* gnu/packages/machine-learning.scm (python-vosk): New variable.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
---
gnu/packages/machine-learning.scm | 40 +++++++++++++++++++++++++++++++++++++++
1 file changed, 40 insertions(+)
diff --git a/gnu/packages/machine-learning.scm
b/gnu/packages/machine-learning.scm
index b5e17462eb..34b82aa101 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -3562,3 +3562,43 @@ for different programming languages. It allows quick
reconfiguration of
vocabulary for better accuracy, and supports speaker identification beside
simple speech recognition.")
(license license:asl2.0))))
+
+(define-public python-vosk
+ (package
+ (inherit vosk-api)
+ (name "python-vosk")
+ (build-system python-build-system)
+ (propagated-inputs
+ (list python-cffi python-requests python-tqdm python-srt
python-websockets))
+ (inputs (list vosk-api))
+ (arguments
+ (list
+ #:tests? #f ;; TODO There are tests but not run through Makefile.
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'config
+ (lambda _
+ (chdir "python")
+ (setenv "VOSK_SOURCE" #$vosk-api)))
+ (add-before 'build 'from-abi-to-api
+ (lambda _
+ (substitute* "vosk_builder.py"
+ (("ffibuilder\\.set_source\\(\"vosk.vosk_cffi\", None\\)")
+ (string-append
+ "ffibuilder.set_source(\"vosk.vosk_cffi\", "
+
"r\"\"\"\n#include<vosk_api.h>\n#include<Python.h>\"\"\",\n\t"
+ "library_dirs=["
+ "'" #$vosk-api "/lib'"
+ "],\n\t"
+ "libraries=['vosk', 'python3.9'],\n\t"
+ "include_dirs=["
+ "'" #$vosk-api "/src'" "])")))
+ (substitute* "vosk/__init__.py"
+ (("_c = open_dll\\(\\)")
+ "")
+ (("_ffi")
+ "ffi")
+ (("from \\.vosk_cffi import ffi as ffi")
+ "from .vosk_cffi import ffi, lib")
+ (("_c\\.")
+ "lib.")))))))))
- branch master updated (094b357783 -> c2cb116032), guix-commits, 2022/10/17
- 11/13: gnu: git-annex: Promote git to propagated input, guix-commits, 2022/10/17
- 01/13: Revert "nix: Guard against removing temporary roots of living processes.", guix-commits, 2022/10/17
- 04/13: gnu: Add openfst-for-vosk., guix-commits, 2022/10/17
- 03/13: channels: Interpret the 'commit' field of channel as a tag or commit., guix-commits, 2022/10/17
- 05/13: gnu: Add kaldi-for-vosk., guix-commits, 2022/10/17
- 08/13: gnu: Add nerd-dictation., guix-commits, 2022/10/17
- 06/13: gnu: Add vosk-api., guix-commits, 2022/10/17
- 02/13: git: 'update-cached-checkout' returns the commit ID when given a tag., guix-commits, 2022/10/17
- 07/13: gnu: Add python-vosk.,
guix-commits <=
- 09/13: gnu: Add nerd-dictation/wayland., guix-commits, 2022/10/17
- 10/13: read-print: Recognize 'define-record-type' and 'define-record-type*'., guix-commits, 2022/10/17
- 12/13: gnu: nheko: Do not build api docs., guix-commits, 2022/10/17
- 13/13: gnu: Add hunspell-dict-hu., guix-commits, 2022/10/17