2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
2024-07-27 06:49:29 +00:00
|
|
|
runCommand,
|
|
|
|
|
|
|
|
# build-system
|
|
|
|
setuptools,
|
|
|
|
setuptools-scm,
|
|
|
|
|
|
|
|
# dependencies
|
|
|
|
dbus-python,
|
|
|
|
|
|
|
|
# checks
|
2024-06-05 15:53:02 +00:00
|
|
|
dbus,
|
|
|
|
gobject-introspection,
|
|
|
|
pygobject3,
|
|
|
|
bluez,
|
|
|
|
networkmanager,
|
2024-07-27 06:49:29 +00:00
|
|
|
pytestCheckHook,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2022-08-21 13:32:41 +00:00
|
|
|
let
|
|
|
|
# Cannot just add it to path in preCheck since that attribute will be passed to
|
|
|
|
# mkDerivation even with doCheck = false, causing a dependency cycle.
|
|
|
|
pbap-client = runCommand "pbap-client" { } ''
|
|
|
|
mkdir -p "$out/bin"
|
|
|
|
ln -s "${bluez.test}/test/pbap-client" "$out/bin/pbap-client"
|
|
|
|
'';
|
2024-06-05 15:53:02 +00:00
|
|
|
in
|
|
|
|
buildPythonPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "python-dbusmock";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.31.1";
|
2024-07-27 06:49:29 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "martinpitt";
|
|
|
|
repo = pname;
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-DdV78o089Jkc7mSsGvlJgVpv8kPpMILo7lC6EbLxkxg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
build-system = [
|
|
|
|
setuptools
|
|
|
|
setuptools-scm
|
|
|
|
];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
dependencies = [ dbus-python ];
|
2022-08-12 12:06:08 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-08-12 12:06:08 +00:00
|
|
|
dbus
|
2024-05-15 15:35:15 +00:00
|
|
|
gobject-introspection
|
2022-08-12 12:06:08 +00:00
|
|
|
pygobject3
|
|
|
|
bluez
|
2022-08-21 13:32:41 +00:00
|
|
|
pbap-client
|
2022-08-12 12:06:08 +00:00
|
|
|
networkmanager
|
2024-07-27 06:49:29 +00:00
|
|
|
pytestCheckHook
|
2022-08-12 12:06:08 +00:00
|
|
|
];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
disabledTests = [
|
|
|
|
# wants to call upower, which is a reverse-dependency
|
|
|
|
"test_dbusmock_test_template"
|
|
|
|
# Failed to execute program org.TestSystem: No such file or directory
|
|
|
|
"test_system_service_activation"
|
|
|
|
"test_session_service_activation"
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2024-07-27 06:49:29 +00:00
|
|
|
changelog = "https://github.com/martinpitt/python-dbusmock/releases/tag/${version}";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Mock D-Bus objects for tests";
|
|
|
|
homepage = "https://github.com/martinpitt/python-dbusmock";
|
|
|
|
license = licenses.lgpl3Plus;
|
|
|
|
maintainers = with maintainers; [ callahad ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|