aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/python-modules/trezor/default.nix
diff options
context:
space:
mode:
authorMx Kookie <kookie@spacekookie.de>2020-10-31 19:35:09 +0100
committerMx Kookie <kookie@spacekookie.de>2020-10-31 19:35:09 +0100
commitc4625b175f8200f643fd6e11010932ea44c78433 (patch)
treebce3f89888c8ac3991fa5569a878a9eab6801ccc /infra/libkookie/nixpkgs/pkgs/development/python-modules/trezor/default.nix
parent49f735974dd103039ddc4cb576bb76555164a9e7 (diff)
parentd661aa56a8843e991261510c1bb28fdc2f6975ae (diff)
Add 'infra/libkookie/' from commit 'd661aa56a8843e991261510c1bb28fdc2f6975ae'
git-subtree-dir: infra/libkookie git-subtree-mainline: 49f735974dd103039ddc4cb576bb76555164a9e7 git-subtree-split: d661aa56a8843e991261510c1bb28fdc2f6975ae
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/python-modules/trezor/default.nix')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/python-modules/trezor/default.nix82
1 files changed, 82 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/python-modules/trezor/default.nix b/infra/libkookie/nixpkgs/pkgs/development/python-modules/trezor/default.nix
new file mode 100644
index 000000000000..0e0c6da021fb
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/development/python-modules/trezor/default.nix
@@ -0,0 +1,82 @@
+{ lib
+, buildPythonPackage
+, fetchPypi
+, isPy3k
+, installShellFiles
+, attrs
+, click
+, construct
+, ecdsa
+, hidapi
+, libusb1
+, mnemonic
+, pillow
+, protobuf
+, pyblake2
+, requests
+, rlp
+, shamir-mnemonic
+, typing-extensions
+, trezor-udev-rules
+, pytest
+}:
+
+buildPythonPackage rec {
+ pname = "trezor";
+ version = "0.12.2";
+
+ disabled = !isPy3k;
+
+ src = fetchPypi {
+ inherit pname version;
+ sha256 = "0r0j0y0ii62ppawc8qqjyaq0fkmmb0zk1xb3f9navxp556w2dljv";
+ };
+
+ nativeBuildInputs = [ installShellFiles ];
+
+ propagatedBuildInputs = [
+ attrs
+ click
+ construct
+ ecdsa
+ hidapi
+ libusb1
+ mnemonic
+ pillow
+ protobuf
+ pyblake2
+ requests
+ rlp
+ shamir-mnemonic
+ typing-extensions
+ 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
+ '';
+
+ 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
+ '';
+
+ meta = with lib; {
+ description = "Python library for communicating with Trezor Hardware Wallet";
+ homepage = "https://github.com/trezor/trezor-firmware/tree/master/python";
+ license = licenses.gpl3;
+ maintainers = with maintainers; [ np prusnak mmahut _1000101 ];
+ };
+}