From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id aBQSIa9gNWNODwAAbAwnHQ (envelope-from ) for ; Thu, 29 Sep 2022 11:09:03 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 2ILLH69gNWNaEgEAG6o9tA (envelope-from ) for ; Thu, 29 Sep 2022 11:09:03 +0200 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1BF3CEF22 for ; Thu, 29 Sep 2022 11:09:03 +0200 (CEST) Received: from localhost ([::1]:58882 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1odpXS-0004rP-Ad for larch@yhetil.org; Thu, 29 Sep 2022 05:09:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51786) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1odpQh-0007ss-LP for guix-patches@gnu.org; Thu, 29 Sep 2022 05:02:06 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:36869) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1odpQh-0004Ry-Ci for guix-patches@gnu.org; Thu, 29 Sep 2022 05:02:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1odpQh-0002zD-7T for guix-patches@gnu.org; Thu, 29 Sep 2022 05:02:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58140] [PATCH v3 4/6] gnu: Add python-vosk. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 29 Sep 2022 09:02:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58140 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 58140@debbugs.gnu.org Cc: ngraves@ngraves.fr Received: via spool by 58140-submit@debbugs.gnu.org id=B58140.166444207311407 (code B ref 58140); Thu, 29 Sep 2022 09:02:03 +0000 Received: (at 58140) by debbugs.gnu.org; 29 Sep 2022 09:01:13 +0000 Received: from localhost ([127.0.0.1]:35945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odpPs-0002xu-Nd for submit@debbugs.gnu.org; Thu, 29 Sep 2022 05:01:13 -0400 Received: from 2.mo582.mail-out.ovh.net ([46.105.76.65]:38659) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1odpPZ-0002vu-9n for 58140@debbugs.gnu.org; Thu, 29 Sep 2022 05:01:08 -0400 Received: from player746.ha.ovh.net (unknown [10.109.138.83]) by mo582.mail-out.ovh.net (Postfix) with ESMTP id 1E5A726548 for <58140@debbugs.gnu.org>; Thu, 29 Sep 2022 09:00:52 +0000 (UTC) Received: from ngraves.fr (met42-h01-213-44-161-47.dsl.sta.abo.bbox.fr [213.44.161.47]) (Authenticated sender: ngraves@ngraves.fr) by player746.ha.ovh.net (Postfix) with ESMTPSA id 9203C21BFDA7D; Thu, 29 Sep 2022 09:00:50 +0000 (UTC) X-OVh-ClientIp: 213.44.161.47 Date: Thu, 29 Sep 2022 11:00:20 +0200 Message-Id: <20220929090022.5950-4-ngraves@ngraves.fr> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220929090022.5950-1-ngraves@ngraves.fr> References: <20220929090022.5950-1-ngraves@ngraves.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 6828301460168499938 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrfeehtddgudduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepleffjeetueethfefkeffffefvddukeejkefgleduiedthfekvefhiedvhfffgeegnecukfhppedtrddtrddtrddtpddvudefrdeggedrudeiuddrgeejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehplhgrhigvrhejgeeirdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepnhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrpdhnsggprhgtphhtthhopedupdhrtghpthhtohepheekudegtdesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekvd X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches From: Nicolas Graves via Guix-patches via X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1664442543; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=C2hCVXHCi5Y4PJPqGACBvu0jfgrrToLPOhNESxTBFPU=; b=NrTnD+MPLh/v/3mje7HodafdGVeAIB4sOUdjZsik10yf88YS/MXyA2zehfzoqaOZhM0QP3 V8DgIB+zaUwgiErdE4ml6Qz8Esb5RuXsxpNKBSJ6a63kl08YXz+T8PuvjfdV0zjcZQsKQk vi1FekzUUiDsjCxwyb00QUDRzZfbVEx+TKfLmaHcKPRcif/Wp1Gr7qa2Ka9KyN0pLSz6RD /Ij6FJK1M0FNZslOOh+zwPdPcb+XDXfdmdWEnngcuXkIBoxgSYM69xjIqj36ko0chCL1Aj 7vEanTxHKzM6dwzy5L2Gw1Zzrk/osHPUg5iwfB6Trv4FZiNM4nTLhacihj3pLQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1664442543; a=rsa-sha256; cv=none; b=rIDWji48VxX9GTaA4NxNh9E3oFoUWazZpTX5k1JSux5Ss8cpsJ09OA5Oj71Bfbm0BK+aoP ZVl8JOvPZTYtiVxf9K1UQ4DAGvWjJwS52rziu6Jlghj1uZnCRZ9uHCOhfOAmqga6dIyNfP cMWZgGGWPJS7YdxN2z9IOFQrZb3rFayMNUT80Sqxv9yw29NzdheniDgdQQaXiq0G+d5gpf KrJH6N+jW86YwHe7qtQsojWvvEwEAW2gF3nhPNmJFggSE6JPaxRWN/aG6V3yZYhGgaXnhZ dJMna3ClxcNk3iAmTx6RxDaYZp5QnGSOgJPMkpaNqq6momRQQSlFMBrv93KCRA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.74 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 1BF3CEF22 X-Spam-Score: -2.74 X-Migadu-Scanner: scn0.migadu.com X-TUID: Vcs7FpKPv+8F * gnu/packages/machine-learning.scm (python-vosk): New variable. --- 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 @@ (define-public vosk-api 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\n#include\"\"\",\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."))))))))) -- 2.37.3