depot/third_party/nixpkgs/pkgs/development/python-modules/systemd/default.nix
Default email 83405b6dd2 Project import generated by Copybara.
GitOrigin-RevId: ac718d02867a84b42522a0ece52d841188208f2c
2023-03-15 17:39:30 +01:00

56 lines
1.2 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, libredirect
, systemd
, pkg-config
, pytest
, python
}:
buildPythonPackage rec {
pname = "systemd";
version = "235";
src = fetchFromGitHub {
owner = "systemd";
repo = "python-systemd";
rev = "v${version}";
hash = "sha256-8p4m4iM/z4o6PHRQIpuSXb64tPTWGlujEYCDVLiIt2o=";
};
nativeBuildInputs = [
pkg-config
];
buildInputs = [
systemd
];
nativeCheckInputs = [
pytest
];
checkPhase = ''
echo "12345678901234567890123456789012" > machine-id
export NIX_REDIRECTS=/etc/machine-id=$(realpath machine-id) \
LD_PRELOAD=${libredirect}/lib/libredirect.so
pytest $out/${python.sitePackages}/systemd
'';
pythonImportsCheck = [
"systemd.journal"
"systemd.id128"
"systemd.daemon"
"systemd.login"
];
meta = with lib; {
description = "Python module for native access to the systemd facilities";
homepage = "https://www.freedesktop.org/software/systemd/python-systemd/";
changelog = "https://github.com/systemd/python-systemd/blob/v${version}/NEWS";
license = licenses.lgpl21Plus;
maintainers = with maintainers; [ SuperSandro2000 ];
};
}