at 24.11-pre 1.4 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 libredirect, 6 systemd, 7 pkg-config, 8 pytest, 9 python, 10}: 11 12buildPythonPackage rec { 13 pname = "systemd"; 14 version = "235"; 15 format = "setuptools"; 16 17 src = fetchFromGitHub { 18 owner = "systemd"; 19 repo = "python-systemd"; 20 rev = "v${version}"; 21 hash = "sha256-8p4m4iM/z4o6PHRQIpuSXb64tPTWGlujEYCDVLiIt2o="; 22 }; 23 24 nativeBuildInputs = [ pkg-config ]; 25 26 buildInputs = [ systemd ]; 27 28 nativeCheckInputs = [ pytest ]; 29 30 checkPhase = '' 31 echo "12345678901234567890123456789012" > machine-id 32 export NIX_REDIRECTS=/etc/machine-id=$(realpath machine-id) \ 33 LD_PRELOAD=${libredirect}/lib/libredirect.so 34 35 # Those tests assume /etc/machine-id to be available 36 # But our redirection technique does not work apparently 37 pytest $out/${python.sitePackages}/systemd -k 'not test_get_machine and not test_get_machine_app_specific and not test_reader_this_machine' 38 ''; 39 40 pythonImportsCheck = [ 41 "systemd.journal" 42 "systemd.id128" 43 "systemd.daemon" 44 "systemd.login" 45 ]; 46 47 meta = with lib; { 48 description = "Python module for native access to the systemd facilities"; 49 homepage = "https://www.freedesktop.org/software/systemd/python-systemd/"; 50 changelog = "https://github.com/systemd/python-systemd/blob/v${version}/NEWS"; 51 license = licenses.lgpl21Plus; 52 maintainers = with maintainers; [ raitobezarius ]; 53 }; 54}