[PATCH] gnu: Add python-screenkey.

  • Done
  • quality assurance status badge
Details
2 participants
  • Alexandros Theodotou
  • Léo Le Bouter
Owner
unassigned
Submitted by
Alexandros Theodotou
Severity
normal
A
A
Alexandros Theodotou wrote on 9 Jan 2021 15:45
(address . guix-patches@gnu.org)
cbeaa51097ddd926add2a26b43cc1d1b665d695a.camel@zrythm.org
Hi,

This patch adds python-screenkey. It almost works with:
```
guix environment -L . python-screenkey --ad-hoc python-screenkey --
screenkey
```

although it can't initialize GTK.

I don't know how to fix this, if someone wants to take it from here
please go ahead.

Thanks,
Alex
From cd84aeecbcd370df5c45b077ac765b5f2e8070f4 Mon Sep 17 00:00:00 2001
From: Alexandros Theodotou <alex@zrythm.org>
Date: Sat, 9 Jan 2021 14:42:47 +0000
Subject: [PATCH] gnu: Add python-screenkey.

* gnu/packages/python-xyz.scm (python-screenkey): New variable.
---
gnu/packages/python-xyz.scm | 49 ++++++++++++++++++++++++++++++++++++-
1 file changed, 48 insertions(+), 1 deletion(-)

Toggle diff (66 lines)
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 23e43b7e75..87d0ba89dc 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -74,7 +74,7 @@
;;; Copyright © 2020 Sebastian Schott <sschott@mailbox.org>
;;; Copyright © 2020 Alexandros Theodotou <alex@zrythm.org>
;;; Copyright © 2020 Josh Marshall <joshua.r.marshall.1991@gmail.com>
-;;; Copyright © 2020 Alexandros Theodotou <alex@zrythm.org>
+;;; Copyright © 2020, 2021 Alexandros Theodotou <alex@zrythm.org>
;;; Copyright © 2020 Lars-Dominik Braun <ldb@leibniz-psychology.org>
;;; Copyright © 2020 Alex ter Weele <alex.ter.weele@gmail.com>
;;; Copyright © 2020 Matthew Kraai <kraai@ftbfs.org>
@@ -23451,3 +23451,50 @@ Qt applications.")
"Pivy provides python bindings for Coin, a 3D graphics library with an
Application Programming Interface based on the Open Inventor 2.1 API.")
(license license:isc)))
+
+(define-public python-screenkey
+ (package
+ (name "python-screenkey")
+ (version "1.3")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.com/wavexx/screenkey.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1lsnkkvy9cijsalv12x746azab45xb958h00nf616kn91kiy5np1"))))
+ (build-system python-build-system)
+ (arguments
+ `(#:tests? #f
+ #:phases
+ (modify-phases %standard-phases
+ (add-after 'unpack 'fix-dlopen-paths
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (let* ((x11 (assoc-ref inputs "libx11"))
+ (xtst (assoc-ref inputs "libxtst")))
+ (substitute* "Screenkey/xlib.py"
+ (("libX11.so.6")
+ (string-append x11 "/lib/libX11.so.6")))
+ (substitute* "Screenkey/xlib.py"
+ (("libXtst.so.6")
+ (string-append xtst "/lib/libXtst.so.6")))
+ #t))))))
+ (inputs
+ `(("python-distutils-extra" ,python-distutils-extra)
+ ("python-tokenize-rt" ,python-tokenize-rt)
+ ("intltool" ,intltool)
+ ("libx11" ,libx11)
+ ("libxtst" ,libxtst)
+ ("gtk+" ,gtk+)
+ ("python-pygobject" ,python-pygobject)
+ ("python-pycairo" ,python-pycairo)
+ ("python-setuptools-git" ,python-setuptools-git)))
+ (home-page "https://www.thregr.org/~wavexx/software/screenkey/")
+ (synopsis
+ "Screencast tool to display pressed keys")
+ (description
+ "A screencast tool to display your keys inspired by Screenflick.")
+ (license license:gpl3+)))
--
2.29.2
L
L
Léo Le Bouter wrote on 22 Feb 2021 19:06
(address . 45745-done@debbugs.gnu.org)
60383ab55c6616ca22e131bc9b3bc5f77a01296a.camel@zaclys.net
Made it work and pushed as ad06c29b37924ecf5eb3bd440c7456cad6415c3b.

Have a look at the redshift package for an example on how to wrap the
final binary to include PYTHONPATH and GI_TYPELIB_PATH from the build
environment.

For this one, I added such a phase:

(add-after 'install 'wrap-screenkey
(lambda* (#:key outputs #:allow-other-keys)
(wrap-program
(string-append (assoc-ref outputs "out")
"/bin/screenkey")
`("PYTHONPATH" ":" prefix (,(getenv "PYTHONPATH")))
`("GI_TYPELIB_PATH"
":" prefix (,(getenv "GI_TYPELIB_PATH"))))
#t))

Thank you!
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEFIvLi9gL+xax3g6RRaix6GvNEKYFAmAz8qEACgkQRaix6GvN
EKarKQ/6AiZKa4viOUHxN4sqyhdnZoISh5mT+PNMue3FHOsNyr3Qg/zm2KXQyN1A
vhJ+4ACn0OXs/DcnYUkrs7OJhFCeL3XLUMdLYwVOon6ChLbkVqportqSvTvmHqdQ
x/VuA/xgZQ9KXFn6bKvJLXoqDtV9Hzu5j1TTzdGFU+92Il71KtBCq6IplbeWAVla
BjcCLNA9k89N5HMlfzzng9LMWwNvk0AlEWxfPcxFsBljLAOiJq67uuciK6jTfd8E
f9a4sLrNEupPKBZl/RyDnGVXlLzoP62V7tdWCZkQHx64gYrsO+Oae+/MWZvB780U
aG5UeC/nFPd+qAo9v0O3XEaM+5lCESdEmxIuj3KUr9hdLmLWA3p2TSMD5oDlgCLh
XZkB173OZjot9xCyuodD/m4daOC6T3CQN/ugwQ0GipfeSn/O3qjTYAiI6VRiAL0M
p4C9mdGg80LbtOC4hECg+n4cefBQhcWawHZhq7KtGJR7YAXfYYXtXbwSQOF6EGw8
IHhvPu815tSTdImD9M6iR8W/FrO7eFh/LgUwrI/BxGdR76IiqB3cDdyi8ZvY66pk
WFY8ZVCbl/ik8hoX4n9uwNJa6rUa4WYoKq4bvZECJxmcteSOLLjNRhEYhs0W2IrK
LklUleCrq59pIJ+/UMAlSZxOWlFFvaREfAA1Ul1cUql/8wAEdu0=
=ISWE
-----END PGP SIGNATURE-----


Closed
?