unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#61236: ibus-speech-to-text engine fails to run (?)
@ 2023-02-02 19:46 Luis Felipe via Bug reports for GNU Guix
  2023-02-03  7:14 ` Liliana Marie Prikler
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Luis Felipe via Bug reports for GNU Guix @ 2023-02-02 19:46 UTC (permalink / raw)
  To: 61236


[-- Attachment #1.1: Type: text/plain, Size: 3423 bytes --]

I can add `ibus-speech-to-text` (aka IBus STT) to my input methods, and set it up, but once selected for input, it doesn't work.


## STEPS TO REPRODUCE

1. `guix install ibus ibus-speech-to-text`
2. In GNOME Settings → Keyboard, add IBus STT to the list of input methods (it is displayed as `Other (Speech To Text)`)
3. In IBus STT Settings → General:

    + Preload models: ON
    + Active on start: ON
    + System locale: OFF
    + Locales: Select the lightweight model for English (USA)

4. In the desktop, start an app and place the text cursor in a text field (tried on IceCat, Ungoogled Chromium, GNOME Text Editor, GNOME Shell)
5. Switch to IBus STT input method using Super+Space (give it about 1 second to load).
6. Dictate to the machine.


## EXPECTED RESULT

Text is typed magically as you speak in the text field selected in step 4.


## UNEXPECTED RESULT

No text is added to the text field I selected in step 4.


## SYSTEM INFORMATION

~~~
OS: Guix System x86_64 fb3085e
Kernel: 6.1.5-gnu 

DE: GNOME 42.4 (tried on Wayland and Xorg)
ibus: 1.5.27
ibus-speech-to-text: 0.4.0
~~~


## ADDITIONAL INFORMATION

Could it be that the speech-to-text engine is failing to run because it can't find the GTK 4.0 namespace through Gobject Introspection. For example, after being pointed to the following command by IBus STT developer (https://github.com/PhilippeRo/IBus-Speech-To-Text/discussions/7) I see the following error:

~~~
$ /gnu/store/HASH-ibus-speech-to-text-0.4.0/libexec/ibus-engine-stt --gapplication-replace -g
Traceback (most recent call last):
  File "/gnu/store/87dgkps8sp1jb4z2w4m1dnp0zvnq050l-ibus-speech-to-text-0.4.0/share/ibus-stt/main.py", line 38, in <module>
    from sttenginefactory import STTEngineFactory
  File "/gnu/store/87dgkps8sp1jb4z2w4m1dnp0zvnq050l-ibus-speech-to-text-0.4.0/share/ibus-stt/sttenginefactory.py", line 26, in <module>
    from sttengine import STTEngine
  File "/gnu/store/87dgkps8sp1jb4z2w4m1dnp0zvnq050l-ibus-speech-to-text-0.4.0/share/ibus-stt/sttengine.py", line 29, in <module>
    gi.require_version('Gtk', '4.0')
  File "/gnu/store/5ijhwr127smgxrp5dls7dxnr9jwa4m8p-python-pygobject-3.40.1/lib/python3.9/site-packages/gi/__init__.py", line 129, in require_version
    raise ValueError('Namespace %s not available for version %s' %
ValueError: Namespace Gtk not available for version 4.0
~~~

In the command above, HASH is the hash corresponding to `ibus-speech-to-text-0.4.0` in my user profile.


## WORKAROUND

The input method works after making sure `gtk` and `python-pygobject` are in the environment where `ibus-engine-stt` is run:

1. Start an augmented shell:

   guix shell ibus-speech-to-text gtk python-pygobject

2. Run `ibus-engine-stt` as follows (where HASH is the hash for ibus-speech-to-text-0.4.0 in the profile created for the shell in step one):

   /gnu/store/HASH-ibus-speech-to-text-0.4.0/libexec/ibus-engine-stt --gapplication-replace -g

After this, you should see INFO and DEBUG information printed out. You can now launch an application, place the caret in any text box, switch to speech-to-text input method, and start dictating to the machine. Selecting other languages in "IBus STT settings → General → Locale" also work (I tried dictating in English, Japanese and Spanish).



---
Luis Felipe López Acevedo
https://luis-felipe.gitlab.io/

[-- Attachment #1.2: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc --]
[-- Type: application/pgp-keys, Size: 1722 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 509 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#61236: ibus-speech-to-text engine fails to run (?)
  2023-02-02 19:46 bug#61236: ibus-speech-to-text engine fails to run (?) Luis Felipe via Bug reports for GNU Guix
@ 2023-02-03  7:14 ` Liliana Marie Prikler
  2023-02-03 17:07   ` Luis Felipe via Bug reports for GNU Guix
  2023-02-09 19:38 ` bug#61236: [PATCH v1] gnu: ibus-speech-to-text: Fix execution of ibus-engine-stt sirgazil--- via Bug reports for GNU Guix
  2023-02-10 18:49 ` bug#61236: [PATCH v2 1/2] " sirgazil--- via Bug reports for GNU Guix
  2 siblings, 1 reply; 11+ messages in thread
From: Liliana Marie Prikler @ 2023-02-03  7:14 UTC (permalink / raw)
  To: Luis Felipe, 61236

Am Donnerstag, dem 02.02.2023 um 19:46 +0000 schrieb Luis Felipe:
> Could it be that the speech-to-text engine is failing to run because
> it can't find the GTK 4.0 namespace through Gobject Introspection.
> For example, after being pointed to the following command by IBus STT
> developer
> (https://github.com/PhilippeRo/IBus-Speech-To-Text/discussions/7) I
> see the following error:
> 
> ~~~
> $ /gnu/store/HASH-ibus-speech-to-text-0.4.0/libexec/ibus-engine-stt -
> -gapplication-replace -g
> Traceback (most recent call last):
>   File "/gnu/store/87dgkps8sp1jb4z2w4m1dnp0zvnq050l-ibus-speech-to-
> text-0.4.0/share/ibus-stt/main.py", line 38, in <module>
>     from sttenginefactory import STTEngineFactory
>   File "/gnu/store/87dgkps8sp1jb4z2w4m1dnp0zvnq050l-ibus-speech-to-
> text-0.4.0/share/ibus-stt/sttenginefactory.py", line 26, in <module>
>     from sttengine import STTEngine
>   File "/gnu/store/87dgkps8sp1jb4z2w4m1dnp0zvnq050l-ibus-speech-to-
> text-0.4.0/share/ibus-stt/sttengine.py", line 29, in <module>
>     gi.require_version('Gtk', '4.0')
>   File "/gnu/store/5ijhwr127smgxrp5dls7dxnr9jwa4m8p-python-pygobject-
> 3.40.1/lib/python3.9/site-packages/gi/__init__.py", line 129, in
> require_version
>     raise ValueError('Namespace %s not available for version %s' %
> ValueError: Namespace Gtk not available for version 4.0
> ~~~
> 
> In the command above, HASH is the hash corresponding to `ibus-speech-
> to-text-0.4.0` in my user profile.
> 
> 
> ## WORKAROUND
> 
> The input method works after making sure `gtk` and `python-pygobject`
> are in the environment where `ibus-engine-stt` is run:
> 
> 1. Start an augmented shell:
> 
>    guix shell ibus-speech-to-text gtk python-pygobject
> 
> 2. Run `ibus-engine-stt` as follows (where HASH is the hash for ibus-
> speech-to-text-0.4.0 in the profile created for the shell in step
> one):
> 
>    /gnu/store/HASH-ibus-speech-to-text-0.4.0/libexec/ibus-engine-stt
> --gapplication-replace -g
> 
> After this, you should see INFO and DEBUG information printed out.
> You can now launch an application, place the caret in any text box,
> switch to speech-to-text input method, and start dictating to the
> machine. Selecting other languages in "IBus STT settings → General →
> Locale" also work (I tried dictating in English, Japanese and
> Spanish).
Since this workaround works for you, I am fairly certain that the
package is simply missing a wrapper for GI_TYPELIB_PATH.  IMHO we
should more generally add some code to handle that in glib-or-gtk-
build-system, but that'd be a core-updates change.

Cheers




^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#61236: ibus-speech-to-text engine fails to run (?)
  2023-02-03  7:14 ` Liliana Marie Prikler
@ 2023-02-03 17:07   ` Luis Felipe via Bug reports for GNU Guix
  2023-02-07 16:41     ` Luis Felipe via Bug reports for GNU Guix
  0 siblings, 1 reply; 11+ messages in thread
From: Luis Felipe via Bug reports for GNU Guix @ 2023-02-03 17:07 UTC (permalink / raw)
  To: Liliana Marie Prikler; +Cc: 61236


[-- Attachment #1.1: Type: text/plain, Size: 705 bytes --]

On Friday, February 3rd, 2023 at 07:14, Liliana Marie Prikler <liliana.prikler@ist.tugraz.at> wrote:

> Am Donnerstag, dem 02.02.2023 um 19:46 +0000 schrieb Luis F
> 

> Since this workaround works for you, I am fairly certain that the
> package is simply missing a wrapper for GI_TYPELIB_PATH. IMHO we
> should more generally add some code to handle that in glib-or-gtk-
> build-system, but that'd be a core-updates change.

The funny thing is that the package already wraps programs and augment GI_TYPELIB_PATH. Although I don't understand why ibus' "/lib/girepository-1.0" is also added to GUIX_PYTHONPATH.

Now, that the build system could handle all this in the future sounds great to me.

[-- Attachment #1.2: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc --]
[-- Type: application/pgp-keys, Size: 1722 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 509 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#61236: ibus-speech-to-text engine fails to run (?)
  2023-02-03 17:07   ` Luis Felipe via Bug reports for GNU Guix
@ 2023-02-07 16:41     ` Luis Felipe via Bug reports for GNU Guix
  2023-02-08  7:32       ` Liliana Marie Prikler
  0 siblings, 1 reply; 11+ messages in thread
From: Luis Felipe via Bug reports for GNU Guix @ 2023-02-07 16:41 UTC (permalink / raw)
  To: Liliana Marie Prikler; +Cc: 61236


[-- Attachment #1.1: Type: text/plain, Size: 1032 bytes --]

Hi,

The attached patch fixed the issue for me. Now ibus-engine-stt seems to be running correctly and I can switch to the input method without the workaround indicated in the initial report.

I noticed that there are some lint issues from the original package definition though. I didn't fixed those:

$ ./pre-inst-env guix lint ibus-speech-to-text
/home/yo/guix/gnu/packages/ibus.scm:899:5: ibus-speech-to-text@0.4.0: 

[1] 'desktop-file-utils' should probably be a native input

/home/yo/guix/gnu/packages/ibus.scm:899:5: ibus-speech-to-text@0.4.0: 

[2] 'glib:bin' should probably be a native input

/home/yo/guix/gnu/packages/ibus.scm:899:5: ibus-speech-to-text@0.4.0: 

[3] 'gobject-introspection' should probably be a native input

/home/yo/guix/gnu/packages/ibus.scm:899:5: ibus-speech-to-text@0.4.0: 

[4] label 'glib' does not match package name 'glib:bin'

/home/yo/guix/gnu/packages/ibus.scm:856:2: ibus-speech-to-text@0.4.0: 

[5] "bash-minimal" should be in 'inputs' when 'wrap-program' is used

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-gnu-ibus-speech-to-text-Fix-execution-of-ibus-engine.patch --]
[-- Type: text/x-patch; filename="0001-gnu-ibus-speech-to-text-Fix-execution-of-ibus-engine.patch"; name="0001-gnu-ibus-speech-to-text-Fix-execution-of-ibus-engine.patch", Size: 2900 bytes --]

From 2348c2290966e6480897f89e0ca6fdc555b6d41f Mon Sep 17 00:00:00 2001
From: Luis Felipe <luis.felipe.la@protonmail.com>
Date: Tue, 7 Feb 2023 10:49:31 -0500
Subject: [PATCH] gnu: ibus-speech-to-text: Fix execution of ibus-engine-stt.

Fixes <https://issues.guix.gnu.org/61236>.

* gnu/packages/ibus.scm (ibus-speech-to-text)[phases]: Remove path to
ibus-stt directory from GI_TYPELIB_PATH, since it doesn't provide
typelibs. Remove path to ibus' typelibs directory from
GUIX_PYTHONPATH, since it doesn't provide Python modules. Remove
unnecessary delimiters from all environment variables.
---
 gnu/packages/ibus.scm | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index 4c45671acc..b1f573a875 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2021 Songlin Jiang <hollowman@hollowman.ml>
 ;;; Copyright © 2021 Taiju HIGASHI <higashi@taiju.info>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2023 Luis Felipe López Acevedo <luis.felipe.la@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -882,21 +883,16 @@ (define-public ibus-speech-to-text
              (let ((out (assoc-ref outputs "out")))
                (for-each (lambda (prog)
                            (wrap-program prog
-                             `("GST_PLUGIN_PATH" ":" prefix
+                             `("GST_PLUGIN_PATH" prefix
                                (,(string-append (assoc-ref inputs "gst-vosk")
                                                 "/lib/gstreamer-1.0")
                                 ,(getenv "GST_PLUGIN_SYSTEM_PATH")))
-                             `("GUIX_PYTHONPATH" ":" prefix
+                             `("GUIX_PYTHONPATH" prefix
                                (,(getenv "GUIX_PYTHONPATH")
-                                ,(string-append (assoc-ref inputs "ibus")
-                                                "/lib/girepository-1.0")
                                 ,(string-append (assoc-ref outputs "out")
                                                 "/share/ibus-stt")))
-                             `("GI_TYPELIB_PATH" ":" prefix
-                               (,(string-append (assoc-ref inputs "ibus")
-                                                "/lib/girepository-1.0")
-                                ,(string-append (assoc-ref outputs "out")
-                                                "/share/ibus-stt")))))
+                             `("GI_TYPELIB_PATH" =
+                               (,(getenv "GI_TYPELIB_PATH")))))
                          (list (string-append out "/libexec/ibus-engine-stt")
                                (string-append out "/libexec/ibus-setup-stt")))))))))
     (inputs

base-commit: 1f684d00d25f0f205c4cc4b762d8f56911062581
-- 
2.38.1


[-- Attachment #1.3: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc --]
[-- Type: application/pgp-keys, Size: 1722 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 509 bytes --]

^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#61236: ibus-speech-to-text engine fails to run (?)
  2023-02-07 16:41     ` Luis Felipe via Bug reports for GNU Guix
@ 2023-02-08  7:32       ` Liliana Marie Prikler
  2023-02-09 19:33         ` Luis Felipe via Bug reports for GNU Guix
  0 siblings, 1 reply; 11+ messages in thread
From: Liliana Marie Prikler @ 2023-02-08  7:32 UTC (permalink / raw)
  To: Luis Felipe; +Cc: 61236

Am Dienstag, dem 07.02.2023 um 16:41 +0000 schrieb Luis Felipe:
> Hi,
> 
> The attached patch fixed the issue for me. Now ibus-engine-stt seems
> to be running correctly and I can switch to the input method without
> the workaround indicated in the initial report.
> 
> I noticed that there are some lint issues from the original package
> definition though. I didn't fixed those:
> 
> $ ./pre-inst-env guix lint ibus-speech-to-text
> /home/yo/guix/gnu/packages/ibus.scm:899:5: ibus-speech-to-text@0.4.0:
> 
> [1] 'desktop-file-utils' should probably be a native input
> 
> /home/yo/guix/gnu/packages/ibus.scm:899:5: ibus-speech-to-text@0.4.0:
> 
> [2] 'glib:bin' should probably be a native input
> 
> /home/yo/guix/gnu/packages/ibus.scm:899:5: ibus-speech-to-text@0.4.0:
> 
> [3] 'gobject-introspection' should probably be a native input
> 
> /home/yo/guix/gnu/packages/ibus.scm:899:5: ibus-speech-to-text@0.4.0:
> 
> [4] label 'glib' does not match package name 'glib:bin'
> 
> /home/yo/guix/gnu/packages/ibus.scm:856:2: ibus-speech-to-text@0.4.0:
> 
> [5] "bash-minimal" should be in 'inputs' when 'wrap-program' is used
All but [4] should be fixed.  Can you attach a separate patch to do so?
(If possible, use `git send-email` with a reroll count of 2, so that CI
and mumi-based workflows behave as intended.)

> * gnu/packages/ibus.scm (ibus-speech-to-text)[phases]: 
Should probably be #:phases.
> Remove path to ibus-stt directory from GI_TYPELIB_PATH, since it
> doesn't provide typelibs.
Should probably be "Use getenv to set GUIX_PYTHONPATH."

> Remove path to ibus' typelibs directory from GUIX_PYTHONPATH, since
> it doesn't provide Python modules.
I think you should also use getenv here.  I think we should mimic
python-build-system here and add the output directory to
GUIX_PYTHONPATH before it gets wrapped.

> Remove unnecessary delimiters from all environment variables.
I don't think it's necessary to remove them ;)

Cheers




^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#61236: ibus-speech-to-text engine fails to run (?)
  2023-02-08  7:32       ` Liliana Marie Prikler
@ 2023-02-09 19:33         ` Luis Felipe via Bug reports for GNU Guix
  2023-02-10  6:42           ` Liliana Marie Prikler
  0 siblings, 1 reply; 11+ messages in thread
From: Luis Felipe via Bug reports for GNU Guix @ 2023-02-09 19:33 UTC (permalink / raw)
  To: Liliana Marie Prikler; +Cc: 61236


[-- Attachment #1.1: Type: text/plain, Size: 1712 bytes --]

Hi Liliana,

> > Remove path to ibus' typelibs directory from GUIX_PYTHONPATH, since
> > it doesn't provide Python modules.
> 

> I think you should also use getenv here. I think we should mimic
> python-build-system here and add the output directory to
> GUIX_PYTHONPATH before it gets wrapped.

I'm not sure I understand this part. Do you mean something like this (set GUIX_PYTHONPATH in the let definitions)?:

(let* ((out (assoc-ref outputs "out"))
       (ibus-stt-dir (string-append out "/share/ibus-stt"))
       (guix-pythonpath
        (setenv "GUIX_PYTHONPATH"
                (string-append ibus-stt-dir ":"
                               (getenv "GUIX_PYTHONPATH")))))
  (for-each (lambda (prog)
              (wrap-program prog
                `("GST_PLUGIN_PATH" ":" prefix
                  (,(string-append (assoc-ref inputs "gst-vosk")
                                   "/lib/gstreamer-1.0")
                   ,(getenv "GST_PLUGIN_SYSTEM_PATH")))
                `("GUIX_PYTHONPATH" =
                  (,(getenv "GUIX_PYTHONPATH")))
                `("GI_TYPELIB_PATH" =
                  (,(getenv "GI_TYPELIB_PATH")))))
            (list (string-append out "/libexec/ibus-engine-stt")
                  (string-append out "/libexec/ibus-setup-stt"))))

In the meantime, I just sent a new version of the patch using git send-email to refresh my memory (haven't used it in years) and check whether automatic tasks are triggered in the infrastructure. The new patch amends the commit message and puts delimiters back. I will send another version later once I understand what is left to be done, together with the other patch to fix lint issues, as you suggested.

[-- Attachment #1.2: publickey - luis.felipe.la@protonmail.com - 0x12DE1598.asc --]
[-- Type: application/pgp-keys, Size: 1722 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 509 bytes --]

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#61236: [PATCH v1] gnu: ibus-speech-to-text: Fix execution of ibus-engine-stt.
  2023-02-02 19:46 bug#61236: ibus-speech-to-text engine fails to run (?) Luis Felipe via Bug reports for GNU Guix
  2023-02-03  7:14 ` Liliana Marie Prikler
@ 2023-02-09 19:38 ` sirgazil--- via Bug reports for GNU Guix
  2023-02-10 18:49 ` bug#61236: [PATCH v2 1/2] " sirgazil--- via Bug reports for GNU Guix
  2 siblings, 0 replies; 11+ messages in thread
From: sirgazil--- via Bug reports for GNU Guix @ 2023-02-09 19:38 UTC (permalink / raw)
  To: 61236; +Cc: Luis Felipe

From: Luis Felipe <luis.felipe.la@protonmail.com>

Fixes <https://issues.guix.gnu.org/61236>.

* gnu/packages/ibus.scm (ibus-speech-to-text)[#:phases]: Use getenv to
set GUIX_PYTHONPATH and GI_TYPELIB_PATH.
---
 gnu/packages/ibus.scm | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index 4c45671acc..28c0cb69c1 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2021 Songlin Jiang <hollowman@hollowman.ml>
 ;;; Copyright © 2021 Taiju HIGASHI <higashi@taiju.info>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2023 Luis Felipe López Acevedo <luis.felipe.la@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -888,15 +889,9 @@ (define-public ibus-speech-to-text
                                 ,(getenv "GST_PLUGIN_SYSTEM_PATH")))
                              `("GUIX_PYTHONPATH" ":" prefix
                                (,(getenv "GUIX_PYTHONPATH")
-                                ,(string-append (assoc-ref inputs "ibus")
-                                                "/lib/girepository-1.0")
-                                ,(string-append (assoc-ref outputs "out")
-                                                "/share/ibus-stt")))
-                             `("GI_TYPELIB_PATH" ":" prefix
-                               (,(string-append (assoc-ref inputs "ibus")
-                                                "/lib/girepository-1.0")
-                                ,(string-append (assoc-ref outputs "out")
-                                                "/share/ibus-stt")))))
+                                ,(string-append out "/share/ibus-stt")))
+                             `("GI_TYPELIB_PATH" =
+                               (,(getenv "GI_TYPELIB_PATH")))))
                          (list (string-append out "/libexec/ibus-engine-stt")
                                (string-append out "/libexec/ibus-setup-stt")))))))))
     (inputs

base-commit: 1f684d00d25f0f205c4cc4b762d8f56911062581
-- 
2.38.1





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#61236: ibus-speech-to-text engine fails to run (?)
  2023-02-09 19:33         ` Luis Felipe via Bug reports for GNU Guix
@ 2023-02-10  6:42           ` Liliana Marie Prikler
  0 siblings, 0 replies; 11+ messages in thread
From: Liliana Marie Prikler @ 2023-02-10  6:42 UTC (permalink / raw)
  To: Luis Felipe; +Cc: 61236

Am Donnerstag, dem 09.02.2023 um 19:33 +0000 schrieb Luis Felipe:
> Hi Liliana,
> 
> > > Remove path to ibus' typelibs directory from GUIX_PYTHONPATH,
> > > since it doesn't provide Python modules.
> > 
> 
> > I think you should also use getenv here. I think we should mimic
> > python-build-system here and add the output directory to
> > GUIX_PYTHONPATH before it gets wrapped.
> 
> I'm not sure I understand this part. Do you mean something like this
> (set GUIX_PYTHONPATH in the let definitions)?:
> 
> (let* ((out (assoc-ref outputs "out"))
>        (ibus-stt-dir (string-append out "/share/ibus-stt"))
>        (guix-pythonpath
>         (setenv "GUIX_PYTHONPATH"
>                 (string-append ibus-stt-dir ":"
>                                (getenv "GUIX_PYTHONPATH")))))
>   (for-each (lambda (prog)
>               (wrap-program prog
>                 `("GST_PLUGIN_PATH" ":" prefix
>                   (,(string-append (assoc-ref inputs "gst-vosk")
>                                    "/lib/gstreamer-1.0")
>                    ,(getenv "GST_PLUGIN_SYSTEM_PATH")))
>                 `("GUIX_PYTHONPATH" =
>                   (,(getenv "GUIX_PYTHONPATH")))
>                 `("GI_TYPELIB_PATH" =
>                   (,(getenv "GI_TYPELIB_PATH")))))
>             (list (string-append out "/libexec/ibus-engine-stt")
>                   (string-append out "/libexec/ibus-setup-stt"))))
No, I meant more like 
  (add-after 'set-paths 'add-output-to-pythonpath
    (lambda* (#:key outputs #:allow-other-keys)
       (setenv ...)))
Confer %standard-phases in (guix build python-build-system) or 
(guix build pyproject-build-system) for the ordering of phases there. 
I'm fairly certain that GUIX_PYTHONPATH is configured rather soon-ish.

> In the meantime, I just sent a new version of the patch using git
> send-email to refresh my memory (haven't used it in years) and check
> whether automatic tasks are triggered in the infrastructure. The new
> patch amends the commit message and puts delimiters back. I will send
> another version later once I understand what is left to be done,
> together with the other patch to fix lint issues, as you suggested.
When you do, don't forget to CC <liliana.prikler@gmail.com>.

Thanks

^ permalink raw reply	[flat|nested] 11+ messages in thread

* bug#61236: [PATCH v2 1/2] gnu: ibus-speech-to-text: Fix execution of ibus-engine-stt.
  2023-02-02 19:46 bug#61236: ibus-speech-to-text engine fails to run (?) Luis Felipe via Bug reports for GNU Guix
  2023-02-03  7:14 ` Liliana Marie Prikler
  2023-02-09 19:38 ` bug#61236: [PATCH v1] gnu: ibus-speech-to-text: Fix execution of ibus-engine-stt sirgazil--- via Bug reports for GNU Guix
@ 2023-02-10 18:49 ` sirgazil--- via Bug reports for GNU Guix
  2023-02-10 18:49   ` bug#61236: [PATCH v2 2/2] gnu: ibus-speech-to-text: Fix lint warnings sirgazil--- via Bug reports for GNU Guix
  2 siblings, 1 reply; 11+ messages in thread
From: sirgazil--- via Bug reports for GNU Guix @ 2023-02-10 18:49 UTC (permalink / raw)
  To: 61236; +Cc: Luis Felipe, liliana.prikler

From: Luis Felipe <luis.felipe.la@protonmail.com>

Fixes <https://issues.guix.gnu.org/61236>.

* gnu/packages/ibus.scm (ibus-speech-to-text)[#:phases]: Use getenv to
set GUIX_PYTHONPATH and GI_TYPELIB_PATH.
---
 gnu/packages/ibus.scm | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index 4c45671acc..51ad37b613 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2021 Songlin Jiang <hollowman@hollowman.ml>
 ;;; Copyright © 2021 Taiju HIGASHI <higashi@taiju.info>
 ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2023 Luis Felipe López Acevedo <luis.felipe.la@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -875,6 +876,13 @@ (define-public ibus-speech-to-text
              (substitute* "meson.build"
                (("update_desktop_database: true")
                 "update_desktop_database: false"))))
+         (add-after 'set-paths 'add-output-to-pythonpath
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (ibus-stt-dir (string-append out "/share/ibus-stt")))
+               (setenv "GUIX_PYTHONPATH"
+                       (string-append ibus-stt-dir ":"
+                                      (getenv "GUIX_PYTHONPATH"))))))
          (add-after 'install 'wrap-with-additional-paths
            (lambda* (#:key inputs outputs #:allow-other-keys)
              ;; Make sure 'ibus-{setup,engine}-stt' find the gst-vosk plugin
@@ -886,17 +894,10 @@ (define-public ibus-speech-to-text
                                (,(string-append (assoc-ref inputs "gst-vosk")
                                                 "/lib/gstreamer-1.0")
                                 ,(getenv "GST_PLUGIN_SYSTEM_PATH")))
-                             `("GUIX_PYTHONPATH" ":" prefix
-                               (,(getenv "GUIX_PYTHONPATH")
-                                ,(string-append (assoc-ref inputs "ibus")
-                                                "/lib/girepository-1.0")
-                                ,(string-append (assoc-ref outputs "out")
-                                                "/share/ibus-stt")))
-                             `("GI_TYPELIB_PATH" ":" prefix
-                               (,(string-append (assoc-ref inputs "ibus")
-                                                "/lib/girepository-1.0")
-                                ,(string-append (assoc-ref outputs "out")
-                                                "/share/ibus-stt")))))
+                             `("GUIX_PYTHONPATH" =
+                               (,(getenv "GUIX_PYTHONPATH")))
+                             `("GI_TYPELIB_PATH" =
+                               (,(getenv "GI_TYPELIB_PATH")))))
                          (list (string-append out "/libexec/ibus-engine-stt")
                                (string-append out "/libexec/ibus-setup-stt")))))))))
     (inputs

base-commit: 1f684d00d25f0f205c4cc4b762d8f56911062581
-- 
2.38.1





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#61236: [PATCH v2 2/2] gnu: ibus-speech-to-text: Fix lint warnings.
  2023-02-10 18:49 ` bug#61236: [PATCH v2 1/2] " sirgazil--- via Bug reports for GNU Guix
@ 2023-02-10 18:49   ` sirgazil--- via Bug reports for GNU Guix
  2023-02-12  7:53     ` Liliana Marie Prikler
  0 siblings, 1 reply; 11+ messages in thread
From: sirgazil--- via Bug reports for GNU Guix @ 2023-02-10 18:49 UTC (permalink / raw)
  To: 61236; +Cc: Luis Felipe, liliana.prikler

From: Luis Felipe <luis.felipe.la@protonmail.com>

* gnu/packages/ibus.scm (ibus-speech-to-text)[inputs]: Add
bash-minimal.  Move desktop-file-utils, glib:bin and
gobject-introspection to native-inputs.
---
 gnu/packages/ibus.scm | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/ibus.scm b/gnu/packages/ibus.scm
index 51ad37b613..b3bf3036bc 100644
--- a/gnu/packages/ibus.scm
+++ b/gnu/packages/ibus.scm
@@ -901,9 +901,7 @@ (define-public ibus-speech-to-text
                          (list (string-append out "/libexec/ibus-engine-stt")
                                (string-append out "/libexec/ibus-setup-stt")))))))))
     (inputs
-     (list desktop-file-utils
-           (list glib "bin")
-           gobject-introspection
+     (list bash-minimal
            gst-vosk
            gstreamer
            gtk
@@ -913,7 +911,11 @@ (define-public ibus-speech-to-text
            python-babel
            python-pygobject))
     (native-inputs
-     (list gettext-minimal libxml2 pkg-config))
+     (list desktop-file-utils
+           gettext-minimal
+           (list glib "bin")
+           gobject-introspection
+           libxml2 pkg-config))
     (home-page "https://github.com/PhilippeRo/IBus-Speech-To-Text")
     (synopsis "Speech to text IBus engine using VOSK")
     (description "This Input Method uses VOSK for voice recognition and allows
-- 
2.38.1





^ permalink raw reply related	[flat|nested] 11+ messages in thread

* bug#61236: [PATCH v2 2/2] gnu: ibus-speech-to-text: Fix lint warnings.
  2023-02-10 18:49   ` bug#61236: [PATCH v2 2/2] gnu: ibus-speech-to-text: Fix lint warnings sirgazil--- via Bug reports for GNU Guix
@ 2023-02-12  7:53     ` Liliana Marie Prikler
  0 siblings, 0 replies; 11+ messages in thread
From: Liliana Marie Prikler @ 2023-02-12  7:53 UTC (permalink / raw)
  To: sirgazil, 61236-done; +Cc: Luis Felipe

Am Freitag, dem 10.02.2023 um 13:49 -0500 schrieb sirgazil@zoho.com:
> From: Luis Felipe <luis.felipe.la@protonmail.com>
> 
> * gnu/packages/ibus.scm (ibus-speech-to-text)[inputs]: Add
> bash-minimal.  Move desktop-file-utils, glib:bin and
> gobject-introspection to native-inputs.
> ---
Updated commit messages and pushed.

Cheers




^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-02-12  8:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-02 19:46 bug#61236: ibus-speech-to-text engine fails to run (?) Luis Felipe via Bug reports for GNU Guix
2023-02-03  7:14 ` Liliana Marie Prikler
2023-02-03 17:07   ` Luis Felipe via Bug reports for GNU Guix
2023-02-07 16:41     ` Luis Felipe via Bug reports for GNU Guix
2023-02-08  7:32       ` Liliana Marie Prikler
2023-02-09 19:33         ` Luis Felipe via Bug reports for GNU Guix
2023-02-10  6:42           ` Liliana Marie Prikler
2023-02-09 19:38 ` bug#61236: [PATCH v1] gnu: ibus-speech-to-text: Fix execution of ibus-engine-stt sirgazil--- via Bug reports for GNU Guix
2023-02-10 18:49 ` bug#61236: [PATCH v2 1/2] " sirgazil--- via Bug reports for GNU Guix
2023-02-10 18:49   ` bug#61236: [PATCH v2 2/2] gnu: ibus-speech-to-text: Fix lint warnings sirgazil--- via Bug reports for GNU Guix
2023-02-12  7:53     ` Liliana Marie Prikler

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).