Pyudev depends only on a libudev implementation, rather than on systemd-udevd specifically or on systemd generally. Let's adjust the dependency list to make it more specific. In particular, this allows pyudev to build and run with the overlay which substitutes eudev for udev. Pyudev is used by the auxiliary trackpad calibration tools included as part of libinput. Because an enormous number of packages depend on libinput, this allows a very large number of packages to be used without systemd. Note that libinput.so does not depend on pyudev or systemd -- only the trackpad calibration utilities bundled with libudev use pyudev.
36 lines
812 B
Nix
36 lines
812 B
Nix
{ lib, fetchPypi, buildPythonPackage
|
|
, six, udev, pytest, mock, hypothesis, docutils
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "pyudev";
|
|
version = "0.22.0";
|
|
|
|
src = fetchPypi {
|
|
inherit pname version;
|
|
sha256 = "0xmj6l08iih2js9skjqpv4w7y0dhxyg91zmrs6v5aa65gbmipfv9";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace src/pyudev/_ctypeslib/utils.py \
|
|
--replace "find_library(name)" "'${lib.getLib udev}/lib/libudev.so'"
|
|
'';
|
|
|
|
checkInputs = [ pytest mock hypothesis docutils ];
|
|
propagatedBuildInputs = [ six ];
|
|
|
|
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;
|
|
};
|
|
}
|