diff options
author | Attila Lendvai <attila@lendvai.name> | 2021-09-24 13:05:05 +0200 |
---|---|---|
committer | Nicolas Goaziou <mail@nicolasgoaziou.fr> | 2021-11-28 21:31:08 +0100 |
commit | 25cb5bad5e2475a49e20a2da888652e0bd322530 (patch) | |
tree | 1bf2fc264b5e5bac5be97dd47f4fb5fee56b9eb3 /gnu/packages/finance.scm | |
parent | 032d1c03b65b134c05fec2dec91da3c0ba05ae0b (diff) |
gnu: python-trezor-agent: Fix key generation with trezor-gpg init
* gnu/packages/finance.scm (trezor-agent): Add comment on why the
undoing of the wrapping is done, and also delete the irrelevant sideffect of
the now undone wrapping.
(python-trezor-agent): Add a patch that changes the python code to handle the
argv[0] changed by the wrapping.
* gnu/packages/patches/trezor-agent-fix-argv0.patch: New file.
* gnu/local.mk (dist_patch_DATA): Reference patch.
Signed-off-by: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Diffstat (limited to 'gnu/packages/finance.scm')
-rw-r--r-- | gnu/packages/finance.scm | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm index 00e3b7a5af..f4978a444b 100644 --- a/gnu/packages/finance.scm +++ b/gnu/packages/finance.scm @@ -844,7 +844,8 @@ the Monero GUI client.") (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "0q99vbfd3h85s8rnjipnmldixabqmmlk5w9karv6f0rhyi54f4zv")))) + (base32 "0q99vbfd3h85s8rnjipnmldixabqmmlk5w9karv6f0rhyi54f4zv")) + (patches (search-patches "python-trezor-agent-fix-argv0.patch")))) (build-system python-build-system) (arguments `(#:phases @@ -1091,7 +1092,15 @@ the KeepKey Hardware Wallet.") (add-after 'wrap 'fixup-agent-py (lambda* (#:key inputs outputs #:allow-other-keys) (let* ((out (assoc-ref outputs "out"))) - ;; overwrite the wrapper with the real thing. + ;; The wrap phase also wraps trezor_agent.py (besides the + ;; public facing executable called trezor-agent). We need to + ;; undo that wrapping. The reason this is needed is that the + ;; python easy install generates a toplevel script (?) that + ;; messes with argv[0] and then re-opens the python + ;; module. This fails when the wrapped file is actually a shell + ;; script, not a python file. + (delete-file (string-append out "/bin/.trezor_agent.py-real")) + ;; Overwrite the wrapped one with the real thing. (install-file "./trezor_agent.py" (string-append out "/bin")) #t)))))) |