2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
stdenv,
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
isPy3k,
|
|
|
|
installShellFiles,
|
|
|
|
attrs,
|
|
|
|
click,
|
|
|
|
construct,
|
|
|
|
construct-classes,
|
|
|
|
ecdsa,
|
|
|
|
hidapi,
|
|
|
|
libusb1,
|
|
|
|
mnemonic,
|
|
|
|
pillow,
|
|
|
|
protobuf,
|
|
|
|
requests,
|
|
|
|
shamir-mnemonic,
|
|
|
|
simple-rlp,
|
|
|
|
typing-extensions,
|
|
|
|
trezor-udev-rules,
|
|
|
|
pytestCheckHook,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "trezor";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "0.13.8";
|
2024-01-02 11:29:13 +00:00
|
|
|
format = "setuptools";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
disabled = !isPy3k;
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-Y01O3fNWAyV8MhYY2FSMajWyc4Rle2XjsL261jWlfP8=";
|
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
|
2022-11-21 17:40:18 +00:00
|
|
|
construct-classes
|
2020-09-25 04:45:31 +00:00
|
|
|
ecdsa
|
|
|
|
hidapi
|
|
|
|
libusb1
|
|
|
|
mnemonic
|
|
|
|
pillow
|
|
|
|
protobuf
|
|
|
|
requests
|
|
|
|
shamir-mnemonic
|
2022-07-14 12:49:19 +00:00
|
|
|
simple-rlp
|
2020-09-25 04:45:31 +00:00
|
|
|
typing-extensions
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ lib.optionals stdenv.isLinux [ trezor-udev-rules ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [ 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-11-21 17:40:18 +00:00
|
|
|
"tests/test_firmware.py" # requires network downloads
|
2021-12-26 17:43:05 +00:00
|
|
|
];
|
|
|
|
|
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";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "trezorctl";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/trezor/trezor-firmware/tree/master/python";
|
|
|
|
license = licenses.gpl3;
|
2024-06-05 15:53:02 +00:00
|
|
|
maintainers = with maintainers; [
|
|
|
|
np
|
|
|
|
prusnak
|
|
|
|
mmahut
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|