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