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