2021-12-19 01:06:50 +00:00
|
|
|
{ lib
|
|
|
|
, aiohttp
|
|
|
|
, aiounittest
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, ffmpeg-python
|
|
|
|
, pytestCheckHook
|
|
|
|
, pythonOlder
|
|
|
|
, requests
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "reolink";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "0.63";
|
2021-12-19 01:06:50 +00:00
|
|
|
format = "setuptools";
|
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "fwestenberg";
|
|
|
|
repo = pname;
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2023-01-20 10:41:00 +00:00
|
|
|
hash = "sha256-qwS7frXRk4gCBoAyBFLlbpYsyQZYqMLGB/pdznwyCoA=";
|
2021-12-19 01:06:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
aiohttp
|
|
|
|
ffmpeg-python
|
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
aiounittest
|
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# Packages in nixpkgs is different than the module name
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace "ffmpeg" "ffmpeg-python"
|
|
|
|
'';
|
|
|
|
|
|
|
|
# https://github.com/fwestenberg/reolink/issues/83
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pytestFlagsArray = [
|
|
|
|
"test.py"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Tests require network access
|
|
|
|
"test1_settings"
|
|
|
|
"test2_states"
|
|
|
|
"test3_images"
|
|
|
|
"test4_properties"
|
|
|
|
"test_succes"
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"reolink"
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
2023-01-11 07:51:40 +00:00
|
|
|
description = "Module to interact with the Reolink IP camera API";
|
2021-12-19 01:06:50 +00:00
|
|
|
homepage = "https://github.com/fwestenberg/reolink";
|
2023-01-11 07:51:40 +00:00
|
|
|
changelog = "https://github.com/fwestenberg/reolink/releases/tag/v${version}";
|
2021-12-19 01:06:50 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|