[bug#34452] Updates for python-trezor-agent and python-trezor

Message ID 87wom5a5jy.fsf@ponder
State Accepted
Headers show
Series [bug#34452] Updates for python-trezor-agent and python-trezor | expand

Commit Message

Vagrant Cascadian Feb. 12, 2019, 6:23 a.m. UTC
The attached patch series update python-trezor-agent and python-trezor,
and fixes a bug that made python-trezor unusable:
https://bugs.gnu.org/34377

The solution for the bug could certainly be implemented more elegantly
by someone who knows guix packaging better, but it worked for me!

Thanks!

live well,
  vagrant

Comments

Danny Milosavljevic Feb. 12, 2019, 11:29 p.m. UTC | #1
Hi Vagrant,

On Mon, 11 Feb 2019 22:23:29 -0800
Vagrant Cascadian <vagrant@debian.org> wrote:
>The solution for the bug could certainly be implemented more elegantly
>by someone who knows guix packaging better, but it worked for me!

Long term there will be a proper fix for the problem of the same
Python file being able to be both a library and an executable
program: On core-updates, there's a wrap-script function which
will do the right thing in both cases.

After master is merged to core-updates, we should use it for trezor-agent.

For now, the workaround is fine.

Applied to master.

Thanks!

Patch

From 49c7cfc32f7263c78bf2b555dfad8cfcaf6db8eb Mon Sep 17 00:00:00 2001
From: Vagrant Cascadian <vagrant@debian.org>
Date: Thu, 7 Feb 2019 00:07:49 +0000
Subject: [PATCH 2/2] gnu: trezor-agent: Update 0.10.0.

    Fixes <https://bugs.gnu.org/34377>.

* gnu/packages/finance.scm (trezor-agent): Update to 0.10.0.
  [phases]: Add fixup-agent-py phase to install trezor_agent.py without shell
  wrapper.
  [native-inputs]: Add python-hidapi.
  [home-page]: Use https url.
---
 gnu/packages/finance.scm | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index 0e7c396421..cddccbfd94 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -803,19 +803,32 @@  Then set the environment variable GNUPGHOME to
 (define-public trezor-agent
   (package
     (name "trezor-agent")
-    (version "0.9.0")
+    (version "0.10.0")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "trezor_agent" version))
        (sha256
         (base32
-         "1i5cdamlf3c0ym600pjklij74p8ifj9cv7xrpnrfl1b8nkadswbz"))))
+         "144657c7bn0a667dq5fv5r6j7iilxf3h9agj29v1m2qpq40g0az8"))))
+    (arguments
+     ;; Tests fail with "AttributeError: module 'attr' has no attribute 's'".
+     `(#:phases
+       (modify-phases %standard-phases
+         (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.
+               (install-file "./trezor_agent.py"
+                             (string-append out "/bin/"))
+             #t))))))
     (build-system python-build-system)
     (inputs
      `(("python-trezor" ,python-trezor)
        ("python-trezor-agent" ,python-trezor-agent)))
-    (home-page "http://github.com/romanz/trezor-agent")
+    (native-inputs
+     `(("python-hidapi" ,python-hidapi)))
+    (home-page "https://github.com/romanz/trezor-agent")
     (synopsis "Using Trezor as hardware SSH/GPG agent")
     (description "This package allows using Trezor as a hardware SSH/GPG
 agent.")
-- 
2.20.1