1{ lib, fetchPypi, buildPythonPackage
2, six, systemd, pytest, mock, hypothesis, docutils
3}:
4
5buildPythonPackage rec {
6 pname = "pyudev";
7 version = "0.21.0";
8
9 src = fetchPypi {
10 inherit pname version;
11 sha256 = "0arz0dqp75sszsmgm6vhg92n1lsx91ihddx3m944f4ah0487ljq9";
12 };
13
14 postPatch = ''
15 substituteInPlace src/pyudev/_ctypeslib/utils.py \
16 --replace "find_library(name)" "'${systemd.lib}/lib/libudev.so'"
17 '';
18
19 buildInputs = [ pytest mock hypothesis docutils ];
20 propagatedBuildInputs = [ systemd six ];
21
22 checkPhase = ''
23 py.test
24 '';
25
26 # Bunch of failing tests
27 # https://github.com/pyudev/pyudev/issues/187
28 doCheck = false;
29
30 meta = {
31 homepage = http://pyudev.readthedocs.org/;
32 description = "Pure Python libudev binding";
33 license = lib.licenses.lgpl21Plus;
34 };
35}