2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
libredirect,
|
|
|
|
systemd,
|
|
|
|
pkg-config,
|
|
|
|
pytest,
|
|
|
|
python,
|
2022-06-26 10:26:21 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "systemd";
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "235";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "systemd";
|
|
|
|
repo = "python-systemd";
|
|
|
|
rev = "v${version}";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-8p4m4iM/z4o6PHRQIpuSXb64tPTWGlujEYCDVLiIt2o=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2022-06-26 10:26:21 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
buildInputs = [ systemd ];
|
2022-06-26 10:26:21 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytest ];
|
2023-03-04 12:14:45 +00:00
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
echo "12345678901234567890123456789012" > machine-id
|
|
|
|
export NIX_REDIRECTS=/etc/machine-id=$(realpath machine-id) \
|
|
|
|
LD_PRELOAD=${libredirect}/lib/libredirect.so
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
# Those tests assume /etc/machine-id to be available
|
|
|
|
# But our redirection technique does not work apparently
|
|
|
|
pytest $out/${python.sitePackages}/systemd -k 'not test_get_machine and not test_get_machine_app_specific and not test_reader_this_machine'
|
2023-03-04 12:14:45 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-06-26 10:26:21 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"systemd.journal"
|
|
|
|
"systemd.id128"
|
|
|
|
"systemd.daemon"
|
|
|
|
"systemd.login"
|
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Python module for native access to the systemd facilities";
|
2023-03-04 12:14:45 +00:00
|
|
|
homepage = "https://www.freedesktop.org/software/systemd/python-systemd/";
|
|
|
|
changelog = "https://github.com/systemd/python-systemd/blob/v${version}/NEWS";
|
2022-06-26 10:26:21 +00:00
|
|
|
license = licenses.lgpl21Plus;
|
2023-10-09 19:29:22 +00:00
|
|
|
maintainers = with maintainers; [ raitobezarius ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|