Files
nixpkgs/pkgs/development/python-modules/systemd/default.nix
Winter a19cd4ffb1 Revert "treewide: replace rev with tag"
This reverts commit 65a333600d.

This wasn't tested for correctness with something like fodwatch [0],
and should not have been (self-)merged so quickly, especially without
further review.

It also resulted in the breakage of at least one package [1] (and that's
the one we know of and was caught).

A few packages that were updated in between this commit and this revert
were not reverted back to using `rev`, but other than that, this is a
1:1 revert.

[0]: https://codeberg.org/raphaelr/fodwatch
[1]: https://github.com/NixOS/nixpkgs/pull/396904 / 758551e458
2025-04-08 02:57:25 -04:00

57 lines
1.4 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
libredirect,
systemd,
pkg-config,
pytest,
python,
}:
buildPythonPackage rec {
pname = "systemd";
version = "235";
format = "setuptools";
src = fetchFromGitHub {
owner = "systemd";
repo = "python-systemd";
rev = "v${version}";
hash = "sha256-8p4m4iM/z4o6PHRQIpuSXb64tPTWGlujEYCDVLiIt2o=";
};
nativeBuildInputs = [ pkg-config ];
buildInputs = [ systemd ];
nativeCheckInputs = [
libredirect.hook
pytest
];
checkPhase = ''
echo "12345678901234567890123456789012" > machine-id
export NIX_REDIRECTS=/etc/machine-id=$(realpath machine-id) \
# 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'
'';
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; [ raitobezarius ];
};
}