GNU bug report logs - #58528
[PATCH] gnu: Services: Add espeakup service.

Previous Next

Package: guix-patches;

Reported by: hunter.t.joz <at> gmail.com

Date: Fri, 14 Oct 2022 20:10:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 58528 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#58528; Package guix-patches. (Fri, 14 Oct 2022 20:10:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to hunter.t.joz <at> gmail.com:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Fri, 14 Oct 2022 20:10:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: hunter.t.joz <at> gmail.com
To: guix-patches <at> gnu.org
Cc: Hunter Jozwiak <hunter.t.joz <at> gmail.com>
Subject: [PATCH] gnu: Services: Add espeakup service.
Date: Fri, 14 Oct 2022 13:09:14 -0700
From: Hunter Jozwiak <hunter.t.joz <at> gmail.com>

* gnu/services/accessibility.scm: add espeakup-configuration,
espeakup-shepherd-service, and espeakup-service-type.
* doc/guix.texi (Accessibility Services): Document the espeakup configuration.
---
 doc/guix.texi                  | 19 ++++++++++++
 gnu/services/accessibility.scm | 56 ++++++++++++++++++++++++++++++++++
 2 files changed, 75 insertions(+)
 create mode 100644 gnu/services/accessibility.scm

diff --git a/doc/guix.texi b/doc/guix.texi
index dbf4ca9be9..73dc647ca5 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -17572,6 +17572,7 @@ Services

 @menu
 * Base Services::               Essential system services.
+* Accessibility Services:: For those with various impairments.
 * Scheduled Job Execution::     The mcron service.
 * Log Rotation::                The rottlog service.
 * Networking Setup::            Setting up network interfaces.
@@ -18793,6 +18794,24 @@ Base Services
               (local-file "sway-greetd.conf"))))))))
 @end lisp
 @end deftp
+@node Accessibility Services
+@subsection Accessibility Services
+%espeakup-configuration
+@c %start of fragment
+
+@deftp {Data Type} espeakup-configuration
+Available @code{espeakup-configuration} fields are:
+
+@table @asis
+@item @code{default-voice} (default: @code{"en-US"}) (type: string)
+Set the voice that espeak-ng should use by default.
+
+@end table
+
+@end deftp
+
+
+@c %end of fragment

 @node Scheduled Job Execution
 @subsection Scheduled Job Execution
diff --git a/gnu/services/accessibility.scm b/gnu/services/accessibility.scm
new file mode 100644
index 0000000000..5dc8825bec
--- /dev/null
+++ b/gnu/services/accessibility.scm
@@ -0,0 +1,56 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2022 Hunter Jozwiak <hunter.t.joz <at> gmail.com>
+
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu services accessibility)
+  #:use-module (gnu packages accessibility)
+  #:use-module (gnu services)
+  #:use-module (gnu services configuration)
+  #:use-module (gnu services linux)
+  #:use-module (gnu services shepherd)
+  #:use-module (guix gexp)
+  #:use-module (guix records)
+  #:export (espeakup-configuration espeakup-service-type))
+
+;; Espeakup service
+(define-configuration/no-serialization espeakup-configuration
+                                       (default-voice (string "en-US")
+                                        "Set the voice that espeak-ng
should use by default."))
+
+(define (espeakup-shepherd-service config)
+  (list (shepherd-service (provision '(espeakup))
+                          (documentation "The espeak-ng bridge to speakup.")
+                          (requirement '(user-processes))
+                          (start #~(make-forkexec-constructor (list
(string-append #$espeakup
+
"/bin/espeakup"
+                                                                     "-v"
+
#$(espeakup-configuration-default-voice
+
  config)))))
+                          (stop #~(make-kill-destructor)))))
+
+(define espeakup-service-type
+  (service-type (name 'espeakup)
+                (description
+                 "A lightweight connector between espeak and speakup.")
+                (extensions (list (service-extension
+                                   shepherd-root-service-type
+                                   espeakup-shepherd-service)
+                                  (service-extension
+                                   kernel-module-loader-service-type
+                                   (const (list "speakup_soft")))))
+                (default-value (espeakup-configuration))))
-- 
2.38.0




Information forwarded to guix-patches <at> gnu.org:
bug#58528; Package guix-patches. (Fri, 14 Oct 2022 20:27:02 GMT) Full text and rfc822 format available.

Message #8 received at 58528 <at> debbugs.gnu.org (full text, mbox):

From: "(" <paren <at> disroot.org>
To: <hunter.t.joz <at> gmail.com>, <58528 <at> debbugs.gnu.org>
Subject: Re: [bug#58528] [PATCH] gnu: Services: Add espeakup service.
Date: Fri, 14 Oct 2022 21:26:24 +0100
Heya,

On Fri Oct 14, 2022 at 9:09 PM BST,  wrote:
> diff --git a/doc/guix.texi b/doc/guix.texi
> index dbf4ca9be9..73dc647ca5 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -17572,6 +17572,7 @@ Services
>
>  @menu
>  * Base Services::               Essential system services.
> +* Accessibility Services:: For those with various impairments.
>  * Scheduled Job Execution::     The mcron service.
>  * Log Rotation::                The rottlog service.
>  * Networking Setup::            Setting up network interfaces.
> @@ -18793,6 +18794,24 @@ Base Services
>                (local-file "sway-greetd.conf"))))))))
>  @end lisp
>  @end deftp
> +@node Accessibility Services
> +@subsection Accessibility Services
> +%espeakup-configuration
> +@c %start of fragment
> +
> +@deftp {Data Type} espeakup-configuration
> +Available @code{espeakup-configuration} fields are:
> +
> +@table @asis
> +@item @code{default-voice} (default: @code{"en-US"}) (type: string)
> +Set the voice that espeak-ng should use by default.
> +
> +@end table
> +
> +@end deftp
> +
> +
> +@c %end of fragment

Remember to add your copyright notice to the manual's copyright section.

> + (define-module (gnu services accessibility)

Since this is a new file, you'll need to update ``gnu/local.mk'' accordingly.

> +

Remove this empty line after the ``;;; Copyright ...'' line.

> +  #:export (espeakup-configuration espeakup-service-type))

You should probably put each variable here on a new line.

> +
> +;; Espeakup service

Instead of this, do this:

  ^L
  ;;;
  ;;; Espeakup.
  ;;;

The ^L is a control character, not a literal ``^L''. Look at one of the other
files and copy their ^L in. Also, add another newline after this "section
comment".

> +(define-configuration/no-serialization espeakup-configuration
> +                                       (default-voice (string "en-US")
> +                                        "Set the voice that espeak-ng
> should use by default."))

Funky indentation here, and there needs to be a field for customizing the
``espeakup'' package to use. Should be:

  (define-configuration/no-serialization espeakup-configuration
    (espeakup
     (file-like espeakup)
     "Set the package providing the @code{/bin/espeakup} command.")
    (default-voice
     (string "en-US")
     "Set the voice that espeak-ng should use by default."))

> +(define (espeakup-shepherd-service config)
> +  (list (shepherd-service (provision '(espeakup))
> +                          (documentation "The espeak-ng bridge to speakup.")
> +                          (requirement '(user-processes))
> +                          (start #~(make-forkexec-constructor (list
> (string-append #$espeakup
> +
> "/bin/espeakup"
> +                                                                     "-v"
> +
> #$(espeakup-configuration-default-voice
> +
>   config)))))
> +                          (stop #~(make-kill-destructor)))))

Again, indentation is off here, and there's a small issue with ``string-append''
being used where ``file-append'' should be. Try this instead:

  (define (espeakup-shepherd-service config)
    (list (shepherd-service
           (provision '(espeakup))
           (requirement '(user-processes))
           (documentation "Run espeakup, the espeak-ng bridge to speakup.")
           (start
            #~(make-forkexec-constructor
               (list #$(file-append (espeakup-configuration-espeakup config)
                                    "/bin/espeakup")
                     "-v" #$(espeakup-configuration-default-voice config))))
           (stop #~(make-kill-destructor)))))

> +(define espeakup-service-type
> +  (service-type (name 'espeakup)
> +                (description
> +                 "A lightweight connector between espeak and speakup.")
> +                (extensions (list (service-extension
> +                                   shepherd-root-service-type
> +                                   espeakup-shepherd-service)
> +                                  (service-extension
> +                                   kernel-module-loader-service-type
> +                                   (const (list "speakup_soft")))))
> +                (default-value (espeakup-configuration))))

Here too; try this:

  (define espeakup-service-type
    (service-type
     (name 'espeakup)
     (extensions
      (list (service-extension shepherd-root-service-type
                               espeakup-shepherd-services)
            (service-extension kernel-module-loader-service-type
                               (const (list "speakup_soft")))))
     (default-value (espeakup-configuration))
     (description
      "Configure and run espeakup, a lightweight bridge between espeak-ng
  and speakup.")))

    -- (




Information forwarded to guix-patches <at> gnu.org:
bug#58528; Package guix-patches. (Sat, 15 Oct 2022 15:11:01 GMT) Full text and rfc822 format available.

Message #11 received at 58528 <at> debbugs.gnu.org (full text, mbox):

From: Hunter Jozwiak <hunter.t.joz <at> gmail.com>
To: 58528 <at> debbugs.gnu.org
Subject: Re: [bug#58528] [PATCH] gnu: Services: Add espeakup service.
Date: Sat, 15 Oct 2022 08:09:48 -0700
[Message part 1 (text/plain, inline)]
"(" <paren <at> disroot.org> writes:

Heya,
>
> On Fri Oct 14, 2022 at 9:09 PM BST, wrote:
>>
>> diff –git a/doc/guix.texi b/doc/guix.texi index dbf4ca9be9..73dc647ca5
>> 100644 — a/doc/guix.texi + b/doc/guix.texi @@ -17572,6 +17572,7 @@
>> Services
>>
>> @menu * Base Services:: Essential system services. +* Accessibility
>> Services:: For those with various impairments. * Scheduled Job Execution::
>> The mcron service. * Log Rotation:: The rottlog service. * Networking
>> Setup:: Setting up network interfaces. @@ -18793,6 +18794,24 @@ Base
>> Services (local-file "sway-greetd.conf")))))))) @end lisp @end deftp +@node
>> Accessibility Services +@subsection Accessibility Services
>> +%espeakup-configuration +@c %start of fragment + +@deftp {Data Type}
>> espeakup-configuration +Available @code{espeakup-configuration} fields are:
>> + +@table @asis +@item @code{default-voice} (default: @code{"en-US"})
>> (type: string) +Set the voice that espeak-ng should use by default. + +@end
>> table + +@end deftp + + +@c %end of fragment
>>
>
> Remember to add your copyright notice to the manual's copyright section.
>
> + (define-module (gnu services accessibility)
>>
>
> Since this is a new file, you'll need to update ``gnu/local.mk''
> accordingly.
>
> +
>>
>
> Remove this empty line after the ``;;; Copyright …'' line.
>
> + #:export (espeakup-configuration espeakup-service-type))
>>
>
> You should probably put each variable here on a new line.
>
> + +;; Espeakup service
>>
>
> Instead of this, do this:
>
> ^L ;;; ;;; Espeakup. ;;;
>
> The ^L is a control character, not a literal ``L''. Look at one of the
> other files and copy their ^L in. Also, add another newline after this
> "section comment".
>
> +(define-configuration/no-serialization espeakup-configuration +
>> (default-voice (string "en-US") + "Set the voice that espeak-ng should use
>> by default."))
>>
>
> Funky indentation here, and there needs to be a field for customizing the
> ``espeakup'' package to use. Should be:
>
> (define-configuration/no-serialization espeakup-configuration (espeakup
> (file-like espeakup) "Set the package providing the @code{/bin/espeakup}
> command.") (default-voice (string "en-US") "Set the voice that espeak-ng
> should use by default."))
>
> +(define (espeakup-shepherd-service config) + (list (shepherd-service
>> (provision '(espeakup)) + (documentation "The espeak-ng bridge to
>> speakup.") + (requirement '(user-processes)) + (start
>> #~(make-forkexec-constructor (list (string-append #[image: $espeakup
>> </div></blockquote> </div></blockquote> &gt;&gt; + &gt;&gt; /bin/espeakup
>> &gt;&gt; + -v &gt;&gt; + &gt;&gt; #$](espeakup-configuration-default-voice
>>
>>>
>>> + config))))) + (stop #~(make-kill-destructor)))))
>>>>
>>>
>>> Again, indentation is off here, and there's a small issue with
>>> ``string-append'' being used where ``file-append'' should be. Try this
>>> instead:
>>>
>>> (define (espeakup-shepherd-service config) (list (shepherd-service
>>> (provision '(espeakup)) (requirement '(user-processes)) (documentation "Run
>>> espeakup, the espeak-ng bridge to speakup.") (start
>>> #~(make-forkexec-constructor (list #[image: $(file-append
>>> (espeakup-configuration-espeakup config) </div></blockquote> &gt;
>>> /bin/espeakup) &gt; -v #$](espeakup-configuration-default-voice
>>> config))))
>>>>
>>>> (stop #~(make-kill-destructor)))))
>>>>
>>>> +(define espeakup-service-type + (service-type (name 'espeakup) +
>>>>> (description + "A lightweight connector between espeak and speakup.") +
>>>>> (extensions (list (service-extension + shepherd-root-service-type +
>>>>> espeakup-shepherd-service) + (service-extension +
>>>>> kernel-module-loader-service-type + (const (list "speakupsoft"))))) +
>>>>> (default-value (espeakup-configuration))))
>>>>>
>>>>
>>>> Here too; try this:
>>>>
>>>> (define espeakup-service-type (service-type (name 'espeakup)
>>>> (extensions (list (service-extension shepherd-root-service-type
>>>> espeakup-shepherd-services) (service-extension
>>>> kernel-module-loader-service-type (const (list "speakupsoft")))))
>>>> (default-value (espeakup-configuration)) (description "Configure and run
>>>> espeakup, a lightweight bridge between espeak-ng and speakup.")))
>>>>
>>>> – (
>>>>
>>>
[Message part 2 (text/html, inline)]
[latex7ezZw7_c33bbf7a7a43b28f162b022d63aa0d64f464bc5d.png (image/png, inline)]
[latexerQpGS_08c27eb846d1419fba7684e67bdeaef54e607f6f.png (image/png, inline)]
[0001-gnu-Services-Add-espeakup-service.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, attachment)]

This bug report was last modified 1 year and 192 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.