1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, bitbox02
5, cbor
6, ecdsa
7, hidapi
8, libusb1
9, mnemonic
10, pyaes
11, pyserial
12, typing-extensions
13, pythonOlder
14}:
15
16buildPythonPackage rec {
17 pname = "hwi";
18 version = "2.1.1";
19 format = "setuptools";
20
21 src = fetchFromGitHub {
22 owner = "bitcoin-core";
23 repo = "HWI";
24 rev = version;
25 sha256 = "sha256-jsJjGezf2JrPYr3YNZGx23Jo14DbmM1S6bu7+xgZh58=";
26 };
27
28 propagatedBuildInputs = [
29 bitbox02
30 cbor
31 ecdsa
32 hidapi
33 libusb1
34 mnemonic
35 pyaes
36 pyserial
37 typing-extensions
38 ];
39
40 # relax required dependencies:
41 # libusb1 - https://github.com/bitcoin-core/HWI/issues/579
42 # typing-extensions - https://github.com/bitcoin-core/HWI/issues/572
43 postPatch = ''
44 substituteInPlace setup.py \
45 --replace 'libusb1>=1.7,<3' 'libusb1>=1.7,<4' \
46 --replace 'typing-extensions>=3.7,<4.0' 'typing-extensions>=3.7,<5.0'
47 '';
48
49 # tests require to clone quite a few firmwares
50 doCheck = false;
51
52 pythonImportsCheck = [
53 "hwilib"
54 ];
55
56 meta = with lib; {
57 description = "Bitcoin Hardware Wallet Interface";
58 homepage = "https://github.com/bitcoin-core/hwi";
59 license = with licenses; [ mit ];
60 maintainers = with maintainers; [ prusnak ];
61 };
62}