2020-04-24 23:36:52 +00:00
|
|
|
{ lib, fetchPypi, buildPythonPackage
|
2022-03-30 09:31:56 +00:00
|
|
|
, six, udev, pytest, mock, hypothesis, docutils
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyudev";
|
2022-09-30 11:47:45 +00:00
|
|
|
version = "0.24.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-sqOv4cmep1H4KWZSVX6sVZh02iobHsBiUXhwbsWjRfM=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/pyudev/_ctypeslib/utils.py \
|
2022-03-30 09:31:56 +00:00
|
|
|
--replace "find_library(name)" "'${lib.getLib udev}/lib/libudev.so'"
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ pytest mock hypothesis docutils ];
|
2020-08-20 17:08:02 +00:00
|
|
|
propagatedBuildInputs = [ six ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
py.test
|
|
|
|
'';
|
|
|
|
|
|
|
|
# Bunch of failing tests
|
|
|
|
# https://github.com/pyudev/pyudev/issues/187
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://pyudev.readthedocs.org/";
|
|
|
|
description = "Pure Python libudev binding";
|
|
|
|
license = lib.licenses.lgpl21Plus;
|
|
|
|
};
|
|
|
|
}
|