1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 python,
6 cffi,
7 pkg-config,
8 wayland,
9 pytestCheckHook,
10}:
11
12buildPythonPackage rec {
13 pname = "pywayland";
14 version = "0.4.17";
15 format = "setuptools";
16
17 src = fetchPypi {
18 inherit pname version;
19 hash = "sha256-9/0ZAmOML3oVrAfzGj72iV08FgyiYBSByoKyxhojxlc=";
20 };
21
22 nativeBuildInputs = [ pkg-config ];
23 propagatedNativeBuildInputs = [ cffi ];
24 buildInputs = [ wayland ];
25 propagatedBuildInputs = [ cffi ];
26 nativeCheckInputs = [ pytestCheckHook ];
27
28 postBuild = ''
29 ${python.pythonOnBuildForHost.interpreter} pywayland/ffi_build.py
30 '';
31
32 # Tests need this to create sockets
33 preCheck = ''
34 export XDG_RUNTIME_DIR="$PWD"
35 '';
36
37 pythonImportsCheck = [ "pywayland" ];
38
39 meta = with lib; {
40 homepage = "https://github.com/flacjacket/pywayland";
41 description = "Python bindings to wayland using cffi";
42 mainProgram = "pywayland-scanner";
43 license = licenses.ncsa;
44 maintainers = with maintainers; [ chvp ];
45 };
46}