aboutsummaryrefslogtreecommitdiff
path: root/tests/keys/ed25519.sec
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2023-04-09 20:14:39 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2023-04-09 21:00:04 +0200
commit61f956125f97c49b8f662c97fc7f5102213c1b16 (patch)
tree311a4ec2d6ef2081b97f35daafee299ed5e55d30 /tests/keys/ed25519.sec
parent8edbc78d9c98ab3715def3244a0e8b337bc6ea21 (diff)
downloadguix-61f956125f97c49b8f662c97fc7f5102213c1b16.tar.gz
guix-61f956125f97c49b8f662c97fc7f5102213c1b16.zip
gnu: emacs-gptel: Update to 0.3.2.
* gnu/packages/emacs-xyz.scm (emacs-gptel): Update to 0.3.2.
Diffstat (limited to 'tests/keys/ed25519.sec')
0 files changed, 0 insertions, 0 deletions
t;external_version\": \"~a\" } " #$crx #$version))) #:local-build? #t)) (define (signing-key->public-der key) "Return a derivation for a file containing the public key of KEY in DER format." (computed-file "der" #~(system* #$(file-append gnutls "/bin/certtool") "--load-privkey" #$key "--pubkey-info" "--outfile" #$output "--outder") #:local-build? #t)) (define (file-sha256sum file) (with-extensions (list guile-gcrypt) #~(begin (use-modules (gcrypt base16) (gcrypt hash)) (bytevector->base16-string (file-sha256 #$file))))) (define* (make-chromium-extension pkg #:optional (pkg-output "out")) "Create a Chromium extension from package PKG and return a package that, 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))) (package (inherit pkg) (name (string-append name "-chromium")) (source #f) (native-inputs '()) (inputs '()) (propagated-inputs '()) (outputs '("out")) (build-system trivial-build-system) (arguments (list #:modules '((guix build utils)) #:builder (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"))))))))))