diff options
author | Nicolas Graves <ngraves@ngraves.fr> | 2022-09-29 11:02:03 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2022-10-17 09:47:51 +0200 |
commit | d5b54e0137933f891065abf202a0d932f96653ee (patch) | |
tree | 33f203af9a6a3032f1f2d2c62ea187f35c03ed29 /gnu/packages/machine-learning.scm | |
parent | eecb288ca2a3c9c8c540370a63f7101ed155b32a (diff) | |
download | guix-d5b54e0137933f891065abf202a0d932f96653ee.tar guix-d5b54e0137933f891065abf202a0d932f96653ee.tar.gz |
gnu: Add nerd-dictation/wayland.
* gnu/packages/machine-learning.scm (nerd-dictation/wayland): New variable.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/packages/machine-learning.scm')
-rw-r--r-- | gnu/packages/machine-learning.scm | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index f2c9b8dace..c0d6ccfd19 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -45,6 +45,7 @@ #:use-module (guix build-system ocaml) #:use-module (guix build-system python) #:use-module (guix build-system r) + #:use-module (guix build-system trivial) #:use-module (guix git-download) #:use-module (gnu packages) #:use-module (gnu packages adns) @@ -103,6 +104,7 @@ #:use-module (gnu packages video) #:use-module (gnu packages web) #:use-module (gnu packages xml) + #:use-module (gnu packages xdisorg) #:use-module (gnu packages xorg) #:use-module (ice-9 match)) @@ -3636,3 +3638,36 @@ operations. It has zero overhead, as this relies on manual activation and there are no background processes. Dictation is accessed manually with @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 +if [ \"$1\" = begin ] + then + exec ~a $@ --input=SOX --simulate-input-tool=YDOTOOL + else + exec ~a $@ +fi" + bash-exe + original-exe + original-exe))) + (chmod exe #o555))))))) |