d9f416313a
It is not linked against so there is no need to include it in build inputs, much less propagate it. This removes systemd.dev from the runtime closure of packages using pyudev.
36 lines
811 B
Nix
36 lines
811 B
Nix
{ lib, fetchPypi, buildPythonPackage
|
|
, six, systemd, 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)" "'${systemd.lib}/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;
|
|
};
|
|
}
|