2021-10-06 13:57:05 +00:00
|
|
|
{ lib
|
2024-04-21 15:54:59 +00:00
|
|
|
, dbus
|
2021-10-06 13:57:05 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, python3
|
|
|
|
}:
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
python3.pkgs.buildPythonApplication rec {
|
2021-10-06 13:57:05 +00:00
|
|
|
pname = "autosuspend";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "7.0.0";
|
2023-10-19 13:55:26 +00:00
|
|
|
|
2024-05-15 15:35:15 +00:00
|
|
|
disabled = python3.pythonOlder "3.10";
|
2021-10-06 13:57:05 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "languitar";
|
|
|
|
repo = pname;
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-AJ0ZWRxqhBJEics6XnIVWyf7pJI8MphQU4LRqSYYNSQ=";
|
2021-10-06 13:57:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.cfg \
|
2024-04-21 15:54:59 +00:00
|
|
|
--replace-fail '--cov-config=setup.cfg' ""
|
2021-10-06 13:57:05 +00:00
|
|
|
'';
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = with python3.pkgs; [
|
2023-11-16 04:20:00 +00:00
|
|
|
dbus-python
|
|
|
|
icalendar
|
|
|
|
jsonpath-ng
|
|
|
|
lxml
|
|
|
|
mpd2
|
2021-10-06 13:57:05 +00:00
|
|
|
portalocker
|
|
|
|
psutil
|
2023-11-16 04:20:00 +00:00
|
|
|
python-dateutil
|
|
|
|
pytz
|
2021-10-06 13:57:05 +00:00
|
|
|
requests
|
|
|
|
requests-file
|
|
|
|
tzlocal
|
2023-11-16 04:20:00 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
nativeCheckInputs = with python3.pkgs; [
|
|
|
|
dbus
|
2023-11-16 04:20:00 +00:00
|
|
|
freezegun
|
2021-10-06 13:57:05 +00:00
|
|
|
pytest-datadir
|
2023-11-16 04:20:00 +00:00
|
|
|
pytest-httpserver
|
|
|
|
pytest-mock
|
|
|
|
pytestCheckHook
|
|
|
|
python-dbusmock
|
2021-10-06 13:57:05 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Disable tests that need root
|
|
|
|
disabledTests = [
|
|
|
|
"test_smoke"
|
|
|
|
"test_multiple_sessions"
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
2023-10-19 13:55:26 +00:00
|
|
|
meta = with lib; {
|
2021-10-06 13:57:05 +00:00
|
|
|
description = "A daemon to automatically suspend and wake up a system";
|
|
|
|
homepage = "https://autosuspend.readthedocs.io";
|
2023-10-19 13:55:26 +00:00
|
|
|
changelog = "https://github.com/languitar/autosuspend/releases/tag/v${version}";
|
2021-10-06 13:57:05 +00:00
|
|
|
license = licenses.gpl2Only;
|
2023-10-19 13:55:26 +00:00
|
|
|
maintainers = with maintainers; [ bzizou anthonyroussel ];
|
|
|
|
mainProgram = "autosuspend";
|
2021-10-06 13:57:05 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
};
|
|
|
|
}
|