bug-guix
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#62589: Help with patch with delayed evaluation


From: Ludovic Courtès
Subject: bug#62589: Help with patch with delayed evaluation
Date: Mon, 24 Apr 2023 22:53:07 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

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’.

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 via email to

[Prev in Thread] Current Thread [Next in Thread]