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
|
|
|
, shamir-mnemonic
|
2022-07-14 12:49:19 +00:00
|
|
|
, simple-rlp
|
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";
|
2022-07-14 12:49:19 +00:00
|
|
|
version = "0.13.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
disabled = !isPy3k;
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2022-07-14 12:49:19 +00:00
|
|
|
sha256 = "055d32174d4ecf2353f7622ee44b8e82e3bef78fe40ce5cdbeafc785b422a049";
|
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
|
|
|
|
shamir-mnemonic
|
2022-07-14 12:49:19 +00:00
|
|
|
simple-rlp
|
2020-09-25 04:45:31 +00:00
|
|
|
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
|
|
|
|
2021-12-26 17:43:05 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
"tests/test_stellar.py" # requires stellar-sdk
|
|
|
|
];
|
|
|
|
|
2022-07-14 12:49:19 +00:00
|
|
|
pythonImportsCheck = [ "trezorlib" ];
|
|
|
|
|
|
|
|
postCheck = ''
|
|
|
|
$out/bin/trezorctl --version
|
|
|
|
'';
|
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|