1{
2 lib,
3 buildPythonPackage,
4 distro,
5 fetchFromGitHub,
6 pyasyncore,
7 pysnmp,
8 pytestCheckHook,
9 python-gnupg,
10 pythonAtLeast,
11 pythonOlder,
12 qrcode,
13 requests,
14 setuptools,
15}:
16
17buildPythonPackage rec {
18 pname = "blocksat-cli";
19 version = "2.4.6";
20 pyproject = true;
21
22 disabled = pythonOlder "3.8";
23
24 src = fetchFromGitHub {
25 owner = "Blockstream";
26 repo = "satellite";
27 rev = "refs/tags/v${version}";
28 hash = "sha256-1gz2lAS/AHeY54AaVXGeofLC68KjAP7POsIaBL3v2EY=";
29 };
30
31 nativeBuildInputs = [ setuptools ];
32
33 propagatedBuildInputs = [
34 distro
35 pysnmp
36 python-gnupg
37 qrcode
38 requests
39 ] ++ lib.optionals (pythonAtLeast "3.12") [ pyasyncore ];
40
41 nativeCheckInputs = [ pytestCheckHook ];
42
43 disabledTests = [
44 "test_monitor_get_stats"
45 "test_monitor_update_with_reporting_enabled"
46 "test_erasure_recovery"
47 ];
48
49 pythonImportsCheck = [ "blocksatcli" ];
50
51 meta = with lib; {
52 description = "Blockstream Satellite CLI";
53 mainProgram = "blocksat-cli";
54 homepage = "https://github.com/Blockstream/satellite";
55 changelog = "https://github.com/Blockstream/satellite/releases/tag/v${version}";
56 license = licenses.gpl3Only;
57 maintainers = with maintainers; [ prusnak ];
58 };
59}