all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Ludovic Courtès" <ludo@gnu.org>
To: Nicolas Graves <ngraves@ngraves.fr>
Cc: 62589-done@debbugs.gnu.org
Subject: bug#62589: Help with patch with delayed evaluation
Date: Mon, 24 Apr 2023 22:53:07 +0200	[thread overview]
Message-ID: <87jzy10zpo.fsf_-_@gnu.org> (raw)
In-Reply-To: <20230401173239.26588-1-ngraves@ngraves.fr> (Nicolas Graves's message of "Sat, 1 Apr 2023 19:32:39 +0200")

[-- Attachment #1: Type: text/plain, Size: 763 bytes --]

Hi Nicolas,

Nicolas Graves <ngraves@ngraves.fr> 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 ‘with-imported-modules’ instead of
passing #:modules, and #$output instead of the now-deprecated
‘%output’).

I also tweaked the commit log according to our conventions.

Thank you,
Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 4725 bytes --]

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

      reply	other threads:[~2023-04-24 20:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-01  9:58 bug#62589: Help with patch with delayed evaluation Nicolas Graves via Bug reports for GNU Guix
2023-04-01 10:05 ` bug#62589: [PATCH] gnu: nerd-dictation: Factor out wrapper. Add package variants Nicolas Graves via Bug reports for GNU Guix
2023-04-01 10:28   ` bug#62589: Help with patch with delayed evaluation Ludovic Courtès
2023-04-01 10:58     ` Nicolas Graves via Bug reports for GNU Guix
2023-04-01 15:27       ` Nicolas Graves via Bug reports for GNU Guix
2023-04-17 15:41     ` Nicolas Graves via Bug reports for GNU Guix
2023-04-01 17:32 ` bug#62589: [PATCH] gnu: nerd-dictation: Factor out wrapper. Add package variants Nicolas Graves via Bug reports for GNU Guix
2023-04-24 20:53   ` Ludovic Courtès [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87jzy10zpo.fsf_-_@gnu.org \
    --to=ludo@gnu.org \
    --cc=62589-done@debbugs.gnu.org \
    --cc=ngraves@ngraves.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.