From 7c1e44f7b63b4cb9672f35e095fa018e416341bd Mon Sep 17 00:00:00 2001 From: Stefan Junker Date: Wed, 31 Jan 2018 19:58:52 +0100 Subject: [PATCH 1/2] qtile: 0.10.4 -> 0.10.7 --- ...Substitution-vars-for-absolute-paths.patch | 21 +----- .../0002-Restore-PATH-and-PYTHONPATH.patch | 75 +++++++++---------- .../qtile/0003-Restart-executable.patch | 18 +---- .../window-managers/qtile/default.nix | 4 +- 4 files changed, 44 insertions(+), 74 deletions(-) diff --git a/pkgs/applications/window-managers/qtile/0001-Substitution-vars-for-absolute-paths.patch b/pkgs/applications/window-managers/qtile/0001-Substitution-vars-for-absolute-paths.patch index e3c88a5fa55..71d3d9cafaa 100644 --- a/pkgs/applications/window-managers/qtile/0001-Substitution-vars-for-absolute-paths.patch +++ b/pkgs/applications/window-managers/qtile/0001-Substitution-vars-for-absolute-paths.patch @@ -1,15 +1,5 @@ -From 00c5af939567429d40877845dc52b54fde2d8a50 Mon Sep 17 00:00:00 2001 -From: "Alexander V. Nikolaev" -Date: Thu, 26 Nov 2015 10:53:12 +0200 -Subject: [PATCH 1/3] Substitution vars for absolute paths - ---- - libqtile/pangocffi.py | 6 +++--- - libqtile/xcursors.py | 2 +- - 2 files changed, 4 insertions(+), 4 deletions(-) - diff --git a/libqtile/pangocffi.py b/libqtile/pangocffi.py -index 27691d1..25f690d 100644 +index 1e8f5c04..e860d43a 100644 --- a/libqtile/pangocffi.py +++ b/libqtile/pangocffi.py @@ -58,9 +58,9 @@ except ImportError: @@ -26,18 +16,15 @@ index 27691d1..25f690d 100644 def CairoContext(cairo_t): diff --git a/libqtile/xcursors.py b/libqtile/xcursors.py -index e0e55e1..59b6428 100644 +index f1133555..3e61204a 100644 --- a/libqtile/xcursors.py +++ b/libqtile/xcursors.py -@@ -114,7 +114,7 @@ class Cursors(dict): +@@ -112,7 +112,7 @@ class Cursors(dict): def _setup_xcursor_binding(self): try: - xcursor = ffi.dlopen('libxcb-cursor.so') + xcursor = ffi.dlopen('@xcb-cursor@/lib/libxcb-cursor.so') except OSError: - self.log.warning("xcb-cursor not found, fallback to font pointer") + logger.warning("xcb-cursor not found, fallback to font pointer") return False --- -2.6.3 - diff --git a/pkgs/applications/window-managers/qtile/0002-Restore-PATH-and-PYTHONPATH.patch b/pkgs/applications/window-managers/qtile/0002-Restore-PATH-and-PYTHONPATH.patch index b620bfb2501..7d184838fba 100644 --- a/pkgs/applications/window-managers/qtile/0002-Restore-PATH-and-PYTHONPATH.patch +++ b/pkgs/applications/window-managers/qtile/0002-Restore-PATH-and-PYTHONPATH.patch @@ -1,57 +1,52 @@ -From f299a0aa0eefcf16bb4990f00ac3946727f43ef3 Mon Sep 17 00:00:00 2001 -From: "Alexander V. Nikolaev" -Date: Fri, 27 Nov 2015 10:49:48 +0200 -Subject: [PATCH 2/3] Restore PATH and PYTHONPATH - ---- - bin/qtile | 1 + - bin/qtile-run | 1 + - bin/qtile-session | 2 ++ - libqtile/utils.py | 7 +++++++ - 4 files changed, 11 insertions(+) - +diff --git a/bin/qshell b/bin/qshell +index 2ba7e61c..0ac2a2ef 100755 +--- a/bin/qshell ++++ b/bin/qshell +@@ -28,5 +28,6 @@ base_dir = os.path.abspath(os.path.join(this_dir, "..")) + sys.path.insert(0, base_dir) + + if __name__ == '__main__': ++ __import__("importlib").import_module("libqtile.utils").restore_os_environment() + from libqtile.scripts import qshell + qshell.main() diff --git a/bin/qtile b/bin/qtile -index 66034fe..ce3fcd1 100755 +index 3e82814d..335b5cea 100755 --- a/bin/qtile +++ b/bin/qtile -@@ -131,6 +131,7 @@ def make_qtile(): +@@ -29,5 +29,6 @@ base_dir = os.path.abspath(os.path.join(this_dir, "..")) + sys.path.insert(0, base_dir) - - if __name__ == "__main__": + if __name__ == '__main__': + __import__("importlib").import_module("libqtile.utils").restore_os_environment() - rename_process() - q = make_qtile() - try: + from libqtile.scripts import qtile + qtile.main() diff --git a/bin/qtile-run b/bin/qtile-run -index ccedb96..646a476 100755 +index e4b121be..1c203bc9 100755 --- a/bin/qtile-run +++ b/bin/qtile-run -@@ -50,6 +50,7 @@ def main(): - proc.wait() +@@ -8,5 +8,6 @@ base_dir = os.path.abspath(os.path.join(this_dir, "..")) + sys.path.insert(0, base_dir) - if __name__ == "__main__": + if __name__ == '__main__': + __import__("importlib").import_module("libqtile.utils").restore_os_environment() - try: - main() - except KeyboardInterrupt: -diff --git a/bin/qtile-session b/bin/qtile-session -index 84f6a2d..da31b12 100755 ---- a/bin/qtile-session -+++ b/bin/qtile-session -@@ -25,6 +25,8 @@ - Qtile session manager. - """ + from libqtile.scripts import qtile_run + qtile_run.main() +diff --git a/bin/qtile-top b/bin/qtile-top +index 5316e0e7..272c6430 100755 +--- a/bin/qtile-top ++++ b/bin/qtile-top +@@ -8,5 +8,6 @@ base_dir = os.path.abspath(os.path.join(this_dir, "..")) + sys.path.insert(0, base_dir) -+__import__("importlib").import_module("libqtile.utils").restore_os_environment() -+ - from libqtile.log_utils import init_log - import logging - import os + if __name__ == '__main__': ++ __import__("importlib").import_module("libqtile.utils").restore_os_environment() + from libqtile.scripts import qtile_top + qtile_top.main() diff --git a/libqtile/utils.py b/libqtile/utils.py -index 284089b..ec3539e 100644 +index 36ed0a58..bca9eab3 100644 --- a/libqtile/utils.py +++ b/libqtile/utils.py -@@ -227,3 +227,11 @@ def describe_attributes(obj, attrs, func=None): +@@ -240,3 +240,11 @@ def describe_attributes(obj, attrs, func=None): pairs.append('%s=%s' % (attr, value)) return ', '.join(pairs) diff --git a/pkgs/applications/window-managers/qtile/0003-Restart-executable.patch b/pkgs/applications/window-managers/qtile/0003-Restart-executable.patch index d9377897fc6..c9ae57c8615 100644 --- a/pkgs/applications/window-managers/qtile/0003-Restart-executable.patch +++ b/pkgs/applications/window-managers/qtile/0003-Restart-executable.patch @@ -1,17 +1,8 @@ -From b560c11078fecc35df2c62f34beda06c4e80a10d Mon Sep 17 00:00:00 2001 -From: "Alexander V. Nikolaev" -Date: Fri, 27 Nov 2015 10:54:35 +0200 -Subject: [PATCH 3/3] Restart executable - ---- - libqtile/manager.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - diff --git a/libqtile/manager.py b/libqtile/manager.py -index b1a38e2..110f7d8 100644 +index 36518a74..9b6bdd02 100644 --- a/libqtile/manager.py +++ b/libqtile/manager.py -@@ -1339,7 +1339,7 @@ class Qtile(command.CommandObject): +@@ -1386,7 +1386,7 @@ class Qtile(command.CommandObject): argv = [s for s in argv if not s.startswith('--with-state')] argv.append('--with-state=' + buf.getvalue().decode()) @@ -19,7 +10,4 @@ index b1a38e2..110f7d8 100644 + self.cmd_execute(os.environ.get("QTILE_WRAPPER", "@out@/bin/qtile"), argv[1:]) def cmd_spawn(self, cmd): - """ --- -2.6.3 - + """Run cmd in a shell. diff --git a/pkgs/applications/window-managers/qtile/default.nix b/pkgs/applications/window-managers/qtile/default.nix index a7b9a77b3db..79752829e2a 100644 --- a/pkgs/applications/window-managers/qtile/default.nix +++ b/pkgs/applications/window-managers/qtile/default.nix @@ -7,13 +7,13 @@ in python27Packages.buildPythonApplication rec { name = "qtile-${version}"; - version = "0.10.4"; + version = "0.10.7"; src = fetchFromGitHub { owner = "qtile"; repo = "qtile"; rev = "v${version}"; - sha256 = "0rwklzgkp3x242xql6qmfpfnhr788hd3jc1l80pc5ybxlwyfx59i"; + sha256 = "18szgplyym0b65vnaa8nqzadq6q0mhsiky9g5hqhn7xzf4kykmj8"; }; patches = [ From 1b0f730a7371b4222c9570f3f224835c00b086be Mon Sep 17 00:00:00 2001 From: adisbladis Date: Thu, 1 Feb 2018 15:48:49 +0800 Subject: [PATCH 2/2] pythonPackages.xcffib: 0.3.2 -> 0.5.1 --- .../python-modules/xcffib/default.nix | 31 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 24 +------------- 2 files changed, 32 insertions(+), 23 deletions(-) create mode 100644 pkgs/development/python-modules/xcffib/default.nix diff --git a/pkgs/development/python-modules/xcffib/default.nix b/pkgs/development/python-modules/xcffib/default.nix new file mode 100644 index 00000000000..9b136531a4b --- /dev/null +++ b/pkgs/development/python-modules/xcffib/default.nix @@ -0,0 +1,31 @@ +{ stdenv +, buildPythonPackage +, fetchPypi +, xorg +, cffi +, six +}: + +buildPythonPackage rec { + version = "0.5.1"; + pname = "xcffib"; + + src = fetchPypi { + inherit pname version; + sha256 = "09gbnmr5vn58mm8xi3fmd7fz6743cks6c46dphnxzwax6zsxmy60"; + }; + + patchPhase = '' + # Hardcode cairo library path + sed -e 's,ffi\.dlopen(,&"${xorg.libxcb.out}/lib/" + ,' -i xcffib/__init__.py + ''; + + propagatedBuildInputs = [ cffi six ]; + + meta = with stdenv.lib; { + description = "A drop in replacement for xpyb, an XCB python binding"; + homepage = "https://github.com/tych0/xcffib"; + license = licenses.asl20; + maintainers = with maintainers; [ kamilchm ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 272b57298e5..6394d1c3c00 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -21012,29 +21012,7 @@ EOF pluggy = callPackage ../development/python-modules/pluggy {}; - xcffib = buildPythonPackage rec { - version = "0.3.2"; - name = "xcffib-${version}"; - - src = pkgs.fetchurl { - url = "mirror://pypi/x/xcffib/${name}.tar.gz"; - sha256 = "a84eecd5a1bb7570e26c83aca87a2016578ca4e353e1fa56189e95bdef063e6a"; - }; - - patchPhase = '' - # Hardcode cairo library path - sed -e 's,ffi\.dlopen(,&"${pkgs.xorg.libxcb.out}/lib/" + ,' -i xcffib/__init__.py - ''; - - propagatedBuildInputs = [ self.cffi self.six ]; - - meta = { - description = "A drop in replacement for xpyb, an XCB python binding"; - homepage = "https://github.com/tych0/xcffib"; - license = licenses.asl20; - maintainers = with maintainers; [ kamilchm ]; - }; - }; + xcffib = callPackage ../development/python-modules/xcffib {}; pafy = callPackage ../development/python-modules/pafy { };