[PATCH 1/2] gnu: trezord: Update to 2.0.29.

DoneSubmitted by Martin Becze.
Details
2 participants
  • Ludovic Courtès
  • Martin Becze
Owner
unassigned
Severity
normal
M
M
Martin Becze wrote on 16 Apr 2020 18:17
(address . guix-patches@gnu.org)(name . Martin Becze)(address . mjbecze@riseup.net)
20200416161713.3466-1-mjbecze@riseup.net
* gnu/packages/finance.scm (trezord): Update to 2.0.29.
---
gnu/packages/finance.scm | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

Toggle diff (33 lines)
diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index c5f9066fd7..0c05530a31 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -13,7 +13,7 @@
 ;;; Copyright © 2018 Arun Isaac <arunisaac@systemreboot.net>
 ;;; Copyright © 2019, 2020 Guillaume Le Vaillant <glv@posteo.net>
 ;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
-;;; Copyright © 2019 Martin Becze <mjbecze@riseup.net>
+;;; Copyright © 2019, 2020 Martin Becze <mjbecze@riseup.net>
 ;;; Copyright © 2019 Sebastian Schott <sschott@mailbox.org>
 ;;; Copyright © 2020 Kei Kebreau <kkebreau@posteo.net>
 ;;; Copyright © 2020 Christopher Lemmer Webber <cwebber@dustycloud.org>
@@ -1168,7 +1168,7 @@ information.")
 (define-public trezord
   (package
     (name "trezord")
-    (version "2.0.17")
+    (version "2.0.29")
     (source
      (origin
        (method git-fetch)
@@ -1177,7 +1177,7 @@ information.")
               (commit (string-append "v" version))))
        (sha256
         (base32
-         "0nqzpq0i3crh0i4r1cppja5sn3rwi1fv9afxzwzv63096x5l30a7"))
+         "1ks1fa0027s3xp0z6qp0dxmayvrb4dwwscfhbx7da0khp153f2cp"))
        (file-name (git-file-name name version))))
     (build-system go-build-system)
     (arguments
-- 
2.26.0
M
M
Martin Becze wrote on 16 Apr 2020 18:20
[PATCH 2/2] gnu: Add trezord-udev-rules.
(address . 40666@debbugs.gnu.org)(name . Martin Becze)(address . mjbecze@riseup.net)
20200416162044.3548-1-mjbecze@riseup.net
* gnu/packages/finance.scm (trezord-udev-rules): New variable.

---
gnu/packages/finance.scm | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

Toggle diff (48 lines)
diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index 0c05530a31..66ca35483c 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -41,6 +41,7 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system copy)
   #:use-module (guix build-system emacs)
   #:use-module (guix build-system python)
   #:use-module (guix build-system glib-or-gtk)
@@ -1165,6 +1166,33 @@ information.")
     (home-page "https://grisbi.org")
     (license license:gpl2+)))
 
+(define-public trezord-udev-rules
+  (let ((commit "bff7fdfe436c727982cc553bdfb29a9021b423b0")
+        (revision "0"))
+      (package
+        (name "trezord-udev-rules")
+        (version (git-version "0.0.0" revision commit))
+        (source
+         (origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/trezor/trezor-common.git")
+                 (commit commit)))
+           (sha256
+            (base32
+             "14mrirrn68if7ja6qdk9qlxs1hv0f21vrxy5ncnms0gx9iwakp2l"))
+           (file-name (git-file-name name version))))
+        (build-system copy-build-system)
+        (arguments
+         '(#:install-plan
+           '(("./udev/51-trezor.rules" "lib/udev/rules.d/"))))
+        (home-page "https://github.com/trezor/trezor-common")
+        (synopsis "The udev rules for trezord.")
+        (description
+         "This contains the udev rules for trezord. This will let a user run
+trezord as a regular user instead of needing to it run as root.")
+        (license license:lgpl3+))))
+
 (define-public trezord
   (package
     (name "trezord")
-- 
2.26.0
L
L
Ludovic Courtès wrote on 17 Apr 2020 23:12
(name . Martin Becze)(address . mjbecze@riseup.net)(address . 40666@debbugs.gnu.org)
87a739akal.fsf@gnu.org
Hi Martin,

Martin Becze <mjbecze@riseup.net> skribis:

Toggle quote (2 lines)
> * gnu/packages/finance.scm (trezord-udev-rules): New variable.

I think it would be best to add a phase to ‘trezord’ that installs its
udev rules (it’s quite common for packages to include udev rules.)

WDYT?

Thanks,
Ludo’.
L
L
Ludovic Courtès wrote on 17 Apr 2020 23:13
Re: [bug#40666] [PATCH 1/2] gnu: trezord: Update to 2.0.29.
(name . Martin Becze)(address . mjbecze@riseup.net)(address . 40666@debbugs.gnu.org)
871rolak8w.fsf@gnu.org
Martin Becze <mjbecze@riseup.net> skribis:

Toggle quote (2 lines)
> * gnu/packages/finance.scm (trezord): Update to 2.0.29.

Applied, thanks!

Ludo’.
M
M
Martin Becze wrote on 19 Apr 2020 05:23
Re: [bug#40666] [PATCH 2/2] gnu: Add trezord-udev-rules.
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 40666@debbugs.gnu.org)
bd817ec0-2783-9ecf-e7ec-2aea04b94edf@riseup.net
Sure thing! I here is the updated patch. Note I still need to add a new
package, since the udev rules are in a separate repo.

On 4/17/20 4:12 PM, Ludovic Courtès wrote:
Toggle quote (14 lines)
> Hi Martin,
>
> Martin Becze <mjbecze@riseup.net> skribis:
>
>> * gnu/packages/finance.scm (trezord-udev-rules): New variable.
>
> I think it would be best to add a phase to ‘trezord’ that installs its
> udev rules (it’s quite common for packages to include udev rules.)
>
> WDYT?
>
> Thanks,
> Ludo’.
>
From d5f984dcb2d77f281f0acf4b418276a801235d91 Mon Sep 17 00:00:00 2001
From: Martin Becze <mjbecze@riseup.net>
Date: Wed, 15 Apr 2020 19:37:53 -0500
Subject: [PATCH v2] gnu: Add trezor-common

* gnu/packages/finance.scm (trezor-common): New variable.
(trezord): Install udev rules from trezor-common.
---
gnu/packages/finance.scm | 50 +++++++++++++++++++++++++++++++++++++---
1 file changed, 47 insertions(+), 3 deletions(-)

Toggle diff (83 lines)
diff --git a/gnu/packages/finance.scm b/gnu/packages/finance.scm
index ee254c3a9f..b1f6ebcf60 100644
--- a/gnu/packages/finance.scm
+++ b/gnu/packages/finance.scm
@@ -41,6 +41,7 @@
   #:use-module (guix git-download)
   #:use-module (guix build-system gnu)
   #:use-module (guix build-system cmake)
+  #:use-module (guix build-system copy)
   #:use-module (guix build-system emacs)
   #:use-module (guix build-system python)
   #:use-module (guix build-system glib-or-gtk)
@@ -1165,6 +1166,35 @@ information.")
     (home-page "https://grisbi.org")
     (license license:gpl2+)))
 
+(define-public trezor-common
+  (let ((commit "bff7fdfe436c727982cc553bdfb29a9021b423b0")
+        (revision "0"))
+      (package
+        (name "trezor-common")
+        (version (git-version "0.0.0" revision commit))
+        (source
+         (origin
+           (method git-fetch)
+           (uri (git-reference
+                 (url "https://github.com/trezor/trezor-common.git")
+                 (commit commit)))
+           (sha256
+            (base32
+             "14mrirrn68if7ja6qdk9qlxs1hv0f21vrxy5ncnms0gx9iwakp2l"))
+           (file-name (git-file-name name version))))
+        (build-system copy-build-system)
+        (arguments
+         '(#:install-plan
+           ;; currently we only have use for the udev rules
+           '(("./udev/51-trezor.rules" "lib/udev/rules.d/"))))
+        (home-page "https://github.com/trezor/trezor-common")
+        (synopsis "This project contains files shared among Trezor projects.")
+        (description
+         "This project contains files shared among Trezor projects,
+including the udev rules for trezord")
+        (properties '((hidden? . #t)))
+        (license license:lgpl3+))))
+
 (define-public trezord
   (package
     (name "trezord")
@@ -1173,15 +1203,29 @@ information.")
      (origin
        (method git-fetch)
        (uri (git-reference
-              (url "https://github.com/trezor/trezord-go.git")
-              (commit (string-append "v" version))))
+             (url "https://github.com/trezor/trezord-go.git")
+             (commit (string-append "v" version))))
        (sha256
         (base32
          "1ks1fa0027s3xp0z6qp0dxmayvrb4dwwscfhbx7da0khp153f2cp"))
        (file-name (git-file-name name version))))
     (build-system go-build-system)
+    (native-inputs
+     `(("trezor-common" ,trezor-common)))
     (arguments
-     '(#:import-path "github.com/trezor/trezord-go"))
+     '(#:import-path "github.com/trezor/trezord-go"
+       #:phases
+       (modify-phases %standard-phases
+         (add-before 'install 'check
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (common (assoc-ref inputs "trezor-common"))
+                    (rule-path "/lib/udev/rules.d/51-trezor.rules")
+                    (input-path (string-append common rule-path))
+                    (output-path (string-append out rule-path)))
+
+               ;; install the udev rules
+               (install-file input-path output-path)))))))
     (home-page "https://trezor.io")
     (synopsis "Trezor Communication Daemon aka Trezor Bridge (written in Go)")
     (description "This allows a Trezor hardware wallet to communicate to the
-- 
2.26.1
L
L
Ludovic Courtès wrote on 19 Apr 2020 13:06
(name . Martin Becze)(address . mjbecze@riseup.net)(address . 40666-done@debbugs.gnu.org)
874ktf4tvz.fsf@gnu.org
Hi Martin,

Martin Becze <mjbecze@riseup.net> skribis:

Toggle quote (3 lines)
> Sure thing! I here is the updated patch. Note I still need to add a new
> package, since the udev rules are in a separate repo.

Oh sorry, I had completely overlooked that. I went with the first patch
then, it was the right choice!

Thank you,
Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send email to 40666@debbugs.gnu.org