pythonPackages.xlib: fix 'No protocol specified'

Fixes an upstream bug (python-xlib/python-xlib#207). Without this patch,
streamdeck-ui breaks on NixOS systems running GNOME on Xorg.
This commit is contained in:
Majiir Paktu 2022-07-08 00:13:47 -04:00
parent 38cc2b70ef
commit 68f01e2424
2 changed files with 17 additions and 0 deletions

View file

@ -22,6 +22,10 @@ buildPythonPackage rec {
sha256 = "155p9xhsk01z9vdml74h07svlqy6gljnx9c6qbydcr14lwghwn06";
};
patches = [
./fix-no-protocol-specified.patch
];
nativeBuildInputs = [ setuptools-scm ];
buildInputs = [ xorg.libX11 ];
propagatedBuildInputs = [ six ];

View file

@ -0,0 +1,13 @@
diff --git a/Xlib/xauth.py b/Xlib/xauth.py
index 2ed7dd5..303bd49 100644
--- a/Xlib/xauth.py
+++ b/Xlib/xauth.py
@@ -120,6 +120,8 @@ class Xauthority(object):
matches = {}
for efam, eaddr, enum, ename, edata in self.entries:
+ if enum == b'' and ename not in matches:
+ enum = num
if efam == family and eaddr == address and num == enum:
matches[ename] = edata