64 lines
1.4 KiB
Nix
64 lines
1.4 KiB
Nix
{
|
|
lib,
|
|
stdenv,
|
|
fetchFromGitHub,
|
|
python3Packages,
|
|
...
|
|
}:
|
|
|
|
python3Packages.buildPythonPackage rec {
|
|
pname = "python-roborock";
|
|
version = "2.39.0";
|
|
pyproject = true;
|
|
|
|
disabled = python3Packages.pythonOlder "3.11";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "humbertogontijo";
|
|
repo = "python-roborock";
|
|
tag = "v${version}";
|
|
hash = "sha256-V0zuUlJ0wPpxOKtY7ydbJ7mhWT5xGSLv19csmpWCO1Q=";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace pyproject.toml \
|
|
--replace-fail "poetry-core==1.8.0" "poetry-core"
|
|
'';
|
|
|
|
pythonRelaxDeps = [ "pycryptodome" ];
|
|
|
|
build-system = with python3Packages; [ poetry-core ];
|
|
|
|
dependencies = with python3Packages; [
|
|
aiohttp
|
|
aiomqtt
|
|
async-timeout
|
|
click
|
|
construct
|
|
dacite
|
|
paho-mqtt
|
|
pycryptodome
|
|
pyrate-limiter
|
|
vacuum-map-parser-roborock
|
|
pyshark
|
|
]
|
|
++ lib.optionals stdenv.hostPlatform.isDarwin [ pycryptodomex ];
|
|
|
|
nativeCheckInputs = with python3Packages; [
|
|
aioresponses
|
|
freezegun
|
|
pytest-asyncio
|
|
pytestCheckHook
|
|
];
|
|
|
|
pythonImportsCheck = [ "roborock" ];
|
|
|
|
meta = with lib; {
|
|
description = "Python library & console tool for controlling Roborock vacuum";
|
|
homepage = "https://github.com/humbertogontijo/python-roborock";
|
|
changelog = "https://github.com/humbertogontijo/python-roborock/blob/${src.tag}/CHANGELOG.md";
|
|
license = licenses.gpl3Only;
|
|
maintainers = with maintainers; [ fab ];
|
|
mainProgram = "roborock";
|
|
};
|
|
} |