unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#53222] [PATCH] gnu: Add autokey.
@ 2022-01-12 21:03 John Kehayias via Guix-patches via
  2022-01-12 21:22 ` Nicolas Goaziou
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: John Kehayias via Guix-patches via @ 2022-01-12 21:03 UTC (permalink / raw)
  To: 53222; +Cc: ~whereiseveryone/guixrus

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

Hello,

Here is a patch for autokey, a python based program for things like keyboard shortcuts and text expansion. I find it invaluable for having emacs-like keys everywhere.

It includes both a gtk and qt frontend; after discussion on IRC I decided against trying to split them. Since it is one package and it is built together, it is a bit tricky I think to disentangle the code and paths needed for each. In my first attempts it didn't reduce the closure and needed a lot of manual work. Possibly it could work with more effort, but since this is used as a GUI tool primarily, the GTK/QT packages shouldn't be adding anything new.

John

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-Add-autokey.patch --]
[-- Type: text/x-patch; name=0001-gnu-Add-autokey.patch, Size: 3466 bytes --]

From 419a8587d6101b8ac48922ff06d75ecd405e16e9 Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Wed, 12 Jan 2022 15:51:17 -0500
Subject: [PATCH] gnu: Add autokey.

* gnu/packages/python-xyz.scm (autokey): New variable.
---
 gnu/packages/python-xyz.scm | 62 +++++++++++++++++++++++++++++++++++++
 1 file changed, 62 insertions(+)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 4df794eb60..b85232f2b7 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -114,6 +114,7 @@
 ;;; Copyright © 2021 ZmnSCPxj <ZmnSCPxj@protonmail.com>
 ;;; Copyright © 2021 Filip Lajszczak <filip@lajszczak.dev>
 ;;; Copyright © 2021 Greg Hogan <code@greghogan.com>
+;;; Copyright © 2022 John Kehayias <john.kehayias@protonmail.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -4180,6 +4181,67 @@ (define-public python-anytree
 structure for Python.")
     (license license:asl2.0)))
 
+(define-public autokey
+  (package
+    (name "autokey")
+    (version "0.95.10")
+    (source (origin
+             (method git-fetch)
+             (uri (git-reference
+                   (url "https://github.com/autokey/autokey")
+                   (commit (string-append "v" version))))
+             (file-name (git-file-name name version))
+             (sha256
+              (base32
+               "0f0cqfnb49wwdy7zl2f2ypcnd5pc8r8n7z7ssxkq20d4xfxlgamr"))))
+    (build-system python-build-system)
+    (arguments
+     (list
+      #:tests? #f ; Tests are deprecated/broken until next version.
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'fix-paths
+            (lambda* (#:key inputs #:allow-other-keys)
+              (substitute* "lib/autokey/scripting.py"
+                (("\"wmctrl\"")
+                 (string-append "\"" (search-input-file inputs "bin/wmctrl") "\""))
+                (("\"zenity\"")
+                 (string-append "\"" (search-input-file inputs "bin/zenity") "\"")))))
+          (add-after 'install 'wrap-autokey
+            (lambda _
+              (let ((gi-typelib-path (getenv "GI_TYPELIB_PATH")))
+                (for-each
+                 (lambda (program)
+                   (wrap-program program
+                     `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-path))))
+                 (map (lambda (name)
+                        (string-append #$output "/bin/" name))
+                      '("autokey-gtk"
+                        "autokey-shell")))))))))
+    (inputs
+     (list bash-minimal ; for wrap-program
+           gtksourceview-3
+           libappindicator
+           libnotify
+           wmctrl
+           zenity))
+    (propagated-inputs
+     (list python-dbus
+           python-pygobject
+           python-pyinotify
+           python-pyqt+qscintilla
+           python-xlib))
+    (home-page "https://github.com/autokey/autokey")
+    (synopsis
+      "Keyboard and GUI automation utility")
+    (description
+      "AutoKey is a desktop automation utility for X11.  It allows the automation of
+virtually any task by responding to typed abbreviations and hotkeys.  It
+offers a full-featured GUI (GTK and QT versions) that makes it highly
+accessible for novices, as well as a scripting interface offering the full
+flexibility and power of the Python language.")
+    (license license:gpl3+)))
+
 (define-public python-docutils
   (package
     (name "python-docutils")
-- 
2.34.0


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

* [bug#53222] [PATCH] gnu: Add autokey.
  2022-01-12 21:03 [bug#53222] [PATCH] gnu: Add autokey John Kehayias via Guix-patches via
@ 2022-01-12 21:22 ` Nicolas Goaziou
  2022-01-12 21:26 ` Maxime Devos
  2022-01-14 20:40 ` [bug#53222] [PATCH] gnu: autokey fix paths John Kehayias via Guix-patches via
  2 siblings, 0 replies; 11+ messages in thread
From: Nicolas Goaziou @ 2022-01-12 21:22 UTC (permalink / raw)
  To: 53222; +Cc: John Kehayias, ~whereiseveryone/guixrus, 53222-done

Hello,

John Kehayias via Guix-patches via <guix-patches@gnu.org> writes:

> Here is a patch for autokey, a python based program for things like
> keyboard shortcuts and text expansion. I find it invaluable for having
> emacs-like keys everywhere.

Applied. Thank you.

Regards,
-- 
Nicolas Goaziou




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

* [bug#53222] [PATCH] gnu: Add autokey.
  2022-01-12 21:03 [bug#53222] [PATCH] gnu: Add autokey John Kehayias via Guix-patches via
  2022-01-12 21:22 ` Nicolas Goaziou
@ 2022-01-12 21:26 ` Maxime Devos
  2022-01-12 21:55   ` John Kehayias via Guix-patches via
  2022-01-14 20:40 ` [bug#53222] [PATCH] gnu: autokey fix paths John Kehayias via Guix-patches via
  2 siblings, 1 reply; 11+ messages in thread
From: Maxime Devos @ 2022-01-12 21:26 UTC (permalink / raw)
  To: John Kehayias, 53222; +Cc: ~whereiseveryone/guixrus

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

Hi,

John Kehayias via Guix-patches via schreef op wo 12-01-2022 om 21:03
[+0000]:
> +      #:tests? #f ; Tests are deprecated/broken until next version.

How can a test be deprecated?
What tests are broken?
Are the tests broken, or do they fail because of a real issue?

> +                   (wrap-program program
> +                     `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-
> path))))

Do we need to include the GI_TYPELIB_PATH from the environment?
If not, I recommend '=' instead of 'prefix' to avoid potential trouble.

> +                 (map (lambda (name)
> +                        (string-append #$output "/bin/" name))
> +                      '("autokey-gtk"
> +                        "autokey-shell")))))))))
> +    (inputs
> +     (list bash-minimal ; for wrap-program
> +           gtksourceview-3
> +           libappindicator
> +           libnotify
> +           wmctrl
> +           zenity))
> +    (propagated-inputs
> +     (list python-dbus
> +           python-pygobject
> +           python-pyinotify
> +           python-pyqt+qscintilla

If you add "GUIX_PYTHONPATH"  to the wrap-program,
then probably the propagated inputs can be moved to the regular inputs
(since 'autokey' appeas to be used as a few binaries and not
as a python _library_).

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* [bug#53222] [PATCH] gnu: Add autokey.
  2022-01-12 21:26 ` Maxime Devos
@ 2022-01-12 21:55   ` John Kehayias via Guix-patches via
  2022-01-13  7:34     ` Maxime Devos
  0 siblings, 1 reply; 11+ messages in thread
From: John Kehayias via Guix-patches via @ 2022-01-12 21:55 UTC (permalink / raw)
  To: Maxime Devos, Nicolas Goaziou; +Cc: 53222

Hi Maxime and Nicolas,

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Wednesday, January 12th, 2022 at 4:26 PM, Maxime Devos wrote:

> > +      #:tests? #f ; Tests are deprecated/broken until next version.
>
> How can a test be deprecated?
> What tests are broken?
> Are the tests broken, or do they fail because of a real issue?
>
Sort of both? They relied on python2 and had not been updated, so they didn't work (at all from what I see) and were therefore due for replacement in the new version (forthcoming).

See https://github.com/autokey/autokey/issues/327 where they say "The current tests are deprecated and won’t work." That's why I said it that way in the comment, sorry if that wasn't clear. The new version that seems due soon has a new test framework (tox).

> > +                   (wrap-program program
> > +                     `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-
> > path))))
>
> Do we need to include the GI_TYPELIB_PATH from the environment?
> If not, I recommend '=' instead of 'prefix' to avoid potential trouble.
>

I'm not sure, I was following the examples I saw. For whatever reason, nearly all of them do it that way (I think I only saw one or two as '=', in my quick look). Anyway, I think you are right that it shouldn't be needed, probably the same for a lot of other packages? I think it works with '=' instead, in my quick test.

>
> If you add "GUIX_PYTHONPATH"  to the wrap-program,
> then probably the propagated inputs can be moved to the regular inputs
> (since 'autokey' appeas to be used as a few binaries and not
> as a python library).
>

I'm confused on this as these are already wrapped with GUIX_PYTHONPATH (the bin outputs are python scripts) without adding it explicitly. Trying with the propagated-inputs being regular inputs seems to work fine too.

Although I haven't used it this way, there is also scripting with autokey. One of the included programs is autokey-shell which is a python shell of sorts. I'm not sure if that would make a difference and I don't have anything offhand to test with.

I can submit a patch to change the wrap and inputs if that would be cleaner.

Thanks!
John




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

* [bug#53222] [PATCH] gnu: Add autokey.
  2022-01-12 21:55   ` John Kehayias via Guix-patches via
@ 2022-01-13  7:34     ` Maxime Devos
  0 siblings, 0 replies; 11+ messages in thread
From: Maxime Devos @ 2022-01-13  7:34 UTC (permalink / raw)
  To: John Kehayias, Nicolas Goaziou; +Cc: 53222

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

John Kehayias schreef op wo 12-01-2022 om 21:55 [+0000]:
> Hi Maxime and Nicolas,
> 
> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> 
> On Wednesday, January 12th, 2022 at 4:26 PM, Maxime Devos wrote:
> 
> > > +      #:tests? #f ; Tests are deprecated/broken until next version.
> > 
> > How can a test be deprecated?
> > What tests are broken?
> > Are the tests broken, or do they fail because of a real issue?
> > 
> Sort of both? They relied on python2 and had not been updated, so they didn't work (at all from what I see) and were therefore due for replacement in the new version (forthcoming).
> 
> See https://github.com/autokey/autokey/issues/327 where they say "The current tests are deprecated and won’t work." That's why I said it that way in the comment, sorry if that wasn't clear. The new version that seems due soon has a new test framework (tox).

Adding a link to <https://github.com/autokey/autokey/issues/327> in the
comment should be sufficient:

  ;; Tests are deprecated and broken until the next version, see
  ;; <https://github.com/autokey/autokey/issues/327>.
  #:tests? #false

> > > +                   (wrap-program program
> > > +                     `("GI_TYPELIB_PATH" ":" prefix (,gi-typelib-
> > > path))))
> > 
> > Do we need to include the GI_TYPELIB_PATH from the environment?
> > If not, I recommend '=' instead of 'prefix' to avoid potential trouble.
> > 
> 
> I'm not sure, I was following the examples I saw. For whatever reason, nearly all of them do it that way (I think I only saw one or two as '=', in my quick look). Anyway, I think you are right that it shouldn't be needed, probably the same for a lot of other packages? I think it works with '=' instead, in my quick test.

I think it isn't needed, but because it allows scripting in python
(and hence can benefit from any python libraries in the environment,
possibly including python libraries using GI_TYPELIB_PATH) ...

> > 
> > If you add "GUIX_PYTHONPATH"  to the wrap-program,
> > then probably the propagated inputs can be moved to the regular inputs
> > (since 'autokey' appeas to be used as a few binaries and not
> > as a python library).
> > 
> 
> I'm confused on this as these are already wrapped with GUIX_PYTHONPATH (the bin outputs are python scripts) without adding it explicitly. Trying with the propagated-inputs being regular inputs seems to work fine too.

(seems like this is done implicitely by 'wrap' in (guix build python-
build-system))

> Although I haven't used it this way, there is also scripting with autokey. One of the included programs is autokey-shell which is a python shell of sorts. I'm not sure if that would make a difference and I don't have anything offhand to test with.

it would be nice if the user could install additional python libraries
to use from their scripts, so I think 'prefix' would be better here.
(If I'm not mistaken about Python's loading order, locations early in
GUIX_PYTHONPATH have priority above later entries, so there shouldn't
be any problems unless autokey has undeclared dependencies).

> I can submit a patch to change the wrap and inputs if that would be cleaner.

* Maybe you make the GUIX_PYTHONPATH wrapping explicit (e.g. by
  removing the wrap phase, or moving the 'wrap-autokey' phase before
  the 'wrap', or letting it replace the 'wrap' phase), adding a comment

  ;; Use 'prefix' instead of '=' to allow the user to use additional
  ;; Python libraries from their autokey scripts.
* or maybe don't do that, but still add a similar comment to the 'wrap'
  phase.
* Could you make the comment next to #:tests? a bit more explicit?

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* [bug#53222] [PATCH] gnu: autokey fix paths.
  2022-01-12 21:03 [bug#53222] [PATCH] gnu: Add autokey John Kehayias via Guix-patches via
  2022-01-12 21:22 ` Nicolas Goaziou
  2022-01-12 21:26 ` Maxime Devos
@ 2022-01-14 20:40 ` John Kehayias via Guix-patches via
  2022-01-14 22:35   ` Maxime Devos
  2 siblings, 1 reply; 11+ messages in thread
From: John Kehayias via Guix-patches via @ 2022-01-14 20:40 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 53222, Nicolas Goaziou

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

Hi Maxime,

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Thursday, January 13th, 2022 at 2:34 AM, Maxime Devos wrote:

>> I can submit a patch to change the wrap and inputs if that would be cleaner.
>
> * Maybe you make the GUIX_PYTHONPATH wrapping explicit (e.g. by
>   removing the wrap phase, or moving the 'wrap-autokey' phase before
>   the 'wrap', or letting it replace the 'wrap' phase), adding a comment
>
>   ;; Use 'prefix' instead of '=' to allow the user to use additional
>   ;; Python libraries from their autokey scripts.
> * or maybe don't do that, but still add a similar comment to the 'wrap'
>   phase.
> * Could you make the comment next to #:tests? a bit more explicit?
>

Okay, I hope I understood correctly, attached is a patch with these updates (on top of the already applied originally package addition).

I noticed that autokey-shell had calls to ipython3 (or python3) that should have been substituted, so I did that with the added input for ipython3.

Added the comment about the tests and GI_TYPELIB_PATH. Note that this is there because otherwise the gtk pieces won't run as it needs the girepository (I think this is also the reason this is done in most cases?). I did add the comment you suggested so it is clear this is prefix in case there are other GI paths a user wants, and that the GUIX_PYTHONPATH wrapping is done by python-build-system already.

Thanks again!
John

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-autokey-Fix-paths.patch --]
[-- Type: text/x-patch; name=0001-gnu-autokey-Fix-paths.patch, Size: 2832 bytes --]

From aec4732cac7e239590c7bb85649fd99f6be2d475 Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Fri, 14 Jan 2022 15:26:36 -0500
Subject: [PATCH] gnu: autokey: Fix paths.

* gnu/packages/python-xyz.scm (autokey): Add comments on the disabled tests
and GI_TYPELIB_PATH wrapping.
[inputs]: Add ipython.
[phases]{fix-paths}: Use paths to ipython3 and python3 in autokey-shell
script.
{wrap-autokey}: Change name to...
{wrap-autokey-gi}: ...this and move to before wrap for clarity.
---
 gnu/packages/python-xyz.scm | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index b85232f2b7..7ec671a476 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -4197,7 +4197,9 @@ (define-public autokey
     (build-system python-build-system)
     (arguments
      (list
-      #:tests? #f ; Tests are deprecated/broken until next version.
+      ;; Tests are deprecated and broken until next version, see
+      ;; https://github.com/autokey/autokey/issues/327
+      #:tests? #f
       #:phases
       #~(modify-phases %standard-phases
           (add-after 'unpack 'fix-paths
@@ -4206,8 +4208,16 @@ (define-public autokey
                 (("\"wmctrl\"")
                  (string-append "\"" (search-input-file inputs "bin/wmctrl") "\""))
                 (("\"zenity\"")
-                 (string-append "\"" (search-input-file inputs "bin/zenity") "\"")))))
-          (add-after 'install 'wrap-autokey
+                 (string-append "\"" (search-input-file inputs "bin/zenity") "\"")))
+              (substitute* "autokey-shell"
+                (("'ipython3'")
+                 (string-append "'" (which "ipython3") "'"))
+                (("'python3'")
+                 (string-append "'" (which "python3") "'")))))
+          ;; Use 'prefix' instead of '=' to allow the user to use additional
+          ;; GI paths from their autokey scripts.  GUIX_PYTHONPATH is already
+          ;; wrapped with prefix in python-build-system's wrap.
+          (add-before 'wrap 'wrap-autokey-gi
             (lambda _
               (let ((gi-typelib-path (getenv "GI_TYPELIB_PATH")))
                 (for-each
@@ -4223,14 +4233,14 @@ (define-public autokey
            gtksourceview-3
            libappindicator
            libnotify
-           wmctrl
-           zenity))
-    (propagated-inputs
-     (list python-dbus
+           python-dbus
+           python-ipython
            python-pygobject
            python-pyinotify
            python-pyqt+qscintilla
-           python-xlib))
+           python-xlib
+           wmctrl
+           zenity))
     (home-page "https://github.com/autokey/autokey")
     (synopsis
       "Keyboard and GUI automation utility")
-- 
2.34.0


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

* [bug#53222] [PATCH] gnu: autokey fix paths.
  2022-01-14 20:40 ` [bug#53222] [PATCH] gnu: autokey fix paths John Kehayias via Guix-patches via
@ 2022-01-14 22:35   ` Maxime Devos
  2022-01-14 22:48     ` John Kehayias via Guix-patches via
  0 siblings, 1 reply; 11+ messages in thread
From: Maxime Devos @ 2022-01-14 22:35 UTC (permalink / raw)
  To: John Kehayias; +Cc: 53222, Nicolas Goaziou

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

John Kehayias schreef op vr 14-01-2022 om 20:40 [+0000]:
> -          (add-after 'install 'wrap-autokey
> +                 (string-append "\"" (search-input-file inputs
> "bin/zenity") "\"")))
> +              (substitute* "autokey-shell"
> +                (("'ipython3'")
> +                 (string-append "'" (which "ipython3") "'"))
> +                (("'python3'")
> +                 (string-append "'" (which "python3") "'")))))

Wouldn't these also need to use use 'search-input-file'?
I think I've mentioned before why 'search-input-file' needs to be
used in these kind of contexts instead of 'which' (something with
cross-compilation), if not I can explain.

> [in propagated inputs]
> +           python-ipython
> +           wmctrl
> +           zenity

Do we need propagation here?  I don't quite see the need here
and propagation can cause trouble like profile conflcts during
partial upgrades (i.e. "guix install foo" after "guix pull"
without "guix package -u")

FWIW autokey is never used as library (except for autokey scripts
but I assume autokey scripts are interpreted in the same process
as autokey?) and wrap-program sets GUIX_PYTHONPATH so I think all
python libraries here could be depropagated?  Though that might
be getting out of scope of the original patch, so only if you want
to investigate.

Othderwise, the patch you attached LGTM.

Greetings,
Maxime.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* [bug#53222] [PATCH] gnu: autokey fix paths.
  2022-01-14 22:35   ` Maxime Devos
@ 2022-01-14 22:48     ` John Kehayias via Guix-patches via
  2022-01-15 11:17       ` Maxime Devos
  0 siblings, 1 reply; 11+ messages in thread
From: John Kehayias via Guix-patches via @ 2022-01-14 22:48 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 53222, Nicolas Goaziou

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

Hi Maxime,

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Friday, January 14th, 2022 at 5:35 PM, Maxime Devos wrote:

>
> Wouldn't these also need to use use 'search-input-file'?
> I think I've mentioned before why 'search-input-file' needs to be
> used in these kind of contexts instead of 'which' (something with
> cross-compilation), if not I can explain.
>

That sounds vaguely familiar and makes sense. I've updated it to do that (not sure why I switched, probably since I was using that somewhere else).

> Do we need propagation here? I don't quite see the need here
> and propagation can cause trouble like profile conflcts during
> partial upgrades (i.e. "guix install foo" after "guix pull"
> without "guix package -u")
> FWIW autokey is never used as library (except for autokey scripts
> but I assume autokey scripts are interpreted in the same process
> as autokey?) and wrap-program sets GUIX_PYTHONPATH so I think all
> python libraries here could be depropagated? Though that might
> be getting out of scope of the original patch, so only if you want
> to investigate.
>

None of the inputs are propagated now (might have been confusing looking at just this patch), all are regular inputs. Runs fine and is a good point I'll keep in mind for other python programs versus libraries.

> Othderwise, the patch you attached LGTM.
>

Just to be clear, this patch (most recent version attached) is just to do these final tweaks on top of the original patch which added autokey (as that was already pushed). So I think everything should be good now?

Thanks for the review and instructive changes!
John

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-gnu-autokey-Fix-paths.patch --]
[-- Type: text/x-patch; name=0001-gnu-autokey-Fix-paths.patch, Size: 2878 bytes --]

From 47126c948e4faa608378900c38417e3d020c1e77 Mon Sep 17 00:00:00 2001
From: John Kehayias <john.kehayias@protonmail.com>
Date: Fri, 14 Jan 2022 15:26:36 -0500
Subject: [PATCH] gnu: autokey: Fix paths.

* gnu/packages/python-xyz.scm (autokey): Add comments on the disabled tests
and GI_TYPELIB_PATH wrapping.
[inputs]: Add ipython.
[phases]{fix-paths}: Use paths to ipython3 and python3 in autokey-shell
script.
{wrap-autokey}: Change name to...
{wrap-autokey-gi}: ...this and move to before wrap for clarity.
---
 gnu/packages/python-xyz.scm | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index b85232f2b7..13fe60d296 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -4197,7 +4197,9 @@ (define-public autokey
     (build-system python-build-system)
     (arguments
      (list
-      #:tests? #f ; Tests are deprecated/broken until next version.
+      ;; Tests are deprecated and broken until next version, see
+      ;; https://github.com/autokey/autokey/issues/327
+      #:tests? #f
       #:phases
       #~(modify-phases %standard-phases
           (add-after 'unpack 'fix-paths
@@ -4206,8 +4208,16 @@ (define-public autokey
                 (("\"wmctrl\"")
                  (string-append "\"" (search-input-file inputs "bin/wmctrl") "\""))
                 (("\"zenity\"")
-                 (string-append "\"" (search-input-file inputs "bin/zenity") "\"")))))
-          (add-after 'install 'wrap-autokey
+                 (string-append "\"" (search-input-file inputs "bin/zenity") "\"")))
+              (substitute* "autokey-shell"
+                (("'ipython3'")
+                 (string-append "'" (search-input-file inputs "bin/ipython3") "'"))
+                (("'python3'")
+                 (string-append "'" (search-input-file inputs "bin/python3") "'")))))
+          ;; Use 'prefix' instead of '=' to allow the user to use additional
+          ;; GI paths from their autokey scripts.  GUIX_PYTHONPATH is already
+          ;; wrapped with prefix in python-build-system's wrap.
+          (add-before 'wrap 'wrap-autokey-gi
             (lambda _
               (let ((gi-typelib-path (getenv "GI_TYPELIB_PATH")))
                 (for-each
@@ -4223,14 +4233,14 @@ (define-public autokey
            gtksourceview-3
            libappindicator
            libnotify
-           wmctrl
-           zenity))
-    (propagated-inputs
-     (list python-dbus
+           python-dbus
+           python-ipython
            python-pygobject
            python-pyinotify
            python-pyqt+qscintilla
-           python-xlib))
+           python-xlib
+           wmctrl
+           zenity))
     (home-page "https://github.com/autokey/autokey")
     (synopsis
       "Keyboard and GUI automation utility")
-- 
2.34.0


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

* [bug#53222] [PATCH] gnu: autokey fix paths.
  2022-01-14 22:48     ` John Kehayias via Guix-patches via
@ 2022-01-15 11:17       ` Maxime Devos
  2022-01-15 20:03         ` John Kehayias via Guix-patches via
  0 siblings, 1 reply; 11+ messages in thread
From: Maxime Devos @ 2022-01-15 11:17 UTC (permalink / raw)
  To: John Kehayias; +Cc: 53222, Nicolas Goaziou

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

John Kehayias schreef op vr 14-01-2022 om 22:48 [+0000]:
> [...]
> None of the inputs are propagated now (might have been confusing looking at just this patch), all are regular inputs. [...]

Indeed, I didn't notice the

> -    (propagated-inpits

line.

> [...] So I think everything should be good now?

AFAICT, yes.

Greetings,
MAxome.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

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

* [bug#53222] [PATCH] gnu: autokey fix paths.
  2022-01-15 11:17       ` Maxime Devos
@ 2022-01-15 20:03         ` John Kehayias via Guix-patches via
  2022-01-15 20:32           ` bug#53222: " Nicolas Goaziou
  0 siblings, 1 reply; 11+ messages in thread
From: John Kehayias via Guix-patches via @ 2022-01-15 20:03 UTC (permalink / raw)
  To: Maxime Devos; +Cc: 53222, Nicolas Goaziou

‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

On Saturday, January 15th, 2022 at 6:17 AM, Maxime Devos <maximedevos@telenet.be> wrote:

> John Kehayias schreef op vr 14-01-2022 om 22:48 [+0000]:
>
> [...]
> > [...] So I think everything should be good now?
>
> AFAICT, yes.
>

Great, thanks for the instructive review again!

John




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

* bug#53222: [PATCH] gnu: autokey fix paths.
  2022-01-15 20:03         ` John Kehayias via Guix-patches via
@ 2022-01-15 20:32           ` Nicolas Goaziou
  0 siblings, 0 replies; 11+ messages in thread
From: Nicolas Goaziou @ 2022-01-15 20:32 UTC (permalink / raw)
  To: John Kehayias via Guix-patches via
  Cc: John Kehayias, Maxime Devos, 53222-done

Hello,

John Kehayias via Guix-patches via <guix-patches@gnu.org> writes:

> ‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
>
> On Saturday, January 15th, 2022 at 6:17 AM, Maxime Devos <maximedevos@telenet.be> wrote:
>
>> John Kehayias schreef op vr 14-01-2022 om 22:48 [+0000]:
>>
>> [...]
>> > [...] So I think everything should be good now?
>>
>> AFAICT, yes.
>>
>
> Great, thanks for the instructive review again!

Applied. Thank you, and thanks to Maxime for the in-depth review.

Regards,
-- 
Nicolas Goaziou




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

end of thread, other threads:[~2022-01-15 20:33 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-12 21:03 [bug#53222] [PATCH] gnu: Add autokey John Kehayias via Guix-patches via
2022-01-12 21:22 ` Nicolas Goaziou
2022-01-12 21:26 ` Maxime Devos
2022-01-12 21:55   ` John Kehayias via Guix-patches via
2022-01-13  7:34     ` Maxime Devos
2022-01-14 20:40 ` [bug#53222] [PATCH] gnu: autokey fix paths John Kehayias via Guix-patches via
2022-01-14 22:35   ` Maxime Devos
2022-01-14 22:48     ` John Kehayias via Guix-patches via
2022-01-15 11:17       ` Maxime Devos
2022-01-15 20:03         ` John Kehayias via Guix-patches via
2022-01-15 20:32           ` bug#53222: " Nicolas Goaziou

Code repositories for project(s) associated with this 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).