nixpkgs/pkgs/development/python-modules/pywayland/default.nix

44 lines
923 B
Nix

{ lib
, buildPythonPackage
, fetchPypi
, python
, cffi
, pkg-config
, wayland
, pytestCheckHook
}:
buildPythonPackage rec {
pname = "pywayland";
version = "0.4.16";
src = fetchPypi {
inherit pname version;
hash = "sha256-qqcMhwsKs2UhX45xUF9zaDxO0VsfNjhDOx3HNE/ltd0=";
};
nativeBuildInputs = [ pkg-config ];
propagatedNativeBuildInputs = [ cffi ];
buildInputs = [ wayland ];
propagatedBuildInputs = [ cffi ];
nativeCheckInputs = [ pytestCheckHook ];
postBuild = ''
${python.pythonForBuild.interpreter} pywayland/ffi_build.py
'';
# Tests need this to create sockets
preCheck = ''
export XDG_RUNTIME_DIR="$PWD"
'';
pythonImportsCheck = [ "pywayland" ];
meta = with lib; {
homepage = "https://github.com/flacjacket/pywayland";
description = "Python bindings to wayland using cffi";
license = licenses.ncsa;
maintainers = with maintainers; [ chvp ];
};
}