depot/third_party/nixpkgs/pkgs/development/python-modules/pywayland/default.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

48 lines
1 KiB
Nix

{
lib,
buildPythonPackage,
fetchPypi,
python,
cffi,
pkg-config,
wayland,
wayland-scanner,
pytestCheckHook,
}:
buildPythonPackage rec {
pname = "pywayland";
version = "0.4.18";
format = "setuptools";
src = fetchPypi {
inherit pname version;
hash = "sha256-WYreAng6rQWjKPZjtRtpTFq2i9XR4JJsDaPFISxWZTM=";
};
depsBuildBuild = [ pkg-config ];
nativeBuildInputs = [ wayland-scanner ];
propagatedNativeBuildInputs = [ cffi ];
buildInputs = [ wayland ];
propagatedBuildInputs = [ cffi ];
nativeCheckInputs = [ pytestCheckHook ];
postBuild = ''
${python.pythonOnBuildForHost.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";
mainProgram = "pywayland-scanner";
license = licenses.ncsa;
maintainers = with maintainers; [ chvp ];
};
}