1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, cairocffi
5, dbus-next
6, dbus-python
7, glib
8, iwlib
9, libdrm
10, libinput
11, libxkbcommon
12, mpd2
13, pango
14, pixman
15, pkg-config
16, psutil
17, pulsectl-asyncio
18, pygobject3
19, python-dateutil
20, pywayland
21, pywlroots
22, pyxdg
23, setuptools
24, setuptools-scm
25, wayland
26, wlroots
27, xcbutilcursor
28, xcbutilwm
29, xcffib
30, xkbcommon
31}:
32
33buildPythonPackage rec {
34 pname = "qtile";
35 version = "0.23.0";
36
37 src = fetchFromGitHub {
38 owner = "qtile";
39 repo = "qtile";
40 rev = "v${version}";
41 hash = "sha256-WxnpkKqYGGEsFTt/1iCSiCzdESJP6HFJ6BztaMsMbYo=";
42 };
43
44 patches = [
45 ./fix-restart.patch # https://github.com/NixOS/nixpkgs/issues/139568
46 ];
47
48 postPatch = ''
49 substituteInPlace libqtile/pangocffi.py \
50 --replace libgobject-2.0.so.0 ${glib.out}/lib/libgobject-2.0.so.0 \
51 --replace libpangocairo-1.0.so.0 ${pango.out}/lib/libpangocairo-1.0.so.0 \
52 --replace libpango-1.0.so.0 ${pango.out}/lib/libpango-1.0.so.0
53 substituteInPlace libqtile/backend/x11/xcursors.py \
54 --replace libxcb-cursor.so.0 ${xcbutilcursor.out}/lib/libxcb-cursor.so.0
55 substituteInPlace libqtile/backend/wayland/cffi/build.py \
56 --replace /usr/include/pixman-1 ${lib.getDev pixman}/include \
57 --replace /usr/include/libdrm ${lib.getDev libdrm}/include/libdrm
58 '';
59
60 SETUPTOOLS_SCM_PRETEND_VERSION = version;
61
62 nativeBuildInputs = [
63 pkg-config
64 setuptools
65 setuptools-scm
66 ];
67
68 propagatedBuildInputs = [
69 (cairocffi.override { withXcffib = true; })
70 dbus-next
71 dbus-python
72 iwlib
73 mpd2
74 psutil
75 pulsectl-asyncio
76 pygobject3
77 python-dateutil
78 pywayland
79 pywlroots
80 pyxdg
81 xcffib
82 xkbcommon
83 ];
84
85 buildInputs = [
86 libinput
87 libxkbcommon
88 wayland
89 wlroots
90 xcbutilwm
91 ];
92
93 doCheck = false; # Requires X server #TODO this can be worked out with the existing NixOS testing infrastructure.
94
95 meta = with lib; {
96 homepage = "http://www.qtile.org/";
97 license = licenses.mit;
98 description = "A small, flexible, scriptable tiling window manager written in Python";
99 platforms = platforms.linux;
100 maintainers = with maintainers; [ kamilchm arjan-s ];
101 };
102}