1{ lib, stdenv
2, fetchFromGitHub
3, buildPythonPackage
4, cryptography
5, click
6, construct
7, ecdsa
8, hidapi
9, intelhex
10, pillow
11, protobuf
12, requests
13, tabulate
14, AppKit
15}:
16
17buildPythonPackage rec {
18 pname = "ledgerwallet";
19 version = "0.1.2";
20
21 src = fetchFromGitHub {
22 owner = "LedgerHQ";
23 repo = "ledgerctl";
24 rev = "v${version}";
25 sha256 = "0fb93h2wxm9as9rsywlgz2ng4wrlbjphn6mgbhj6nls2i86rrdxk";
26 };
27
28 patches = [
29 # Fix removed function in construct library
30 # https://github.com/LedgerHQ/ledgerctl/issues/17
31 # https://github.com/construct/construct/commit/8915512f53552b1493afdbce5bbf8bb6f2aa4411
32 ./remove-iterateints.patch
33 ];
34
35 buildInputs = lib.optionals stdenv.isDarwin [ AppKit ];
36 propagatedBuildInputs = [
37 cryptography click construct ecdsa hidapi intelhex pillow protobuf requests tabulate
38 ];
39
40 pythonImportsCheck = [ "ledgerwallet" ];
41
42 meta = with lib; {
43 homepage = "https://github.com/LedgerHQ/ledgerctl";
44 description = "A library to control Ledger devices";
45 license = licenses.mit;
46 maintainers = with maintainers; [ d-xo ];
47 };
48}