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