2017-03-09 12:40:56 +00:00
|
|
|
{ lib, fetchurl, buildPythonPackage
|
2017-03-29 06:33:32 +00:00
|
|
|
, six, systemd, pytest, mock, hypothesis, docutils
|
2017-03-09 12:40:56 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2017-05-27 09:25:35 +00:00
|
|
|
pname = "pyudev";
|
|
|
|
name = "${pname}-${version}";
|
2017-03-09 12:40:56 +00:00
|
|
|
version = "0.21.0";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://pypi/p/pyudev/${name}.tar.gz";
|
|
|
|
sha256 = "0arz0dqp75sszsmgm6vhg92n1lsx91ihddx3m944f4ah0487ljq9";
|
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2017-03-29 06:33:32 +00:00
|
|
|
substituteInPlace src/pyudev/_ctypeslib/utils.py \
|
|
|
|
--replace "find_library(name)" "'${systemd.lib}/lib/libudev.so'"
|
2017-03-09 12:40:56 +00:00
|
|
|
'';
|
|
|
|
|
2017-03-29 06:33:32 +00:00
|
|
|
buildInputs = [ pytest mock hypothesis docutils ];
|
2017-03-09 12:40:56 +00:00
|
|
|
propagatedBuildInputs = [ systemd six ];
|
|
|
|
|
2017-03-29 06:33:32 +00:00
|
|
|
checkPhase = ''
|
|
|
|
py.test
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Bunch of failing tests
|
|
|
|
# https://github.com/pyudev/pyudev/issues/187
|
|
|
|
doCheck = false;
|
|
|
|
|
2017-03-09 12:40:56 +00:00
|
|
|
meta = {
|
2017-08-01 20:03:30 +00:00
|
|
|
homepage = http://pyudev.readthedocs.org/;
|
2017-03-09 12:40:56 +00:00
|
|
|
description = "Pure Python libudev binding";
|
|
|
|
license = lib.licenses.lgpl21Plus;
|
|
|
|
};
|
|
|
|
}
|