2020-11-03 02:18:15 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2020-09-25 04:45:31 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
|
|
|
, isPy3k
|
|
|
|
, installShellFiles
|
|
|
|
, attrs
|
2020-04-24 23:36:52 +00:00
|
|
|
, click
|
|
|
|
, construct
|
2020-09-25 04:45:31 +00:00
|
|
|
, ecdsa
|
|
|
|
, hidapi
|
2020-04-24 23:36:52 +00:00
|
|
|
, libusb1
|
2020-09-25 04:45:31 +00:00
|
|
|
, mnemonic
|
|
|
|
, pillow
|
|
|
|
, protobuf
|
|
|
|
, pyblake2
|
|
|
|
, requests
|
2020-04-24 23:36:52 +00:00
|
|
|
, rlp
|
|
|
|
, shamir-mnemonic
|
2020-09-25 04:45:31 +00:00
|
|
|
, typing-extensions
|
2020-04-24 23:36:52 +00:00
|
|
|
, trezor-udev-rules
|
2021-12-19 01:06:50 +00:00
|
|
|
, pytestCheckHook
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "trezor";
|
2021-09-18 10:52:07 +00:00
|
|
|
version = "0.12.4";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
disabled = !isPy3k;
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2021-09-18 10:52:07 +00:00
|
|
|
sha256 = "3e180d9f9f8b69176b5ef36311b6161f5b793b538eb2dfd4babbb4d3fb1e374e";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
nativeBuildInputs = [ installShellFiles ];
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
attrs
|
|
|
|
click
|
|
|
|
construct
|
|
|
|
ecdsa
|
|
|
|
hidapi
|
|
|
|
libusb1
|
|
|
|
mnemonic
|
|
|
|
pillow
|
|
|
|
protobuf
|
|
|
|
pyblake2
|
|
|
|
requests
|
|
|
|
rlp
|
|
|
|
shamir-mnemonic
|
|
|
|
typing-extensions
|
2020-11-03 02:18:15 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
2020-09-25 04:45:31 +00:00
|
|
|
trezor-udev-rules
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-19 01:06:50 +00:00
|
|
|
checkInputs = [ pytestCheckHook ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
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; {
|
2020-09-25 04:45:31 +00:00
|
|
|
description = "Python library for communicating with Trezor Hardware Wallet";
|
2020-04-24 23:36:52 +00:00
|
|
|
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
|
|
|
};
|
|
|
|
}
|