2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
aiohttp,
|
|
|
|
aiounittest,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
ffmpeg-python,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
requests,
|
2021-12-19 01:06:50 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "reolink";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0053";
|
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-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-DZcTfmzO9rBhhRN2RkgoPwUPE+LPPeZgc8kmhYU9V2I=";
|
2021-12-19 01:06:50 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
aiohttp
|
|
|
|
ffmpeg-python
|
|
|
|
requests
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-12-19 01:06:50 +00:00
|
|
|
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;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pytestFlagsArray = [ "test.py" ];
|
2021-12-19 01:06:50 +00:00
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Tests require network access
|
|
|
|
"test1_settings"
|
|
|
|
"test2_states"
|
|
|
|
"test3_images"
|
|
|
|
"test4_properties"
|
|
|
|
"test_succes"
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "reolink" ];
|
2021-12-19 01:06:50 +00:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|