diff mbox series

[bug#73148,4/4] gnu: python-trezor-agent: Use absolute path for gpg at runtime.

Message ID 239309df806153135e79ff7fc76d983cbef303bd.1725892102.git.attila@lendvai.name
State New
Headers show
Series [bug#73148,1/4] gnu: trezor-agent: Update to 0.15.0. | expand

Commit Message

Attila Lendvai Sept. 9, 2024, 2:28 p.m. UTC
From: Attila Lendvai <attila@lendvai.name>

The trezor-gpg binary execs gnupg at runtime.  Prior to this fix it wouldn't
work in a profile where gpg wasn't in the PATH.

* gnu/packages/finance.scm (python-trezor-agent): Substitute absolute path for
the gpgconf binary (and with that to all gnupg binaries).  Fixes #57345.

Change-Id: I9acc5a31a1189d0121152c2bd9ba0ff5eb90af09
---
 gnu/packages/finance.scm | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)
diff mbox series

Patch

diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index 841f128d092..e4a5ef829ba 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -951,6 +951,11 @@  (define-public python-trezor-agent
            (lambda _
              (substitute* "setup.py"
                (("'backports.shutil_which>=3.5.1',") ""))))
+         (add-after 'unpack 'set-gpgconf-path
+           (lambda* (#:key inputs #:allow-other-keys)
+             (substitute* "libagent/gpg/keyring.py"
+               (("util\\.which\\('gpgconf'\\)")
+                (string-append "'" (search-input-file inputs "bin/gpgconf") "'")))))
          (delete 'check)
          (add-after 'install 'check
            (lambda* (#:key tests? #:allow-other-keys)
@@ -978,9 +983,10 @@  (define-public python-trezor-agent
            python-semver
            python-unidecode
            python-wheel))
-    (native-inputs ; Only needed for running the tests
-     (list gnupg
-           python-mock
+    (inputs
+     (list gnupg))
+    (native-inputs                      ; Only needed for running the tests
+     (list python-mock
            python-pytest))
     (home-page "https://github.com/romanz/trezor-agent")
     (synopsis "Use hardware wallets as SSH and GPG agent")