1{ lib
2, aiohttp
3, aiounittest
4, buildPythonPackage
5, fetchFromGitHub
6, ffmpeg-python
7, pytestCheckHook
8, pythonOlder
9, requests
10}:
11
12buildPythonPackage rec {
13 pname = "reolink";
14 version = "0.64";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.8";
18
19 src = fetchFromGitHub {
20 owner = "fwestenberg";
21 repo = pname;
22 rev = "refs/tags/v${version}";
23 hash = "sha256-3r5BwVlNolji2HIGjqv8gkizx4wWxrKYkiNmSJedKmI=";
24 };
25
26 propagatedBuildInputs = [
27 aiohttp
28 ffmpeg-python
29 requests
30 ];
31
32 nativeCheckInputs = [
33 aiounittest
34 pytestCheckHook
35 ];
36
37 postPatch = ''
38 # Packages in nixpkgs is different than the module name
39 substituteInPlace setup.py \
40 --replace "ffmpeg" "ffmpeg-python"
41 '';
42
43 # https://github.com/fwestenberg/reolink/issues/83
44 doCheck = false;
45
46 pytestFlagsArray = [
47 "test.py"
48 ];
49
50 disabledTests = [
51 # Tests require network access
52 "test1_settings"
53 "test2_states"
54 "test3_images"
55 "test4_properties"
56 "test_succes"
57 ];
58
59 pythonImportsCheck = [
60 "reolink"
61 ];
62
63 meta = with lib; {
64 description = "Module to interact with the Reolink IP camera API";
65 homepage = "https://github.com/fwestenberg/reolink";
66 changelog = "https://github.com/fwestenberg/reolink/releases/tag/v${version}";
67 license = with licenses; [ mit ];
68 maintainers = with maintainers; [ fab ];
69 };
70}