Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{
2 lib,
3 buildPythonPackage,
4 distro,
5 fetchFromGitHub,
6 pyasyncore,
7 pysnmp,
8 pysnmplib,
9 pytestCheckHook,
10 python-gnupg,
11 pythonAtLeast,
12 qrcode,
13 requests,
14 setuptools,
15}:
16
17buildPythonPackage rec {
18 pname = "blocksat-cli";
19 version = "2.5.1";
20 pyproject = true;
21
22 src = fetchFromGitHub {
23 owner = "Blockstream";
24 repo = "satellite";
25 tag = "v${version}";
26 hash = "sha256-SH1MZx/ZkhhWhxhREqFCGoob58J2XMZSpe+q7UgiyF4=";
27 };
28
29 # Upstream setup.py installs both the CLI and GUI versions.
30 # To pull only the required dependencyes, either setup_cli.py or setup_gui.py should be used.
31 postPatch = ''
32 mv setup_cli.py setup.py
33 '';
34
35 pythonRelaxDeps = [ "pyasyncore" ];
36
37 build-system = [ setuptools ];
38
39 dependencies = [
40 distro
41 pysnmp
42 pysnmplib
43 python-gnupg
44 qrcode
45 requests
46 ]
47 ++ lib.optionals (pythonAtLeast "3.12") [ pyasyncore ];
48
49 nativeCheckInputs = [ pytestCheckHook ];
50
51 disabledTests = [
52 "test_monitor_get_stats"
53 "test_monitor_update_with_reporting_enabled"
54 "test_erasure_recovery"
55 # Non-NixOS package managers are not present in the build environment.
56 "test_parse_upgradable_list_apt"
57 "test_parse_upgradable_list_dnf"
58 # Fails due to GPG clearsign output lacking trailing newline in some setups.
59 "test_clearsign_verification"
60 ];
61
62 disabledTestPaths = [ "blocksatgui/tests/" ];
63
64 pythonImportsCheck = [ "blocksatcli" ];
65
66 meta = {
67 description = "Blockstream Satellite CLI";
68 homepage = "https://github.com/Blockstream/satellite";
69 changelog = "https://github.com/Blockstream/satellite/releases/tag/${src.tag}";
70 license = lib.licenses.gpl3Only;
71 maintainers = with lib.maintainers; [ prusnak ];
72 mainProgram = "blocksat-cli";
73 };
74}