2020-04-24 23:36:52 +00:00
|
|
|
{ lib, fetchPypi, buildPythonPackage, isPy3k, python, pytest
|
|
|
|
, typing-extensions
|
|
|
|
, protobuf
|
|
|
|
, hidapi
|
|
|
|
, ecdsa
|
|
|
|
, mnemonic
|
|
|
|
, requests
|
|
|
|
, pyblake2
|
|
|
|
, click
|
|
|
|
, construct
|
|
|
|
, libusb1
|
|
|
|
, rlp
|
|
|
|
, shamir-mnemonic
|
|
|
|
, trezor-udev-rules
|
2020-08-20 17:08:02 +00:00
|
|
|
, installShellFiles
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "trezor";
|
2020-08-20 17:08:02 +00:00
|
|
|
version = "0.12.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
disabled = !isPy3k;
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-08-20 17:08:02 +00:00
|
|
|
sha256 = "1w19m9lws55k9sjhras47hpfpqwq1jm5vy135nj65yhkblygqg19";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [ typing-extensions protobuf hidapi ecdsa mnemonic requests pyblake2 click construct libusb1 rlp shamir-mnemonic trezor-udev-rules ];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytest
|
|
|
|
];
|
|
|
|
|
|
|
|
# disable test_tx_api.py as it requires being online
|
|
|
|
checkPhase = ''
|
|
|
|
runHook preCheck
|
|
|
|
pytest --pyargs tests --ignore tests/test_tx_api.py
|
|
|
|
runHook postCheck
|
|
|
|
'';
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
postFixup = ''
|
|
|
|
mkdir completions
|
|
|
|
_TREZORCTL_COMPLETE=source_bash $out/bin/trezorctl > completions/trezorctl || true
|
|
|
|
_TREZORCTL_COMPLETE=source_zsh $out/bin/trezorctl > completions/_trezorctl || true
|
|
|
|
_TREZORCTL_COMPLETE=source_fish $out/bin/trezorctl > completions/trezorctl.fish || true
|
|
|
|
installShellCompletion --bash completions/trezorctl
|
|
|
|
installShellCompletion --zsh completions/_trezorctl
|
|
|
|
installShellCompletion --fish completions/trezorctl.fish
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Python library for communicating with TREZOR Bitcoin Hardware Wallet";
|
|
|
|
homepage = "https://github.com/trezor/trezor-firmware/tree/master/python";
|
|
|
|
license = licenses.gpl3;
|
2020-08-20 17:08:02 +00:00
|
|
|
maintainers = with maintainers; [ np prusnak mmahut _1000101 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|