2022-08-12 12:06:08 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, nose
|
|
|
|
, dbus
|
|
|
|
, dbus-python
|
|
|
|
, pygobject3
|
|
|
|
, bluez
|
|
|
|
, networkmanager
|
|
|
|
, setuptools-scm
|
2022-08-21 13:32:41 +00:00
|
|
|
, runCommand
|
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"
|
|
|
|
'';
|
|
|
|
in buildPythonPackage rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "python-dbusmock";
|
2023-03-15 16:39:30 +00:00
|
|
|
version = "0.28.7";
|
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}";
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-AxRgoXPiFFFHQSj5/jU55hwWzHtutfjmD2IKGxYwd0A=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
SETUPTOOLS_SCM_PRETEND_VERSION = version;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
dbus-python
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-08-12 12:06:08 +00:00
|
|
|
dbus
|
|
|
|
pygobject3
|
|
|
|
bluez
|
2022-08-21 13:32:41 +00:00
|
|
|
pbap-client
|
2022-08-12 12:06:08 +00:00
|
|
|
networkmanager
|
|
|
|
nose
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# TODO: Get the rest of these tests running?
|
|
|
|
NOSE_EXCLUDE = lib.concatStringsSep "," [
|
|
|
|
"test_bluez4" # NixOS ships BlueZ5
|
|
|
|
# These appear to fail because they're expecting to run in an Ubuntu chroot?
|
|
|
|
"test_everything" # BlueZ5 OBEX
|
|
|
|
"test_polkitd"
|
|
|
|
"test_consolekit"
|
|
|
|
"test_api"
|
|
|
|
"test_logind"
|
|
|
|
"test_notification_daemon"
|
|
|
|
"test_ofono"
|
|
|
|
"test_gnome_screensaver"
|
|
|
|
"test_cli"
|
|
|
|
"test_timedated"
|
|
|
|
"test_upower"
|
2022-02-10 20:34:41 +00:00
|
|
|
# needs glib
|
|
|
|
"test_accounts_service"
|
|
|
|
# needs dbus-daemon active
|
|
|
|
"test_systemd"
|
2020-04-24 23:36:52 +00:00
|
|
|
# Very slow, consider disabling?
|
|
|
|
# "test_networkmanager"
|
|
|
|
];
|
|
|
|
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
nosetests -v
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Mock D-Bus objects for tests";
|
|
|
|
homepage = "https://github.com/martinpitt/python-dbusmock";
|
|
|
|
license = licenses.lgpl3Plus;
|
|
|
|
maintainers = with maintainers; [ callahad ];
|
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|