1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, bitbox02
5, ecdsa
6, hidapi
7, libusb1
8, mnemonic
9, pyaes
10, typing-extensions
11}:
12
13buildPythonPackage rec {
14 pname = "hwi";
15 version = "2.0.2";
16
17 src = fetchFromGitHub {
18 owner = "bitcoin-core";
19 repo = "HWI";
20 rev = version;
21 sha256 = "sha256-s0pKYqesZjHE6YndqsMwCuqLK7eE82oRiSXxBdUtEX4=";
22 };
23
24 propagatedBuildInputs = [
25 bitbox02
26 ecdsa
27 hidapi
28 libusb1
29 mnemonic
30 pyaes
31 typing-extensions
32 ];
33
34 # make compatible with libusb1 2.x
35 postPatch = ''
36 substituteInPlace setup.py \
37 --replace 'libusb1>=1.7,<2.0' 'libusb1>=1.7'
38 '';
39
40 # tests require to clone quite a few firmwares
41 doCheck = false;
42
43 pythonImportsCheck = [ "hwilib" ];
44
45 meta = {
46 description = "Bitcoin Hardware Wallet Interface";
47 homepage = "https://github.com/bitcoin-core/hwi";
48 license = with lib.licenses; [ mit ];
49 maintainers = with lib.maintainers; [ prusnak ];
50 };
51}