nixpkgs/pkgs/development/python-modules/pyudev/default.nix
Adam Joseph a05e926519 pyudev: depend on udev instead of systemd
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.
2022-03-24 02:03:36 -07:00

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;
};
}