2021-10-06 13:57:05 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, python3
|
|
|
|
}:
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
let
|
|
|
|
python = python3.override {
|
|
|
|
packageOverrides = self: super: {
|
|
|
|
# autosuspend is incompatible with tzlocal v5
|
|
|
|
# See https://github.com/regebro/tzlocal#api-change
|
|
|
|
tzlocal = super.tzlocal.overridePythonAttrs (prev: {
|
|
|
|
src = prev.src.override {
|
|
|
|
version = "4.3.1";
|
|
|
|
hash = "sha256-7jLvjCCAPBmpbtNmrd09SnKe9jCctcc1mgzC7ut/pGo=";
|
|
|
|
};
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
python.pkgs.buildPythonApplication rec {
|
2021-10-06 13:57:05 +00:00
|
|
|
pname = "autosuspend";
|
2023-10-19 13:55:26 +00:00
|
|
|
version = "6.0.0";
|
|
|
|
|
|
|
|
disabled = python3.pythonOlder "3.8";
|
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}";
|
2023-10-19 13:55:26 +00:00
|
|
|
hash = "sha256-gS8NNks4GaIGl7cEqWSP53I4/tIV4LypkmZ5vNOjspY=";
|
2021-10-06 13:57:05 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.cfg \
|
|
|
|
--replace '--cov-config=setup.cfg' ""
|
|
|
|
'';
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
propagatedBuildInputs = with python.pkgs; [
|
|
|
|
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
|
|
|
];
|
|
|
|
|
|
|
|
nativeCheckInputs = with python.pkgs; [
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|