2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
fetchPypi,
|
|
|
|
buildPythonPackage,
|
|
|
|
six,
|
|
|
|
udev,
|
|
|
|
pytest,
|
|
|
|
mock,
|
|
|
|
hypothesis,
|
|
|
|
docutils,
|
|
|
|
stdenvNoCC,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pyudev";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "0.24.3";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-LpRUJ6IWdIk7uXYyQB22ITnZHOoe6WE3zHsHrSIZj8c=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
postPatch = lib.optionalString stdenvNoCC.isLinux ''
|
2020-04-24 23:36:52 +00:00
|
|
|
substituteInPlace src/pyudev/_ctypeslib/utils.py \
|
2022-03-30 09:31:56 +00:00
|
|
|
--replace "find_library(name)" "'${lib.getLib udev}/lib/libudev.so'"
|
2024-06-05 15:53:02 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-06-05 15:53:02 +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;
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://pyudev.readthedocs.org/";
|
|
|
|
description = "Pure Python libudev binding";
|
2024-01-02 11:29:13 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
maintainers = with maintainers; [ frogamic ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|