diff --git a/pkgs/development/python-modules/ledgerwallet/default.nix b/pkgs/development/python-modules/ledgerwallet/default.nix index 7650e375b41f..421a24e9ee12 100644 --- a/pkgs/development/python-modules/ledgerwallet/default.nix +++ b/pkgs/development/python-modules/ledgerwallet/default.nix @@ -25,6 +25,13 @@ buildPythonPackage rec { sha256 = "0fb93h2wxm9as9rsywlgz2ng4wrlbjphn6mgbhj6nls2i86rrdxk"; }; + patches = [ + # Fix removed function in construct library + # https://github.com/LedgerHQ/ledgerctl/issues/17 + # https://github.com/construct/construct/commit/8915512f53552b1493afdbce5bbf8bb6f2aa4411 + ./remove-iterateints.patch + ]; + buildInputs = lib.optionals stdenv.isDarwin [ AppKit ]; propagatedBuildInputs = [ cryptography click construct ecdsa hidapi intelhex pillow protobuf requests tabulate diff --git a/pkgs/development/python-modules/ledgerwallet/remove-iterateints.patch b/pkgs/development/python-modules/ledgerwallet/remove-iterateints.patch new file mode 100644 index 000000000000..c97785f1d04b --- /dev/null +++ b/pkgs/development/python-modules/ledgerwallet/remove-iterateints.patch @@ -0,0 +1,19 @@ +--- a/ledgerwallet/params.py 2021-11-17 20:31:10.488954050 -0300 ++++ b/ledgerwallet/params.py 2021-11-17 20:31:30.619477930 -0300 +@@ -19,7 +19,6 @@ + ) + from construct.core import ( + byte2int, +- iterateints, + singleton, + stream_read, + stream_write, +@@ -40,7 +39,7 @@ + num_bytes = byte & 0x80 + encoded_len = stream_read(stream, num_bytes) + num = 0 +- for len_byte in iterateints(encoded_len): ++ for len_byte in encoded_len: + num = num << 8 + len_byte + return num +