all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob d8a5ea1550bbf8f5ff3883a003f8559fba6b6a9a 9816 bytes (raw)
name: gnu/packages/geth-binary.scm 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
 
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2021 Attila Lendvai <attila@lendvai.name>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages geth-binary)
  #:use-module ((guix licenses)
                #:select (gpl3+))
  #:use-module (guix packages)
  #:use-module (guix download)
  #:use-module (guix utils)
  #:use-module (guix build-system gnu)
  #:use-module (gnu packages)
  #:use-module (gnu packages bootstrap)
  #:use-module (gnu packages elf)
  #:use-module (gnu packages gnupg)
  #:use-module (ice-9 match))

;; as per https://geth.ethereum.org/downloads/#openpgp_signatures
(define +geth-linux-builder-key-fingerprint+
  "FDE5A1A044FA13D2F7ADA019A61A13569BA28146")

(define +geth-linux-builder-key+
  "-----BEGIN PGP PUBLIC KEY BLOCK-----
Comment: Hostname: 
Version: Hockeypuck ~unreleased

xsFNBFggyuEBEADAWrc/bm0LD0EsymPoWKf3L5br0CNIoDfN0eHRFDKu11blTUY2
GcK7BcrE7yTp7iyY2C3GCXIvm/2MT8ljp7ilqhlWlMiEaxZuhHIAiv4021G1hm5V
7MpDKaXLoMcbKLdk6wtULfx8u+KvOFgDEAXyfe93RZtJqEnm/ed3KWF123s/ceXy
df4ruFypyW04gaKHepb23WNnz98kQqWxlmSWResp7gD7rOGEE0R1blK2VnVksTAi
+ObUJdrRl/aNYYzwaPwysSoZf+WQAQrd/Wcx/FTlnp6IODvxH88mTIUa3KnCNOxx
BD3i2eXIWcR3fqyMnIAaoVxKQzL0odkuTHO+2axNecvfXU7rN+k1eEA121bJDQjx
qKhtgKfCiwg+prw9+sGS/ZnFLxP+s1ss5z1HpTTO60YQpnYoUPSbL4RGaFBuAkzS
g43iS3RaaXLk8lNunpWwQxY85995ZHKkf/yvg9wULwQ7lDvDO6nD+HCbf6H5AOAL
t2uQAPaG1bKk+bioaLDF2ziHW6jwDRKxRa0FyNtP2yb6nCM1wJSu6ymaRQxqTFcQ
jfHxNeFWYZhObfC90eqUnlUEhfAWz/tflDIioDGRhB9XB3gRCvjVz/gSxp4xOMgE
tIsUgzsavPWxE1HDGB0CKB8UChGVqNWl0Lom0GXGxUg2VNF+gTppees7qwARAQAB
zTBHbyBFdGhlcmV1bSBMaW51eCBCdWlsZGVyIDxnZ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1IJkqaqUXrN6BywSWmcE3cFZbFqmU+bED/AOLIk+F8llZURR4JZx
wVZY5KHyroTwr2jGfOP/u8x8Qg+LF6ceARlmYP1xOxbZ7odiN2fctchs+ogtA9P3
/Vj4Q4Sm7eRg6MdOrFQbxMWPXiXWZqdzPU0wBT7pec0OnxP58gTxc+bqmirav3bp
jDPr9lDnazxuyK92mlV9Nt1mwn+deoNEeAJLKLgQywTpIT/Wi5pKpikHTZmOGBz0
aD1XJM7Aqq5KSSLvJMap9uHNO3WQXuNOoeLsSg==
=1D3S
-----END PGP PUBLIC KEY BLOCK-----")

(define +url-base+ "https://gethstore.blob.core.windows.net/builds/")

(define (unsupported-arch system)
  (raise (formatted-message
          (G_ "The geth-binary package does not support Guix system '~a'")
          system)))

(define (guix-system-name->geth-system-name system)
  (match system
    ("x86_64-linux"      "linux-amd64")
    ("i686-linux"        "linux-386")
    ("aarch64-linux"     "linux-arm64")
    (_ (unsupported-arch system))))

(define (geth-directory system version commit-hash)
  (string-append "geth-alltools-"
                 (guix-system-name->geth-system-name system) "-"
                 version "-"
                 commit-hash))

(define-public geth-binary
  (let ((version "1.10.11")
        (commit-hash "7231b3ef"))
    (package
      (name "geth-binary")
      (version version)
      (source #false)                   ; see below
      (outputs '("out" "clef" "evm"))
      (build-system gnu-build-system)
      (arguments
       `(#:modules ((guix build gnu-build-system)
                    (guix build utils)
                    (srfi srfi-26)
                    (srfi srfi-1))
         #:phases
         (modify-phases %standard-phases
           (delete 'bootstrap)
           (delete 'configure)
           (delete 'build)
           (delete 'check)
           (add-before 'unpack 'check-singatures
             (lambda* (#:key inputs #:allow-other-keys)
               (let* ((gpg-homedir "gpg-homedir")
                      (key-file "geth-linux-builder.asc")
                      (gpg-options (list "gpg"
                                         "--homedir" gpg-homedir
                                         "--no-options"
                                         "--trust-model" "tofu"
                                         "--no-auto-check-trustdb"
                                         "--no-default-keyring")))
                 (mkdir-p gpg-homedir)
                 (chmod gpg-homedir #o700)
                 (with-output-to-file key-file
                   (lambda _
                     (display ,+geth-linux-builder-key+)))
                 ;; import the key
                 (apply invoke (append gpg-options
                                       (list "--import" key-file)))
                 ;; trust it
                 (apply invoke (append gpg-options
                                       (list "--tofu-policy" "good"
                                             ,+geth-linux-builder-key-fingerprint+)))
                 ;; verify the archive
                 (apply invoke (append gpg-options
                                       (list "--verify"
                                             (assoc-ref inputs "signature")
                                             (assoc-ref inputs "source")))))
               #t))
           (replace 'unpack
             (lambda* (#:key inputs #:allow-other-keys)
               (invoke "tar" "--strip-components=1" "-xzvf"
                       (assoc-ref inputs "source"))
               #t))
           (add-after 'unpack 'patchelf
             (lambda* (#:key inputs outputs #:allow-other-keys)
               (let* ((binaries '("geth" "clef" "evm"))
                      (ld-so (string-append (assoc-ref inputs "libc")
                                            ,(glibc-dynamic-linker))))
                 (for-each (cut invoke "patchelf" "--set-interpreter" ld-so <>)
                           binaries))
               #t))
           (replace 'install
             (lambda* (#:key system outputs #:allow-other-keys)
               (let ((out  (assoc-ref outputs "out"))
                     (clef (assoc-ref outputs "clef"))
                     (evm  (assoc-ref outputs "evm"))
                     (doit (lambda (name target)
                             (let ((target-dir (string-append target "/bin")))
                               (mkdir-p target-dir)
                               (copy-file name (string-append target-dir "/" name))))))
                 (doit "geth" out)
                 (doit "clef" clef)
                 (doit "evm"  evm))
               #t)))))
      (native-inputs
       `(("gnupg" ,gnupg)
         ("patchelf" ,patchelf)))
      (inputs
       `(("source"
          ,(origin
             (method url-fetch)
             (uri (string-append
                   +url-base+
                   (geth-directory (%current-system) version commit-hash)
                   ".tar.gz"))
             (sha256
              (match (%current-system)
                ("x86_64-linux"
                 (base32
                  "1r50i97aiksjx81lalh0rq0ffk2gc68b68lnrmm8c8rvarv547n3"))
                ("i686-linux"
                 (base32
                  "0f2dbswmahwqga2sxvf6037n4c7rpmr3vf4hfhbjankfknb4l8gv"))
                ("aarch64-linux"
                 (base32
                  "0s4f7254gv5v92nbddwvlbyb2gg3kz2v2g586zk3ygvga86yky6m"))
                (_ (unsupported-arch (%current-system)))))))
         ("signature"
          ,(origin
             (method url-fetch)
             (uri (string-append
                   +url-base+
                   (geth-directory (%current-system) version commit-hash)
                   ".tar.gz.asc"))
             (sha256
              (match (%current-system)
                ("x86_64-linux"
                 (base32
                  "1j14bli8hq4nkcirbpkm1vgr3zr91glrxzix62imzahwhwkfsq9a"))
                ("i686-linux"
                 (base32
                  "1jb53xdp7qx45npdzlcxds7nnlinkzq55l1ygpsivr9gl4aryq0f"))
                ("aarch64-linux"
                 (base32
                  "1dglzi4lxpxih6pq6j2kyzl44yw7afhnmpmh06vbwazsqvhlil2k"))
                (_ (unsupported-arch (%current-system)))))))))

      (supported-systems '("x86_64-linux" "i686-linux" "aarch64-linux"))

      (home-page "https://geth.ethereum.org/")
      (synopsis "Official Go implementation of the Ethereum protocol")
      (description
       "Ethereum is a decentralized platform that runs smart contracts,
applications that run exactly as programmed without possibility of downtime,
censorship, fraud or third party interference.")
      (license gpl3+))))

debug log:

solving d8a5ea1550 ...
found d8a5ea1550 in https://yhetil.org/guix/20211029012159.14007-1-attila@lendvai.name/

applying [1/1] https://yhetil.org/guix/20211029012159.14007-1-attila@lendvai.name/
diff --git a/gnu/packages/geth-binary.scm b/gnu/packages/geth-binary.scm
new file mode 100644
index 0000000000..d8a5ea1550

1:44: trailing whitespace.
Comment: Hostname: 
Checking patch gnu/packages/geth-binary.scm...
Applied patch gnu/packages/geth-binary.scm cleanly.
warning: 1 line adds whitespace errors.

index at:
100644 d8a5ea1550bbf8f5ff3883a003f8559fba6b6a9a	gnu/packages/geth-binary.scm

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.