1{ lib
2, buildPythonPackage
3, fetchPypi
4, linuxHeaders
5, pythonOlder
6}:
7
8buildPythonPackage rec {
9 pname = "evdev";
10 version = "1.6.1";
11 format = "setuptools";
12
13 disabled = pythonOlder "3.7";
14
15 src = fetchPypi {
16 inherit pname version;
17 hash = "sha256-KZ24YozHOyN/wcxX08KUj6oHVuKli2GUtb+B3CCB8eM=";
18 };
19
20 buildInputs = [
21 linuxHeaders
22 ];
23
24 patchPhase = ''
25 substituteInPlace setup.py \
26 --replace /usr/include/linux ${linuxHeaders}/include/linux
27 '';
28
29 doCheck = false;
30
31 pythonImportsCheck = [
32 "evdev"
33 ];
34
35 meta = with lib; {
36 description = "Provides bindings to the generic input event interface in Linux";
37 homepage = "https://python-evdev.readthedocs.io/";
38 changelog = "https://github.com/gvalkov/python-evdev/blob/v${version}/docs/changelog.rst";
39 license = licenses.bsd3;
40 maintainers = with maintainers; [ goibhniu ];
41 platforms = platforms.linux;
42 };
43}