2023-01-11 07:51:40 +00:00
|
|
|
{ lib
|
|
|
|
, aiohttp
|
|
|
|
, aiounittest
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, ffmpeg-python
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, requests
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "reolink-aio";
|
2023-03-04 12:14:45 +00:00
|
|
|
version = "0.5.2";
|
2023-01-11 07:51:40 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.9";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "starkillerOG";
|
|
|
|
repo = "reolink_aio";
|
|
|
|
rev = "refs/tags/${version}";
|
2023-03-04 12:14:45 +00:00
|
|
|
hash = "sha256-GLBekTsJqwzwtSYiYaJSeTt7qNs0gx2nOhlsfECFvKg=";
|
2023-01-11 07:51:40 +00:00
|
|
|
};
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Packages in nixpkgs is different than the module name
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "ffmpeg" "ffmpeg-python"
|
|
|
|
'';
|
2023-01-11 07:51:40 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
aiohttp
|
|
|
|
ffmpeg-python
|
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
doCheck = false; # all testse require a network device
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
2023-01-11 07:51:40 +00:00
|
|
|
aiounittest
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
"tests/test.py"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Tests require network access
|
|
|
|
"test1_settings"
|
|
|
|
"test2_states"
|
|
|
|
"test3_images"
|
|
|
|
"test4_properties"
|
|
|
|
"test_succes"
|
2023-02-02 18:25:31 +00:00
|
|
|
"test_wrong_host"
|
2023-01-20 10:41:00 +00:00
|
|
|
"test_wrong_password"
|
2023-02-02 18:25:31 +00:00
|
|
|
"test_wrong_user"
|
2023-01-11 07:51:40 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"reolink_aio"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Module to interact with the Reolink IP camera API";
|
|
|
|
homepage = "https://github.com/starkillerOG/reolink_aio";
|
|
|
|
changelog = "https://github.com/starkillerOG/reolink_aio/releases/tag/${version}";
|
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|