gnu: nss-certs: Use G-Expression.

* gnu/packages/certs.scm (nss-certs)[arguments]: Use a gexp.

Co-authored-by: Ludovic Courtès <ludo@gnu.org>
This commit is contained in:
Brian Kubisiak 2022-04-02 17:49:15 -07:00 committed by Ludovic Courtès
parent 65e3de5cce
commit 555ddf0dd7
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -28,6 +28,7 @@ (define-module (gnu packages certs)
#:use-module (guix packages) #:use-module (guix packages)
#:use-module (guix utils) #:use-module (guix utils)
#:use-module (guix download) #:use-module (guix download)
#:use-module (guix gexp)
#:use-module (guix git-download) #:use-module (guix git-download)
#:use-module (guix build-system copy) #:use-module (guix build-system copy)
#:use-module (guix build-system gnu) #:use-module (guix build-system gnu)
@ -159,31 +160,27 @@ (define-public nss-certs
(inputs '()) (inputs '())
(propagated-inputs '()) (propagated-inputs '())
(arguments (arguments
`(#:modules ((guix build gnu-build-system) (list #:modules '((guix build gnu-build-system)
(guix build utils) (guix build utils)
(rnrs io ports) (rnrs io ports)
(srfi srfi-26)) (srfi srfi-26))
#:phases #:phases
(modify-phases #~(modify-phases
(map (cut assq <> %standard-phases) (map (cut assq <> %standard-phases)
'(set-paths install-locale unpack)) '(set-paths install-locale unpack))
(add-after 'unpack 'install (add-after 'unpack 'install
(lambda _ (lambda _
;; TODO: On the next rebuild cycle, remove references to (let ((certsdir (string-append #$output
;; '%output' and '%outputs'. "/etc/ssl/certs/")))
(let ((certsdir (string-append ,(if (%current-target-system) (with-directory-excursion "nss/lib/ckfw/builtins/"
'(assoc-ref %outputs "out") (unless (file-exists? "blacklist.txt")
'%output) (call-with-output-file "blacklist.txt" (const #t)))
"/etc/ssl/certs/"))) ;; Extract selected single certificates from blob.
(with-directory-excursion "nss/lib/ckfw/builtins/" (invoke "certdata2pem")
(unless (file-exists? "blacklist.txt") ;; Copy .pem files into the output.
(call-with-output-file "blacklist.txt" (const #t))) (for-each (cut install-file <> certsdir)
;; Extract selected single certificates from blob. (find-files "." ".*\\.pem$")))
(invoke "certdata2pem") (invoke "openssl" "rehash" certsdir)))))))
;; Copy .pem files into the output.
(for-each (cut install-file <> certsdir)
(find-files "." ".*\\.pem$")))
(invoke "openssl" "rehash" certsdir)))))))
(synopsis "CA certificates from Mozilla") (synopsis "CA certificates from Mozilla")
(description (description
"This package provides certificates for Certification Authorities (CA) "This package provides certificates for Certification Authorities (CA)