1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 runCommand, 6 7 # build-system 8 setuptools, 9 setuptools-scm, 10 11 # dependencies 12 dbus-python, 13 14 # checks 15 dbus, 16 gobject-introspection, 17 pygobject3, 18 bluez, 19 networkmanager, 20 pytestCheckHook, 21}: 22 23let 24 # Cannot just add it to path in preCheck since that attribute will be passed to 25 # mkDerivation even with doCheck = false, causing a dependency cycle. 26 pbap-client = runCommand "pbap-client" { } '' 27 mkdir -p "$out/bin" 28 ln -s "${bluez.test}/test/pbap-client" "$out/bin/pbap-client" 29 ''; 30in 31buildPythonPackage rec { 32 pname = "python-dbusmock"; 33 version = "0.36.0"; 34 pyproject = true; 35 36 src = fetchFromGitHub { 37 owner = "martinpitt"; 38 repo = "python-dbusmock"; 39 tag = version; 40 hash = "sha256-9YnMOQUuwAcrL0ZaQr7iGly9esZaSRIFThQRNUtSndo="; 41 }; 42 43 build-system = [ 44 setuptools 45 setuptools-scm 46 ]; 47 48 dependencies = [ dbus-python ]; 49 50 nativeCheckInputs = [ 51 dbus 52 gobject-introspection 53 pygobject3 54 bluez 55 pbap-client 56 networkmanager 57 pytestCheckHook 58 ]; 59 60 disabledTests = [ 61 # wants to call upower, which is a reverse-dependency 62 "test_dbusmock_test_template" 63 # Failed to execute program org.TestSystem: No such file or directory 64 "test_system_service_activation" 65 "test_session_service_activation" 66 ]; 67 68 meta = with lib; { 69 changelog = "https://github.com/martinpitt/python-dbusmock/releases/tag/${src.tag}"; 70 description = "Mock D-Bus objects for tests"; 71 homepage = "https://github.com/martinpitt/python-dbusmock"; 72 license = licenses.lgpl3Plus; 73 maintainers = with maintainers; [ callahad ]; 74 platforms = platforms.linux; 75 }; 76}