2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
fetchFromGitHub,
|
|
|
|
fetchpatch,
|
|
|
|
poetry-core,
|
|
|
|
pythonRelaxDepsHook,
|
|
|
|
requests,
|
|
|
|
urllib3,
|
|
|
|
pytestCheckHook,
|
2021-06-28 23:13:55 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "synologydsm-api";
|
|
|
|
version = "1.0.2";
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
pyproject = true;
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "hacf-fr";
|
|
|
|
repo = "synologydsm-api";
|
|
|
|
rev = "v${version}";
|
2024-01-25 14:12:00 +00:00
|
|
|
hash = "sha256-UQdPwvRdv7SCOTxkA1bfskQ9oL/DB0j1TdJE04ODyj8=";
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# https://github.com/hacf-fr/synologydsm-api/pull/84
|
|
|
|
(fetchpatch {
|
|
|
|
name = "switch-to-poetry-core.patch";
|
|
|
|
url = "https://github.com/hacf-fr/synologydsm-api/commit/f1ea2be927388bdff6d43d09027b82a854635e34.patch";
|
2024-01-25 14:12:00 +00:00
|
|
|
hash = "sha256-+c25zLkTtjeX7IE+nZEnjrWfnDhDJpeHN7qRKO5rF4g=";
|
2021-06-28 23:13:55 +00:00
|
|
|
})
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
2024-01-25 14:12:00 +00:00
|
|
|
pythonRelaxDepsHook
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonRelaxDeps = [ "urllib3" ];
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
requests
|
|
|
|
urllib3
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "synology_dsm" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Python API for communication with Synology DSM";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "synologydsm-api";
|
2021-06-28 23:13:55 +00:00
|
|
|
homepage = "https://github.com/hacf-fr/synologydsm-api";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|