summaryrefslogtreecommitdiff
path: root/gnu/packages
diff options
context:
space:
mode:
authorJulien Lepiller <julien@lepiller.eu>2019-06-22 17:17:06 +0200
committerJulien Lepiller <julien@lepiller.eu>2019-06-22 17:21:06 +0200
commitb95af3f6ab6a55641260b8f9743496ec12992717 (patch)
tree086333f990d35b49e697586d437ecd180b3e6b14 /gnu/packages
parent453365bcf77cd2fa21cc9794f678cf7e333ae9fe (diff)
gnu: python-pyatspi: Fix loading libraries.
* gnu/package/gnome.scm (python-pyatspi): Fix loading dependencies.
Diffstat (limited to 'gnu/packages')
-rw-r--r--gnu/packages/gnome.scm15
-rw-r--r--gnu/packages/patches/python-pyatspi-python-37.patch82
2 files changed, 96 insertions, 1 deletions
diff --git a/gnu/packages/gnome.scm b/gnu/packages/gnome.scm
index ad6b9203b9..2820be0022 100644
--- a/gnu/packages/gnome.scm
+++ b/gnu/packages/gnome.scm
@@ -7397,8 +7397,21 @@ kill/reinice processes.")
"/pyatspi-" version ".tar.xz"))
(sha256
(base32
- "0xdnix7gxzgf75xy9ris4dd6b05mqwicw190b98xqmypydyf95n6"))))
+ "0xdnix7gxzgf75xy9ris4dd6b05mqwicw190b98xqmypydyf95n6"))
+ ;; Patch from upstream, fixed in newer versions.
+ (patches (search-patches "python-pyatspi-python-37.patch"))))
(build-system gnu-build-system)
+ (arguments
+ `(#:phases
+ (modify-phases %standard-phases
+ (add-before 'build 'fix-atk-load
+ (lambda _
+ (substitute* "pyatspi/__init__.py"
+ (("from gi.repository import Atspi")
+ "gi.require_version('Gtk', '3.0')
+from gi.repository import Gtk
+from gi.repository import Atspi"))
+ #t)))))
(native-inputs
`(("pkg-config" ,pkg-config)))
(inputs
diff --git a/gnu/packages/patches/python-pyatspi-python-37.patch b/gnu/packages/patches/python-pyatspi-python-37.patch
new file mode 100644
index 0000000000..caa6aea39e
--- /dev/null
+++ b/gnu/packages/patches/python-pyatspi-python-37.patch
@@ -0,0 +1,82 @@
+From 29a7b929f7f1160b643dc5f5911533887173fcff Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= <miro@hroncok.cz>
+Date: Thu, 28 Jun 2018 17:10:33 +0200
+Subject: [PATCH] Rename async to asynchronous, keep backwards comaptibility
+
+async is a keyword in Python 3.7 and keeping it results in SyntaxError.
+
+Fixes https://gitlab.gnome.org/GNOME/pyatspi2/issues/1
+---
+ pyatspi/registry.py | 35 +++++++++++++++++++++++++++--------
+ 1 file changed, 27 insertions(+), 8 deletions(-)
+
+diff --git a/pyatspi/registry.py b/pyatspi/registry.py
+index cb28395..f73ee16 100644
+--- a/pyatspi/registry.py
++++ b/pyatspi/registry.py
+@@ -50,9 +50,9 @@ class Registry(object):
+ reference to the Accessibility.Registry singleton. Doing so is harmless and
+ has no point.
+
+- @@ivar async: Should event dispatch to local listeners be decoupled from event
+- receiving from the registry?
+- @@type async: boolean
++ @@ivar asynchronous: Should event dispatch to local listeners be decoupled
++ from event receiving from the registry?
++ @@type asynchronous: boolean
+ @@ivar reg: Reference to the real, wrapped registry object
+ @@type reg: Accessibility.Registry
+ @@ivar dev: Reference to the device controller
+@@ -111,25 +111,44 @@ class Registry(object):
+
+ self.has_implementations = True
+
+- self.async = False # not fully supported yet
++ self.asynchronous = False # not fully supported yet
+ self.started = False
+ self.event_listeners = dict()
+
++ def __getattr__(self, name):
++ """
++ For backwards compatibility with old API
++ """
++ if name == 'async':
++ return self.asynchronous
++ return object.__getattr__(self, name)
++
++ def __setattr__(self, name, value):
++ """
++ For backwards compatibility with old API
++ """
++ if name == 'async':
++ self.asynchronous = value
++ object.__setattr__(self, name, value)
++
+ def _set_default_registry (self):
+ self._set_registry (MAIN_LOOP_GLIB)
+
+- def start(self, async=False, gil=True):
++ def start(self, asynchronous=False, gil=True, **kwargs):
+ """
+ Enter the main loop to start receiving and dispatching events.
+
+- @@param async: Should event dispatch be asynchronous (decoupled) from
+- event receiving from the AT-SPI registry?
+- @@type async: boolean
++ @@param asynchronous: Should event dispatch be asynchronous
++ (decoupled) from event receiving from the AT-SPI registry?
++ @@type asynchronous: boolean
+ @@param gil: Add an idle callback which releases the Python GIL for a few
+ milliseconds to allow other threads to run? Necessary if other threads
+ will be used in this process.
+ @@type gil: boolean
+ """
++ if 'async' in kwargs:
++ # support previous API
++ asynchronous = kwargs['async']
+ if not self.has_implementations:
+ self._set_default_registry ()
+ self.started = True
+--
+2.22.0
+