1{ lib
2, buildPythonPackage
3, fetchPypi
4, python
5, cffi
6, pkg-config
7, libxkbcommon
8, libinput
9, pixman
10, pythonOlder
11, udev
12, wlroots
13, wayland
14, pywayland
15, xkbcommon
16, xorg
17, pytestCheckHook
18, qtile
19}:
20
21buildPythonPackage rec {
22 pname = "pywlroots";
23 version = "0.16.6";
24 format = "setuptools";
25
26 disabled = pythonOlder "3.7";
27
28 src = fetchPypi {
29 inherit pname version;
30 hash = "sha256-ITf1uALQ0ZJMeZ4wbC7VqEL9LdoK67vqRpXD6LTWjUE=";
31 };
32
33 nativeBuildInputs = [ pkg-config ];
34 propagatedNativeBuildInputs = [ cffi ];
35 buildInputs = [ libinput libxkbcommon pixman xorg.libxcb xorg.xcbutilwm udev wayland wlroots ];
36 propagatedBuildInputs = [ cffi pywayland xkbcommon ];
37 nativeCheckInputs = [ pytestCheckHook ];
38
39 postBuild = ''
40 ${python.pythonOnBuildForHost.interpreter} wlroots/ffi_build.py
41 '';
42
43 pythonImportsCheck = [ "wlroots" ];
44
45 passthru.tests = { inherit qtile; };
46
47 meta = with lib; {
48 homepage = "https://github.com/flacjacket/pywlroots";
49 description = "Python bindings to wlroots using cffi";
50 license = licenses.ncsa;
51 platforms = platforms.linux;
52 maintainers = with maintainers; [ chvp ];
53 };
54}