From 68f01e2424fa65307943f47468d95d4c3062d44d Mon Sep 17 00:00:00 2001 From: Majiir Paktu Date: Fri, 8 Jul 2022 00:13:47 -0400 Subject: [PATCH] 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. --- pkgs/development/python-modules/xlib/default.nix | 4 ++++ .../xlib/fix-no-protocol-specified.patch | 13 +++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 pkgs/development/python-modules/xlib/fix-no-protocol-specified.patch diff --git a/pkgs/development/python-modules/xlib/default.nix b/pkgs/development/python-modules/xlib/default.nix index edb4761af3a8..05d5e095a163 100644 --- a/pkgs/development/python-modules/xlib/default.nix +++ b/pkgs/development/python-modules/xlib/default.nix @@ -22,6 +22,10 @@ buildPythonPackage rec { sha256 = "155p9xhsk01z9vdml74h07svlqy6gljnx9c6qbydcr14lwghwn06"; }; + patches = [ + ./fix-no-protocol-specified.patch + ]; + nativeBuildInputs = [ setuptools-scm ]; buildInputs = [ xorg.libX11 ]; propagatedBuildInputs = [ six ]; diff --git a/pkgs/development/python-modules/xlib/fix-no-protocol-specified.patch b/pkgs/development/python-modules/xlib/fix-no-protocol-specified.patch new file mode 100644 index 000000000000..1f3ab927f840 --- /dev/null +++ b/pkgs/development/python-modules/xlib/fix-no-protocol-specified.patch @@ -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 +