2018-06-23 14:27:58 +01:00
|
|
|
{ lib, fetchPypi, buildPythonPackage
|
2017-03-29 07:33:32 +01:00
|
|
|
, six, systemd, pytest, mock, hypothesis, docutils
|
2017-03-09 12:40:56 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2017-05-27 10:25:35 +01:00
|
|
|
pname = "pyudev";
|
2020-05-09 22:23:58 +01:00
|
|
|
version = "0.22.0";
|
2017-03-09 12:40:56 +00:00
|
|
|
|
2018-06-23 14:27:58 +01:00
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-05-09 22:23:58 +01:00
|
|
|
sha256 = "0xmj6l08iih2js9skjqpv4w7y0dhxyg91zmrs6v5aa65gbmipfv9";
|
2017-03-09 12:40:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
2017-03-29 07:33:32 +01:00
|
|
|
substituteInPlace src/pyudev/_ctypeslib/utils.py \
|
2020-08-12 19:16:26 +01:00
|
|
|
--replace "find_library(name)" "'${lib.getLib systemd}/lib/libudev.so'"
|
2017-03-09 12:40:56 +00:00
|
|
|
'';
|
|
|
|
|
2019-01-05 10:54:27 +00:00
|
|
|
checkInputs = [ pytest mock hypothesis docutils ];
|
2020-07-08 15:25:53 +01:00
|
|
|
propagatedBuildInputs = [ six ];
|
2017-03-09 12:40:56 +00:00
|
|
|
|
2017-03-29 07:33:32 +01: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 = {
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://pyudev.readthedocs.org/";
|
2017-03-09 12:40:56 +00:00
|
|
|
description = "Pure Python libudev binding";
|
|
|
|
license = lib.licenses.lgpl21Plus;
|
|
|
|
};
|
|
|
|
}
|