Merge pull request #212682 from SuperSandro2000/py-systemd

authored by

Sandro and committed by
GitHub
350527ac c6494760

+19 -15
+19 -15
pkgs/development/python-modules/systemd/default.nix
··· 1 { lib 2 , buildPythonPackage 3 - , fetchpatch 4 , fetchFromGitHub 5 , systemd 6 , pkg-config 7 }: 8 9 buildPythonPackage rec { 10 pname = "systemd"; 11 - version = "234"; 12 13 src = fetchFromGitHub { 14 owner = "systemd"; 15 repo = "python-systemd"; 16 rev = "v${version}"; 17 - sha256 = "1fakw7qln44mfd6pj4kqsgyrhkc6cyr653id34kv0rdnb1bvysrz"; 18 }; 19 - 20 - patches = [ 21 - # Fix runtime issues on Python 3.10 22 - # https://github.com/systemd/python-systemd/issues/107 23 - (fetchpatch { 24 - url = "https://github.com/systemd/python-systemd/commit/c71bbac357f0ac722e1bcb2edfa925b68cca23c9.patch"; 25 - sha256 = "22s72Wa/BCwNNvwbxEUh58jhHlbA00SNwNVchVDovcc="; 26 - }) 27 - ]; 28 29 nativeBuildInputs = [ 30 pkg-config ··· 34 systemd 35 ]; 36 37 - # No module named 'systemd._journal 38 - doCheck = false; 39 40 pythonImportsCheck = [ 41 "systemd.journal" ··· 46 47 meta = with lib; { 48 description = "Python module for native access to the systemd facilities"; 49 - homepage = "http://www.freedesktop.org/software/systemd/python-systemd/"; 50 license = licenses.lgpl21Plus; 51 }; 52 }
··· 1 { lib 2 , buildPythonPackage 3 , fetchFromGitHub 4 + , libredirect 5 , systemd 6 , pkg-config 7 + , pytest 8 + , python 9 }: 10 11 buildPythonPackage rec { 12 pname = "systemd"; 13 + version = "235"; 14 15 src = fetchFromGitHub { 16 owner = "systemd"; 17 repo = "python-systemd"; 18 rev = "v${version}"; 19 + sha256 = "sha256-8p4m4iM/z4o6PHRQIpuSXb64tPTWGlujEYCDVLiIt2o="; 20 }; 21 22 nativeBuildInputs = [ 23 pkg-config ··· 27 systemd 28 ]; 29 30 + nativeCheckInputs = [ 31 + pytest 32 + ]; 33 + 34 + checkPhase = '' 35 + echo "12345678901234567890123456789012" > machine-id 36 + export NIX_REDIRECTS=/etc/machine-id=$(realpath machine-id) \ 37 + LD_PRELOAD=${libredirect}/lib/libredirect.so 38 + 39 + pytest $out/${python.sitePackages}/systemd 40 + ''; 41 42 pythonImportsCheck = [ 43 "systemd.journal" ··· 48 49 meta = with lib; { 50 description = "Python module for native access to the systemd facilities"; 51 + homepage = "https://www.freedesktop.org/software/systemd/python-systemd/"; 52 + changelog = "https://github.com/systemd/python-systemd/blob/v${version}/NEWS"; 53 license = licenses.lgpl21Plus; 54 + maintainers = with maintainers; [ SuperSandro2000 ]; 55 }; 56 }