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