From unknown Tue Jun 17 22:21:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62589: Help with patch with delayed evaluation Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 01 Apr 2023 10:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62589 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 62589@debbugs.gnu.org X-Debbugs-Original-To: bug-guix@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16803431444834 (code B ref -1); Sat, 01 Apr 2023 10:00:02 +0000 Received: (at submit) by debbugs.gnu.org; 1 Apr 2023 09:59:04 +0000 Received: from localhost ([127.0.0.1]:35557 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piY0m-0001Fu-Dw for submit@debbugs.gnu.org; Sat, 01 Apr 2023 05:59:04 -0400 Received: from lists.gnu.org ([209.51.188.17]:55638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piY0l-0001Fl-5t for submit@debbugs.gnu.org; Sat, 01 Apr 2023 05:59:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piY0k-00033O-Nf for bug-guix@gnu.org; Sat, 01 Apr 2023 05:59:02 -0400 Received: from 7.mo561.mail-out.ovh.net ([46.105.57.200]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piY0j-0003tb-4Y for bug-guix@gnu.org; Sat, 01 Apr 2023 05:59:02 -0400 Received: from director2.ghost.mail-out.ovh.net (unknown [10.109.138.203]) by mo561.mail-out.ovh.net (Postfix) with ESMTP id 1660624F9D for ; Sat, 1 Apr 2023 09:58:50 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-8fdxs (unknown [10.110.171.251]) by director2.ghost.mail-out.ovh.net (Postfix) with ESMTPS id D31A91FD56 for ; Sat, 1 Apr 2023 09:58:49 +0000 (UTC) Received: from ngraves.fr ([37.59.142.95]) by ghost-submission-6684bf9d7b-8fdxs with ESMTPSA id rvnZMFkAKGRmfCEAHYa+Aw (envelope-from ) for ; Sat, 01 Apr 2023 09:58:49 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-95G001ead90377-0e50-4f15-ada8-25d1bb0470c8, 7C77ACBA02D1E582DC791C6A3247BB2D808E32EA) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 81.67.140.142 From: Nicolas Graves Date: Sat, 01 Apr 2023 11:58:49 +0200 Message-ID: <87ilefgbza.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: text/plain X-Ovh-Tracer-Id: 25332750240113328 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeifedgvddvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvffufffkgggtsehttdertddttddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepueejleeileejfffhleetjedtleejheevudffleevgfdufeekhefgvddvveegveefnecukfhppeduvdejrddtrddtrddupdekuddrieejrddugedtrddugedvpdefjedrheelrddugedvrdelheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepsghughdqghhuihigsehgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedupdhmohguvgepshhmthhpohhuth Received-SPF: pass client-ip=46.105.57.200; envelope-from=ngraves@ngraves.fr; helo=7.mo561.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hi Guix! I'm struggling with the definition of the variants of the nerd-dictation package. I'm sending a commit here. I get the following error messages: sox/wtype: unbound variable while (gnu packages audio) and (gnu packages freedesktop) are indeed imported. Originally, I wasn't using delayed evaluation, but I thought it might help, but it doesn't. I've tried to rebuild my local installation totally (make clean-go, make clean, then bootstrap from there), but it doesn't work better. Thanks if you can help! -- Best regards, Nicolas Graves From unknown Tue Jun 17 22:21:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62589: [PATCH] gnu: nerd-dictation: Factor out wrapper. Add package variants. References: <87ilefgbza.fsf@ngraves.fr> In-Reply-To: <87ilefgbza.fsf@ngraves.fr> Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 01 Apr 2023 10:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62589 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 62589@debbugs.gnu.org Cc: ngraves@ngraves.fr Received: via spool by 62589-submit@debbugs.gnu.org id=B62589.16803435185620 (code B ref 62589); Sat, 01 Apr 2023 10:06:02 +0000 Received: (at 62589) by debbugs.gnu.org; 1 Apr 2023 10:05:18 +0000 Received: from localhost ([127.0.0.1]:35567 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piY6n-0001Sa-FB for submit@debbugs.gnu.org; Sat, 01 Apr 2023 06:05:17 -0400 Received: from 15.mo583.mail-out.ovh.net ([178.33.107.29]:41919) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piY6j-0001SQ-PX for 62589@debbugs.gnu.org; Sat, 01 Apr 2023 06:05:15 -0400 Received: from director2.ghost.mail-out.ovh.net (unknown [10.108.16.164]) by mo583.mail-out.ovh.net (Postfix) with ESMTP id 65D252268F for <62589@debbugs.gnu.org>; Sat, 1 Apr 2023 10:05:12 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-8fdxs (unknown [10.109.146.157]) by director2.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 0C69F1FDB0; Sat, 1 Apr 2023 10:05:11 +0000 (UTC) Received: from ngraves.fr ([37.59.142.101]) by ghost-submission-6684bf9d7b-8fdxs with ESMTPSA id kGQmANgBKGR6gCEAHYa+Aw (envelope-from ); Sat, 01 Apr 2023 10:05:11 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-101G004382ef342-f9d0-43ad-ba7a-402f2edad406, 7C77ACBA02D1E582DC791C6A3247BB2D808E32EA) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 81.67.140.142 From: Nicolas Graves Date: Sat, 1 Apr 2023 12:05:09 +0200 Message-Id: <20230401100509.24723-1-ngraves@ngraves.fr> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 132856190600798946 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeifedgvdegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffogggtgfesthekredtredtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeelueehgfevfeevhffftdetgedugeevveehteeileeuueejhfegffetteffhffhvdenucffohhmrghinhepghhithhhuhgsrdgtohhmnecukfhppeduvdejrddtrddtrddupdekuddrieejrddugedtrddugedvpdefjedrheelrddugedvrddutddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeeivdehkeelseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehkeefpdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/machine-learning.scm (nerd-dictation): Avoid inputs pulseaudio and ydotool when not necessary. Factor out wrapper make-nerd-dictation-package. Add package variants : - nerd-dictation/xdotool - nerd-dictation/sox-xdotool - nerd-dictation/sox-ydotool - nerd-dictation/sox-wtype --- gnu/packages/machine-learning.scm | 88 +++++++++++++++++++++---------- 1 file changed, 60 insertions(+), 28 deletions(-) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 6c78b14fc6..16a5c1a7c4 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -17,6 +17,7 @@ ;;; Copyright © 2020 Edouard Klein ;;; Copyright © 2020, 2021, 2022, 2023 Vinicius Monego ;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer +;;; Copyright © 2022, 2023 Nicolas Graves ;;; ;;; This file is part of GNU Guix. ;;; @@ -63,6 +64,7 @@ (define-module (gnu packages machine-learning) #:use-module (gnu packages cran) #:use-module (gnu packages databases) #:use-module (gnu packages dejagnu) + #:use-module (gnu packages freedesktop) #:use-module (gnu packages gcc) #:use-module (gnu packages gettext) #:use-module (gnu packages gl) @@ -106,6 +108,7 @@ (define-module (gnu packages machine-learning) #:use-module (gnu packages xml) #:use-module (gnu packages xdisorg) #:use-module (gnu packages xorg) + #:use-module (srfi srfi-45) #:use-module (ice-9 match)) (define-public fann @@ -3864,7 +3867,6 @@ (define-public nerd-dictation (add-after 'unpack 'chdir (lambda _ (chdir "package/python")))))) (propagated-inputs (list python-vosk)) - (inputs (list pulseaudio xdotool)) (home-page "https://github.com/ideasman42/nerd-dictation") (synopsis "Offline speech-to-text for desktop Linux") (description "\ @@ -3876,38 +3878,68 @@ (define-public nerd-dictation @code{nerd-dictation begin} and @code{nerd-dictation end} commands.") (license license:gpl3+)))) -(define-public nerd-dictation/wayland - (package - (inherit nerd-dictation) - (name "nerd-dictation-wayland") - (inputs (list bash-minimal nerd-dictation)) - (propagated-inputs (list ydotool sox)) - (build-system trivial-build-system) - (arguments - (list - #:modules '((guix build utils)) - #:builder - #~(begin - (use-modules (guix build utils)) - (let* ((exe (string-append #$output "/bin/nerd-dictation")) - (original-exe #$(file-append nerd-dictation - "/bin/nerd-dictation")) - (bash #$(this-package-input "bash-minimal")) - (bash-exe (string-append bash "/bin/bash"))) - (mkdir-p (dirname exe)) - (call-with-output-file exe - (lambda (port) - (format port "#!~a +(define* (make-nerd-dictation-package + input-tool output-tool + #:key (nerd-dictation-package nerd-dictation)) + "Construct a nerd-dictation package for OUTPUT-TOOL." + (match-let* (((input-name output-name) + (map (lambda (tool) + (lazy + (delay (package-name (force tool))))) + (list input-tool output-tool)))) + (package + (inherit nerd-dictation-package) + (name (string-append "nerd-dictation-" + (if (equal? (force input-name) "sox") + "sox-" + "") + (force output-name))) + (build-system trivial-build-system) + (arguments + (list + #:modules '((guix build utils)) + #:builder + #~(begin + (use-modules (guix build utils)) + (let* ((exe (string-append #$output "/bin/nerd-dictation")) + (original-exe #$(file-append + (this-package-input "nerd-dictation") + "/bin/nerd-dictation")) + (bash #$(this-package-input "bash-minimal")) + (bash-exe (string-append bash "/bin/bash"))) + (mkdir-p (dirname exe)) + (call-with-output-file exe + (lambda (port) + (format port "#!~a if [ \"$1\" = begin ] then - exec ~a $@ --input=SOX --simulate-input-tool=YDOTOOL + exec ~a $@ --input=~a --simulate-input-tool=~a else exec ~a $@ fi" - bash-exe - original-exe - original-exe))) - (chmod exe #o555))))))) + bash-exe + original-exe + (if (equal? #$(force input-name) "pulseaudio") + "parec" + (string-upcase #$(force input-name))) + (string-upcase #$(force output-name)) + original-exe))) + (chmod exe #o555))))) + (inputs (list bash-minimal nerd-dictation-package)) + (propagated-inputs (list (force input-tool) (force output-tool)))))) + +;; More variants are possible, but wayland without pipewire seems unlikely. +(define-public nerd-dictation/xdotool + (make-nerd-dictation-package (delay pulseaudio) (delay xdotool))) + +(define-public nerd-dictation/sox-xdotool + (make-nerd-dictation-package (delay sox) (delay xdotool))) + +(define-public nerd-dictation/sox-ydotool + (make-nerd-dictation-package (delay sox) (delay ydotool))) + +(define-public nerd-dictation/sox-wtype + (make-nerd-dictation-package (delay sox) (delay wtype))) (define-public python-brian2 (package -- 2.39.2 From unknown Tue Jun 17 22:21:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62589: Help with patch with delayed evaluation Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 01 Apr 2023 10:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62589 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Nicolas Graves Cc: 62589@debbugs.gnu.org Received: via spool by 62589-submit@debbugs.gnu.org id=B62589.16803449298349 (code B ref 62589); Sat, 01 Apr 2023 10:29:02 +0000 Received: (at 62589) by debbugs.gnu.org; 1 Apr 2023 10:28:49 +0000 Received: from localhost ([127.0.0.1]:35582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piYTZ-0002Aa-BH for submit@debbugs.gnu.org; Sat, 01 Apr 2023 06:28:49 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57722) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piYTV-0002AL-VX for 62589@debbugs.gnu.org; Sat, 01 Apr 2023 06:28:47 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piYTP-0001Vy-33; Sat, 01 Apr 2023 06:28:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=pqZjo/ff5dOA9aVu5KEVXJXQFRNS2oHZeFqu0NiIyIs=; b=hJGxwBwJaYeFKyUh8l5W t5ke+neB9yTOT1LKRzHXYvfID8CXVJYFqVmU9QIOzeVO0SineNP7Jxzit39/euxaw3sMwZkcUW4lW dC/NM8XwRNm/qdYsA8OU7bkioeLVwH4Mt/OkGV3bO391hcd5VffuoEljIQY3rdmFbcSRsKbSLOFsc AIU21W9wPOQ4yHgXcGfp0zqpuKRyKB1Q83nLNU/jeBgq1qKBUu5w45J+36Ydv/slZO8lIwoR0lnWT CjPgdwhuFEpwmVUhYH2Rl+5M3MKDRzeagR6h/EAg6zO+df3dJykxy3hO0HHMh9I1UW9X2naMUbPj4 dpKcvW8d/UDXkw==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piYTO-00014l-Fx; Sat, 01 Apr 2023 06:28:38 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87ilefgbza.fsf@ngraves.fr> <20230401100509.24723-1-ngraves@ngraves.fr> Date: Sat, 01 Apr 2023 12:28:36 +0200 In-Reply-To: <20230401100509.24723-1-ngraves@ngraves.fr> (Nicolas Graves's message of "Sat, 1 Apr 2023 12:05:09 +0200") Message-ID: <87zg7rgaln.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hi, Nicolas Graves skribis: > +(define* (make-nerd-dictation-package > + input-tool output-tool > + #:key (nerd-dictation-package nerd-dictation)) > + "Construct a nerd-dictation package for OUTPUT-TOOL." > + (match-let* (((input-name output-name) > + (map (lambda (tool) > + (lazy > + (delay (package-name (force tool))))) > + (list input-tool output-tool)))) > + (package > + (inherit nerd-dictation-package) > + (name (string-append "nerd-dictation-" > + (if (equal? (force input-name) "sox") > + "sox-" > + "") > + (force output-name))) I don=E2=80=99t understand the details of what the patch does, but as a rul= e of thumb, make sure you only ever inherit from packages defined in the same module. Perhaps that=E2=80=99s what was going wrong? HTH, Ludo=E2=80=99. From unknown Tue Jun 17 22:21:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62589: Help with patch with delayed evaluation Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 01 Apr 2023 10:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62589 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Josselin Poiret , 62589@debbugs.gnu.org Received: via spool by 62589-submit@debbugs.gnu.org id=B62589.168034674111919 (code B ref 62589); Sat, 01 Apr 2023 10:59:02 +0000 Received: (at 62589) by debbugs.gnu.org; 1 Apr 2023 10:59:01 +0000 Received: from localhost ([127.0.0.1]:35591 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piYwn-000369-EC for submit@debbugs.gnu.org; Sat, 01 Apr 2023 06:59:01 -0400 Received: from 9.mo584.mail-out.ovh.net ([46.105.40.176]:41979) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piYwk-000360-VE for 62589@debbugs.gnu.org; Sat, 01 Apr 2023 06:59:00 -0400 Received: from director6.ghost.mail-out.ovh.net (unknown [10.108.16.32]) by mo584.mail-out.ovh.net (Postfix) with ESMTP id 89CCC24B07 for <62589@debbugs.gnu.org>; Sat, 1 Apr 2023 10:58:57 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-jv2lz (unknown [10.110.103.57]) by director6.ghost.mail-out.ovh.net (Postfix) with ESMTPS id CD8571FE44; Sat, 1 Apr 2023 10:58:56 +0000 (UTC) Received: from ngraves.fr ([37.59.142.110]) by ghost-submission-6684bf9d7b-jv2lz with ESMTPSA id jrdtLnAOKGSKWhAAMsM2XA (envelope-from ); Sat, 01 Apr 2023 10:58:56 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-110S0044897c1bb-3272-49eb-954a-db7979567950, 7C77ACBA02D1E582DC791C6A3247BB2D808E32EA) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 81.67.140.142 From: Nicolas Graves In-Reply-To: <87zg7rgaln.fsf_-_@gnu.org> References: <87ilefgbza.fsf@ngraves.fr> <20230401100509.24723-1-ngraves@ngraves.fr> <87zg7rgaln.fsf_-_@gnu.org> Date: Sat, 01 Apr 2023 12:58:55 +0200 Message-ID: <87fs9jg974.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 1040612990259618327 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeifedgfeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghffffkgggtgfesthhqredttddtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeffudelkeejveetleeuffejfefftefhhfffuedtteethfelueelveffjedvffdtffenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegtddrudegvddpfeejrdehledrudegvddruddutdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepiedvheekleesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekgedpmhhouggvpehsmhhtphhouhht X-Spam-Score: 1.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: On 2023-04-01 12:28, Ludovic =?UTF-8?Q?Court=C3=A8s?= wrote: > Hi, > > Nicolas Graves skribis: > >> +(define* (make-nerd-dictation-package >> + input-tool output-tool >> + #:key (nerd-dictation-package nerd-dictation)) >> + "Construct a ner [...] Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 1.3 RCVD_IN_VALIDITY_RPBL RBL: Relay in Validity RPBL, https://senderscore.org/blocklistlookup/ [46.105.40.176 listed in bl.score.senderscore.com] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [46.105.40.176 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [46.105.40.176 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.3 (/) On 2023-04-01 12:28, Ludovic Court=C3=A8s wrote: > Hi, > > Nicolas Graves skribis: > >> +(define* (make-nerd-dictation-package >> + input-tool output-tool >> + #:key (nerd-dictation-package nerd-dictation)) >> + "Construct a nerd-dictation package for OUTPUT-TOOL." >> + (match-let* (((input-name output-name) >> + (map (lambda (tool) >> + (lazy >> + (delay (package-name (force tool))))) >> + (list input-tool output-tool)))) >> + (package >> + (inherit nerd-dictation-package) >> + (name (string-append "nerd-dictation-" >> + (if (equal? (force input-name) "sox") >> + "sox-" >> + "") >> + (force output-name))) > > I don=E2=80=99t understand the details of what the patch does, but as a r= ule of > thumb, make sure you only ever inherit from packages defined in the same > module. The patch defines a helper for defining variants of nerd-dictation. It now supports wtype and I wasn't totally satisfied by international support for ydotool, so I wanted to switch, but copying it make a lot of repeated code. I already defined such a helper with Liliana Marie Prinkler with make-emacs-eval-in-repl, but this time I don't understand this error. Josselin was suggesting a module import cycle, (gnu packages machine-learning) is imported in (gnu packages audio), the error might come from there.=20 > > Perhaps that=E2=80=99s what was going wrong? I've tried inheriting from the above package direclty, doesn't seem to be that. > > HTH, > Ludo=E2=80=99. --=20 Best regards, Nicolas Graves From unknown Tue Jun 17 22:21:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62589: Help with patch with delayed evaluation Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 01 Apr 2023 15:28:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62589 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Josselin Poiret , 62589@debbugs.gnu.org Received: via spool by 62589-submit@debbugs.gnu.org id=B62589.168036286421679 (code B ref 62589); Sat, 01 Apr 2023 15:28:01 +0000 Received: (at 62589) by debbugs.gnu.org; 1 Apr 2023 15:27:44 +0000 Received: from localhost ([127.0.0.1]:38394 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pid8q-0005da-0h for submit@debbugs.gnu.org; Sat, 01 Apr 2023 11:27:44 -0400 Received: from 7.mo561.mail-out.ovh.net ([46.105.57.200]:56727) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pid8m-0005dQ-Uf for 62589@debbugs.gnu.org; Sat, 01 Apr 2023 11:27:42 -0400 Received: from director5.ghost.mail-out.ovh.net (unknown [10.108.20.147]) by mo561.mail-out.ovh.net (Postfix) with ESMTP id 57E7E2478C for <62589@debbugs.gnu.org>; Sat, 1 Apr 2023 15:27:39 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-hs68x (unknown [10.110.208.67]) by director5.ghost.mail-out.ovh.net (Postfix) with ESMTPS id D9E8D1FDBC; Sat, 1 Apr 2023 15:27:38 +0000 (UTC) Received: from ngraves.fr ([37.59.142.96]) by ghost-submission-6684bf9d7b-hs68x with ESMTPSA id KqTnNWpNKGQinAEAPwVKbw (envelope-from ); Sat, 01 Apr 2023 15:27:38 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-96R00169b6a675-dd22-43a9-9bf5-5137f6ad04fb, 7C77ACBA02D1E582DC791C6A3247BB2D808E32EA) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 81.67.140.142 From: Nicolas Graves In-Reply-To: <87fs9jg974.fsf@ngraves.fr> References: <87ilefgbza.fsf@ngraves.fr> <20230401100509.24723-1-ngraves@ngraves.fr> <87zg7rgaln.fsf_-_@gnu.org> <87fs9jg974.fsf@ngraves.fr> Date: Sat, 01 Apr 2023 17:27:38 +0200 Message-ID: <87cz4nfwr9.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Ovh-Tracer-Id: 5578552565900304919 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeifedgkeelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghffffkgggtgfesthhqredttddtjeenucfhrhhomheppfhitgholhgrshcuifhrrghvvghsuceonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqeenucggtffrrghtthgvrhhnpeffudelkeejveetleeuffejfefftefhhfffuedtteethfelueelveffjedvffdtffenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegtddrudegvddpfeejrdehledrudegvddrleeinecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeeivdehkeelseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedupdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) On 2023-04-01 12:58, Nicolas Graves wrote: > On 2023-04-01 12:28, Ludovic Court=C3=A8s wrote: > >> Hi, >> >> Nicolas Graves skribis: >> >>> +(define* (make-nerd-dictation-package >>> + input-tool output-tool >>> + #:key (nerd-dictation-package nerd-dictation)) >>> + "Construct a nerd-dictation package for OUTPUT-TOOL." >>> + (match-let* (((input-name output-name) >>> + (map (lambda (tool) >>> + (lazy >>> + (delay (package-name (force tool))))) >>> + (list input-tool output-tool)))) >>> + (package >>> + (inherit nerd-dictation-package) >>> + (name (string-append "nerd-dictation-" >>> + (if (equal? (force input-name) "sox") >>> + "sox-" >>> + "") >>> + (force output-name))) >> >> I don=E2=80=99t understand the details of what the patch does, but as a = rule of >> thumb, make sure you only ever inherit from packages defined in the same >> module. > > The patch defines a helper for defining variants of nerd-dictation. It > now supports wtype and I wasn't totally satisfied by international > support for ydotool, so I wanted to switch, but copying it make a lot of > repeated code. > > I already defined such a helper with Liliana Marie Prinkler with > make-emacs-eval-in-repl, but this time I don't understand this error. > > Josselin was suggesting a module import cycle, (gnu packages > machine-learning) is imported in (gnu packages audio), the error might > come from there.=20 > >> >> Perhaps that=E2=80=99s what was going wrong? > > I've tried inheriting from the above package direclty, doesn't seem to > be that. > >> >> HTH, >> Ludo=E2=80=99. After thinking and experimenting, I think what I'm trying to do is not possible in this file. This is for a record if someone has the same kind of issue in the future.=20 When I include sox or wtype as a regular input, it works fine. But it doesn't work when called from another function, I think the issue is indeed the same as when inheriting from a package. Now, there is the counterexample of the make-emacs-eval-in-repl function. IIUC, this example works with delayed evaluation because all the packages it calls are defined *in the same file*. To test this, on way could be to test inheritance on a package defined in the same file but after the inheriting package definition. IIRC, it doesn't work, but might when using delayed evaluation. This aside, the packages I'm trying to load are outside the file, and this is probably the reason why it works for make-emacs-eval-in-repl and not this function. I will try to circumvent the issue by factorising less, maybe just the gexp, but not propagated-inputs.=20 --=20 Best regards, Nicolas Graves From unknown Tue Jun 17 22:21:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62589: [PATCH] gnu: nerd-dictation: Factor out wrapper. Add package variants. References: <87ilefgbza.fsf@ngraves.fr> In-Reply-To: <87ilefgbza.fsf@ngraves.fr> Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Sat, 01 Apr 2023 17:33:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62589 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 62589@debbugs.gnu.org Cc: ngraves@ngraves.fr Received: via spool by 62589-submit@debbugs.gnu.org id=B62589.16803703673469 (code B ref 62589); Sat, 01 Apr 2023 17:33:01 +0000 Received: (at 62589) by debbugs.gnu.org; 1 Apr 2023 17:32:47 +0000 Received: from localhost ([127.0.0.1]:38532 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pif5r-0000ts-Aa for submit@debbugs.gnu.org; Sat, 01 Apr 2023 13:32:47 -0400 Received: from 18.mo561.mail-out.ovh.net ([87.98.172.162]:36447) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pif5o-0000th-8C for 62589@debbugs.gnu.org; Sat, 01 Apr 2023 13:32:46 -0400 Received: from director7.ghost.mail-out.ovh.net (unknown [10.109.143.79]) by mo561.mail-out.ovh.net (Postfix) with ESMTP id 27BFE23F3D for <62589@debbugs.gnu.org>; Sat, 1 Apr 2023 17:32:42 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-xbfnr (unknown [10.110.103.92]) by director7.ghost.mail-out.ovh.net (Postfix) with ESMTPS id E19981FDBC; Sat, 1 Apr 2023 17:32:41 +0000 (UTC) Received: from ngraves.fr ([37.59.142.99]) by ghost-submission-6684bf9d7b-xbfnr with ESMTPSA id IpU0NLlqKGTzcAIAd9A77g (envelope-from ); Sat, 01 Apr 2023 17:32:41 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-99G003d2cea0d6-7c2a-4690-bf80-0fff45efe0ab, 7C77ACBA02D1E582DC791C6A3247BB2D808E32EA) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 81.67.140.142 From: Nicolas Graves Date: Sat, 1 Apr 2023 19:32:39 +0200 Message-Id: <20230401173239.26588-1-ngraves@ngraves.fr> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 7690459315481731810 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeifedguddugecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecunecujfgurhephffvvefufffkofggtgfgsehtkeertdertdejnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepleeuhefgveefvefhffdtteegudegveevheetieelueeujefhgeffteetfffhhfdvnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucfkphepuddvjedrtddrtddruddpkedurdeijedrudegtddrudegvddpfeejrdehledrudegvddrleelnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepuddvjedrtddrtddruddpmhgrihhlfhhrohhmpeeonhhgrhgrvhgvshesnhhgrhgrvhgvshdrfhhrqedpnhgspghrtghpthhtohepuddprhgtphhtthhopeeivdehkeelseguvggssghughhsrdhgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedupdhmohguvgepshhmthhpohhuth X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) * gnu/packages/machine-learning.scm (nerd-dictation): Avoid inputs pulseaudio and ydotool when not necessary. Factor out wrapper make-nerd-dictation-package. Add package variants : - nerd-dictation/xdotool - nerd-dictation/sox-xdotool - nerd-dictation/sox-ydotool - nerd-dictation/sox-wtype --- gnu/packages/machine-learning.scm | 97 ++++++++++++++++++++++--------- 1 file changed, 69 insertions(+), 28 deletions(-) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 6c78b14fc6..4383f3fef3 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -17,6 +17,7 @@ ;;; Copyright © 2020 Edouard Klein ;;; Copyright © 2020, 2021, 2022, 2023 Vinicius Monego ;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer +;;; Copyright © 2022, 2023 Nicolas Graves ;;; ;;; This file is part of GNU Guix. ;;; @@ -63,6 +64,7 @@ (define-module (gnu packages machine-learning) #:use-module (gnu packages cran) #:use-module (gnu packages databases) #:use-module (gnu packages dejagnu) + #:use-module (gnu packages freedesktop) #:use-module (gnu packages gcc) #:use-module (gnu packages gettext) #:use-module (gnu packages gl) @@ -3864,7 +3866,6 @@ (define-public nerd-dictation (add-after 'unpack 'chdir (lambda _ (chdir "package/python")))))) (propagated-inputs (list python-vosk)) - (inputs (list pulseaudio xdotool)) (home-page "https://github.com/ideasman42/nerd-dictation") (synopsis "Offline speech-to-text for desktop Linux") (description "\ @@ -3876,38 +3877,78 @@ (define-public nerd-dictation @code{nerd-dictation begin} and @code{nerd-dictation end} commands.") (license license:gpl3+)))) -(define-public nerd-dictation/wayland - (package - (inherit nerd-dictation) - (name "nerd-dictation-wayland") - (inputs (list bash-minimal nerd-dictation)) - (propagated-inputs (list ydotool sox)) - (build-system trivial-build-system) - (arguments - (list - #:modules '((guix build utils)) - #:builder - #~(begin - (use-modules (guix build utils)) - (let* ((exe (string-append #$output "/bin/nerd-dictation")) - (original-exe #$(file-append nerd-dictation - "/bin/nerd-dictation")) - (bash #$(this-package-input "bash-minimal")) - (bash-exe (string-append bash "/bin/bash"))) - (mkdir-p (dirname exe)) - (call-with-output-file exe - (lambda (port) - (format port "#!~a +(define (nerd-dictation-gexp input-name output-name bash nerd-dictation) + #~(begin + (use-modules (guix build utils)) + (let* ((exe (string-append %output "/bin/nerd-dictation")) + (nerd-dictation-exe + #$(file-append nerd-dictation "/bin/nerd-dictation"))) + (mkdir-p (dirname exe)) + (call-with-output-file exe + (lambda (port) + (format port "#!~a if [ \"$1\" = begin ] then - exec ~a $@ --input=SOX --simulate-input-tool=YDOTOOL + exec ~a $@ --input=~a --simulate-input-tool=~a else exec ~a $@ fi" - bash-exe - original-exe - original-exe))) - (chmod exe #o555))))))) + #$(file-append bash "/bin/bash") + nerd-dictation-exe + #$input-name + #$output-name + nerd-dictation-exe))) + (chmod exe #o555)))) + +(define-public nerd-dictation/xdotool + (package + (inherit nerd-dictation) + (name "nerd-dictation-xdotool") + (build-system trivial-build-system) + (arguments (list + #:modules '((guix build utils)) + #:builder + (nerd-dictation-gexp "PAREC" "XDOTOOL" + (this-package-input "bash-minimal") + (this-package-input "nerd-dictation")))) + (inputs (list bash-minimal nerd-dictation)) + (propagated-inputs (list pulseaudio xdotool)))) + +(define-public nerd-dictation/sox-xdotool + (package + (inherit nerd-dictation/xdotool) + (name "nerd-dictation-sox-xdotool") + (arguments (list + #:modules '((guix build utils)) + #:builder + (nerd-dictation-gexp "SOX" "XDOTOOL" + (this-package-input "bash-minimal") + (this-package-input "nerd-dictation")))) + (propagated-inputs (list sox xdotool)))) + +(define-public nerd-dictation/sox-ydotool + (package + (inherit nerd-dictation/xdotool) + (name "nerd-dictation-sox-ydotool") + (arguments (list + #:modules '((guix build utils)) + #:builder + (nerd-dictation-gexp "SOX" "YDOTOOL" + (this-package-input "bash-minimal") + (this-package-input "nerd-dictation")))) + (propagated-inputs (list sox ydotool)))) + +(define-public nerd-dictation/sox-wtype + (package + (inherit nerd-dictation/xdotool) + (name "nerd-dictation-sox-wtype") + (arguments (list + #:modules '((guix build utils)) + #:builder + (nerd-dictation-gexp "SOX" "WTYPE" + (this-package-input "bash-minimal") + (this-package-input "nerd-dictation")))) + (propagated-inputs (list sox wtype)))) (define-public python-brian2 (package -- 2.39.2 From unknown Tue Jun 17 22:21:13 2025 X-Loop: help-debbugs@gnu.org Subject: bug#62589: Help with patch with delayed evaluation Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 17 Apr 2023 15:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62589 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 62589@debbugs.gnu.org Received: via spool by 62589-submit@debbugs.gnu.org id=B62589.16817460896362 (code B ref 62589); Mon, 17 Apr 2023 15:42:01 +0000 Received: (at 62589) by debbugs.gnu.org; 17 Apr 2023 15:41:29 +0000 Received: from localhost ([127.0.0.1]:55859 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1poQyv-0001eX-5Y for submit@debbugs.gnu.org; Mon, 17 Apr 2023 11:41:29 -0400 Received: from 18.mo581.mail-out.ovh.net ([188.165.56.163]:37831) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1poQys-0001eG-W3 for 62589@debbugs.gnu.org; Mon, 17 Apr 2023 11:41:28 -0400 Received: from director7.ghost.mail-out.ovh.net (unknown [10.109.138.153]) by mo581.mail-out.ovh.net (Postfix) with ESMTP id A154D1FF96 for <62589@debbugs.gnu.org>; Mon, 17 Apr 2023 15:41:25 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-xchgc (unknown [10.110.171.76]) by director7.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 0F4CA1FE98; Mon, 17 Apr 2023 15:41:25 +0000 (UTC) Received: from ngraves.fr ([37.59.142.96]) by ghost-submission-6684bf9d7b-xchgc with ESMTPSA id rpHXAKVoPWT0QwEAeUbp3Q (envelope-from ); Mon, 17 Apr 2023 15:41:25 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-96R001caf36ca4-30a8-4100-8fe2-272bd2ef250c, 36ECB2DEF893FB8679C45D4CF8D311E154C16286) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 81.67.140.142 From: Nicolas Graves In-Reply-To: <87zg7rgaln.fsf_-_@gnu.org> References: <87ilefgbza.fsf@ngraves.fr> <20230401100509.24723-1-ngraves@ngraves.fr> <87zg7rgaln.fsf_-_@gnu.org> Date: Mon, 17 Apr 2023 17:41:24 +0200 Message-ID: <87wn2att23.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: text/plain X-Ovh-Tracer-Id: 7540433151789818444 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeliedgleduucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvvefujghffffkgggtsehttdertddttddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepveekleeujedthefgffekleekhffhffetgfdvheekleeuhfehueeljedtjefhvdfgnecukfhppeduvdejrddtrddtrddupdekuddrieejrddugedtrddugedvpdefjedrheelrddugedvrdelieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepiedvheekleesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekuddpmhhouggvpehsmhhtphhouhht X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hey Ludo, I've managed to do what I wanted here, just a little reminder if you can review this ;) -- Best regards, Nicolas Graves From unknown Tue Jun 17 22:21:13 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Nicolas Graves Subject: bug#62589: closed (Re: bug#62589: Help with patch with delayed evaluation) Message-ID: References: <87jzy10zpo.fsf_-_@gnu.org> <87ilefgbza.fsf@ngraves.fr> X-Gnu-PR-Message: they-closed 62589 X-Gnu-PR-Package: guix Reply-To: 62589@debbugs.gnu.org Date: Mon, 24 Apr 2023 20:54:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1682369642-3593-1" This is a multi-part message in MIME format... ------------=_1682369642-3593-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #62589: Help with patch with delayed evaluation which was filed against the guix package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 62589@debbugs.gnu.org. --=20 62589: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D62589 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1682369642-3593-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 62589-done) by debbugs.gnu.org; 24 Apr 2023 20:53:19 +0000 Received: from localhost ([127.0.0.1]:50453 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pr3BX-0000us-4J for submit@debbugs.gnu.org; Mon, 24 Apr 2023 16:53:19 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46988) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pr3BV-0000ug-Jr for 62589-done@debbugs.gnu.org; Mon, 24 Apr 2023 16:53:18 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pr3BO-0004sS-W4; Mon, 24 Apr 2023 16:53:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:In-Reply-To:Date:References:Subject:To: From; bh=Gy2pzpYX89rQAK5F6T0Wh3C84sYT/EGmIFPBWB0dAlE=; b=BgMGVpSd+4PtJ3tF5hyf HwGwZlup0p1PzwWs16vuKnkjvrcavFWhiBBpA6qBwi1WqC9xN03pGnkC8C+Ud7SCFZkAVa5EPLf0Y TbfJE1W9XghJuWQ28DHXdI0ZHSRaLrK1WabVHarNPlmGLC3NQ/wsPTj7w+5g7AXurXxzNjPeF31kH v2CaRz8/4+8PfXhusLq+XghrjALS/I5RaM2WuV6qvptVKmIugHjfUSMn/UvkkQy24fHODMaRWdQue FgnfO3IusYva4jXuotMG8JCSw1uG/5WysKpWiMhCvcKB6wGnGNYWgJKnt+ERuDviwnyHSDBWJZq54 qoeynS/6g+h8DQ==; Received: from 91-160-117-201.subs.proxad.net ([91.160.117.201] helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pr3BO-0004DU-7o; Mon, 24 Apr 2023 16:53:10 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Nicolas Graves Subject: Re: bug#62589: Help with patch with delayed evaluation References: <87ilefgbza.fsf@ngraves.fr> <20230401173239.26588-1-ngraves@ngraves.fr> Date: Mon, 24 Apr 2023 22:53:07 +0200 In-Reply-To: <20230401173239.26588-1-ngraves@ngraves.fr> (Nicolas Graves's message of "Sat, 1 Apr 2023 19:32:39 +0200") Message-ID: <87jzy10zpo.fsf_-_@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62589-done Cc: 62589-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Nicolas, Nicolas Graves skribis: > * gnu/packages/machine-learning.scm (nerd-dictation): > Avoid inputs pulseaudio and ydotool when not necessary. > Factor out wrapper make-nerd-dictation-package. > Add package variants : > - nerd-dictation/xdotool > - nerd-dictation/sox-xdotool > - nerd-dictation/sox-ydotool > - nerd-dictation/sox-wtype > --- > gnu/packages/machine-learning.scm | 97 ++++++++++++++++++++++--------- > 1 file changed, 69 insertions(+), 28 deletions(-) Applied with the changes below (using =E2=80=98with-imported-modules=E2=80= =99 instead of passing #:modules, and #$output instead of the now-deprecated =E2=80=98%output=E2=80=99). I also tweaked the commit log according to our conventions. Thank you, Ludo=E2=80=99. --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 84b40e7b9b..c4dc668b82 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -3882,39 +3882,40 @@ (define-public nerd-dictation (license license:gpl2+)))) (define (nerd-dictation-gexp input-name output-name bash nerd-dictation) - #~(begin - (use-modules (guix build utils)) - (let* ((exe (string-append %output "/bin/nerd-dictation")) - (nerd-dictation-exe - #$(file-append nerd-dictation "/bin/nerd-dictation"))) - (mkdir-p (dirname exe)) - (call-with-output-file exe - (lambda (port) - (format port "#!~a + (with-imported-modules '((guix build utils)) + #~(begin + (use-modules (guix build utils)) + + (let* ((exe (string-append #$output "/bin/nerd-dictation")) + (nerd-dictation-exe + #$(file-append nerd-dictation "/bin/nerd-dictation"))) + (mkdir-p (dirname exe)) + (call-with-output-file exe + (lambda (port) + (format port "#!~a if [ \"$1\" = begin ] then exec ~a $@ --input=~a --simulate-input-tool=~a else exec ~a $@ fi" - #$(file-append bash "/bin/bash") - nerd-dictation-exe - #$input-name - #$output-name - nerd-dictation-exe))) - (chmod exe #o555)))) + #$(file-append bash "/bin/bash") + nerd-dictation-exe + #$input-name + #$output-name + nerd-dictation-exe))) + (chmod exe #o555))))) (define-public nerd-dictation/xdotool (package (inherit nerd-dictation) (name "nerd-dictation-xdotool") (build-system trivial-build-system) - (arguments (list - #:modules '((guix build utils)) - #:builder - (nerd-dictation-gexp "PAREC" "XDOTOOL" - (this-package-input "bash-minimal") - (this-package-input "nerd-dictation")))) + (arguments + (list #:builder + (nerd-dictation-gexp "PAREC" "XDOTOOL" + (this-package-input "bash-minimal") + (this-package-input "nerd-dictation")))) (inputs (list bash-minimal nerd-dictation)) (propagated-inputs (list pulseaudio xdotool)))) @@ -3922,36 +3923,33 @@ (define-public nerd-dictation/sox-xdotool (package (inherit nerd-dictation/xdotool) (name "nerd-dictation-sox-xdotool") - (arguments (list - #:modules '((guix build utils)) - #:builder - (nerd-dictation-gexp "SOX" "XDOTOOL" - (this-package-input "bash-minimal") - (this-package-input "nerd-dictation")))) + (arguments + (list #:builder + (nerd-dictation-gexp "SOX" "XDOTOOL" + (this-package-input "bash-minimal") + (this-package-input "nerd-dictation")))) (propagated-inputs (list sox xdotool)))) (define-public nerd-dictation/sox-ydotool (package (inherit nerd-dictation/xdotool) (name "nerd-dictation-sox-ydotool") - (arguments (list - #:modules '((guix build utils)) - #:builder - (nerd-dictation-gexp "SOX" "YDOTOOL" - (this-package-input "bash-minimal") - (this-package-input "nerd-dictation")))) + (arguments + (list #:builder + (nerd-dictation-gexp "SOX" "YDOTOOL" + (this-package-input "bash-minimal") + (this-package-input "nerd-dictation")))) (propagated-inputs (list sox ydotool)))) (define-public nerd-dictation/sox-wtype (package (inherit nerd-dictation/xdotool) (name "nerd-dictation-sox-wtype") - (arguments (list - #:modules '((guix build utils)) - #:builder - (nerd-dictation-gexp "SOX" "WTYPE" - (this-package-input "bash-minimal") - (this-package-input "nerd-dictation")))) + (arguments + (list #:builder + (nerd-dictation-gexp "SOX" "WTYPE" + (this-package-input "bash-minimal") + (this-package-input "nerd-dictation")))) (propagated-inputs (list sox wtype)))) (define-public python-brian2 --=-=-=-- ------------=_1682369642-3593-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 1 Apr 2023 09:59:04 +0000 Received: from localhost ([127.0.0.1]:35557 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piY0m-0001Fu-Dw for submit@debbugs.gnu.org; Sat, 01 Apr 2023 05:59:04 -0400 Received: from lists.gnu.org ([209.51.188.17]:55638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piY0l-0001Fl-5t for submit@debbugs.gnu.org; Sat, 01 Apr 2023 05:59:03 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piY0k-00033O-Nf for bug-guix@gnu.org; Sat, 01 Apr 2023 05:59:02 -0400 Received: from 7.mo561.mail-out.ovh.net ([46.105.57.200]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piY0j-0003tb-4Y for bug-guix@gnu.org; Sat, 01 Apr 2023 05:59:02 -0400 Received: from director2.ghost.mail-out.ovh.net (unknown [10.109.138.203]) by mo561.mail-out.ovh.net (Postfix) with ESMTP id 1660624F9D for ; Sat, 1 Apr 2023 09:58:50 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-8fdxs (unknown [10.110.171.251]) by director2.ghost.mail-out.ovh.net (Postfix) with ESMTPS id D31A91FD56 for ; Sat, 1 Apr 2023 09:58:49 +0000 (UTC) Received: from ngraves.fr ([37.59.142.95]) by ghost-submission-6684bf9d7b-8fdxs with ESMTPSA id rvnZMFkAKGRmfCEAHYa+Aw (envelope-from ) for ; Sat, 01 Apr 2023 09:58:49 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-95G001ead90377-0e50-4f15-ada8-25d1bb0470c8, 7C77ACBA02D1E582DC791C6A3247BB2D808E32EA) smtp.auth=ngraves@ngraves.fr X-OVh-ClientIp: 81.67.140.142 From: Nicolas Graves To: bug-guix@gnu.org Subject: Help with patch with delayed evaluation Date: Sat, 01 Apr 2023 11:58:49 +0200 Message-ID: <87ilefgbza.fsf@ngraves.fr> MIME-Version: 1.0 Content-Type: text/plain X-Ovh-Tracer-Id: 25332750240113328 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeifedgvddvucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvffufffkgggtsehttdertddttddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepueejleeileejfffhleetjedtleejheevudffleevgfdufeekhefgvddvveegveefnecukfhppeduvdejrddtrddtrddupdekuddrieejrddugedtrddugedvpdefjedrheelrddugedvrdelheenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepsghughdqghhuihigsehgnhhurdhorhhgpdfovfetjfhoshhtpehmohehiedupdhmohguvgepshhmthhpohhuth Received-SPF: pass client-ip=46.105.57.200; envelope-from=ngraves@ngraves.fr; helo=7.mo561.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hi Guix! I'm struggling with the definition of the variants of the nerd-dictation package. I'm sending a commit here. I get the following error messages: sox/wtype: unbound variable while (gnu packages audio) and (gnu packages freedesktop) are indeed imported. Originally, I wasn't using delayed evaluation, but I thought it might help, but it doesn't. I've tried to rebuild my local installation totally (make clean-go, make clean, then bootstrap from there), but it doesn't work better. Thanks if you can help! -- Best regards, Nicolas Graves ------------=_1682369642-3593-1--