guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch master updated: chromium-extension: Compute json at argument eval


From: guix-commits
Subject: branch master updated: chromium-extension: Compute json at argument evaluation time.
Date: Wed, 27 Dec 2023 11:33:08 -0500

This is an automated email from the git hooks/post-receive script.

jpoiret pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new 93ac4c20bf chromium-extension: Compute json at argument evaluation 
time.
93ac4c20bf is described below

commit 93ac4c20bf4b46b2bb9d0d2b9bec0b728b34de87
Author: Josselin Poiret <dev@jpoiret.xyz>
AuthorDate: Wed Dec 27 17:18:52 2023 +0100

    chromium-extension: Compute json at argument evaluation time.
    
    * gnu/build/chromium-extension.scm (make-chromium-extension): Make use of 
the
    make-signing-key procedure inside the argument field, making sure that it is
    not evaluated at file-load time.  This would otherwise try to resolve gnutls
    when we can't guarantee it's defined because of dependency cycles.
    
    Change-Id: Ia7b13acfbca475c2df073e9a88fc8bb9264dd968
---
 gnu/build/chromium-extension.scm | 43 ++++++++++++++++++++--------------------
 1 file changed, 22 insertions(+), 21 deletions(-)

diff --git a/gnu/build/chromium-extension.scm b/gnu/build/chromium-extension.scm
index 28449a1e1d..8171c72734 100644
--- a/gnu/build/chromium-extension.scm
+++ b/gnu/build/chromium-extension.scm
@@ -120,12 +120,7 @@ format."
 when installed, will make the extension contained in PKG available as a
 Chromium browser extension.  PKG-OUTPUT specifies which output of PKG to use."
   (let* ((name (package-name pkg))
-         (version (package-version pkg))
-         (private-key (make-signing-key name))
-         (public-key (signing-key->public-der private-key))
-         (checksum (file-sha256sum public-key))
-         (crx (make-crx private-key pkg pkg-output))
-         (json (crx->chromium-json crx version)))
+         (version (package-version pkg)))
     (package
       (inherit pkg)
       (name (string-append name "-chromium"))
@@ -138,18 +133,24 @@ Chromium browser extension.  PKG-OUTPUT specifies which 
output of PKG to use."
       (arguments
        (list #:modules '((guix build utils))
              #:builder
-             #~(begin
-                 (use-modules (guix build utils))
-                 (define (base16-char->chromium-base16 char)
-                   ;; Translate CHAR, a hexadecimal character, to a 
Chromium-style
-                   ;; representation using the letters a-p (where a=0, p=15).
-                   (string-ref "abcdefghijklmnop"
-                               (string-index "0123456789abcdef" char)))
-                 (let ((file-name (string-map base16-char->chromium-base16
-                                              (string-take #$checksum 32)))
-                       (extension-directory
-                        (string-append #$output
-                                       "/share/chromium/extensions")))
-                   (mkdir-p extension-directory)
-                   (symlink #$json (string-append extension-directory "/"
-                                                  file-name ".json")))))))))
+             (let*
+                 ((private-key (make-signing-key name))
+                  (public-key (signing-key->public-der private-key))
+                  (checksum (file-sha256sum public-key))
+                  (crx (make-crx private-key pkg pkg-output))
+                  (json (crx->chromium-json crx version)))
+               #~(begin
+                   (use-modules (guix build utils))
+                   (define (base16-char->chromium-base16 char)
+                     ;; Translate CHAR, a hexadecimal character, to a 
Chromium-style
+                     ;; representation using the letters a-p (where a=0, p=15).
+                     (string-ref "abcdefghijklmnop"
+                                 (string-index "0123456789abcdef" char)))
+                   (let ((file-name (string-map base16-char->chromium-base16
+                                                (string-take #$checksum 32)))
+                         (extension-directory
+                          (string-append #$output
+                                         "/share/chromium/extensions")))
+                     (mkdir-p extension-directory)
+                     (symlink #$json (string-append extension-directory "/"
+                                                    file-name ".json"))))))))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]