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