summary refs log tree commit diff
path: root/pkgs/development/python-modules/pyudev/default.nix
blob: b0a4505555a5c0c1c9ce932e9b1312a0ac64ba24 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
{ lib, fetchPypi, buildPythonPackage
, six, systemd, pytest, mock, hypothesis, docutils
}:

buildPythonPackage rec {
  pname = "pyudev";
  version = "0.21.0";

  src = fetchPypi {
    inherit pname version;
    sha256 = "0arz0dqp75sszsmgm6vhg92n1lsx91ihddx3m944f4ah0487ljq9";
  };

  postPatch = ''
    substituteInPlace src/pyudev/_ctypeslib/utils.py \
      --replace "find_library(name)" "'${systemd.lib}/lib/libudev.so'"
    '';

  buildInputs = [ pytest mock hypothesis docutils ];
  propagatedBuildInputs = [ systemd six ];

  checkPhase = ''
    py.test
  '';

  # Bunch of failing tests
  # https://github.com/pyudev/pyudev/issues/187
  doCheck = false;

  meta = {
    homepage = http://pyudev.readthedocs.org/;
    description = "Pure Python libudev binding";
    license = lib.licenses.lgpl21Plus;
  };
}