1
Fork 0
mirror of https://https.git.savannah.gnu.org/git/guix.git/ synced 2025-07-10 16:50:43 +02:00

pack: Autoload all the (gnu packages …) modules.

Fixes guix/guix#640.

* guix/scripts/pack.scm <top-level>: Autoload (gnu packages …) modules.
(bootstrap-xz): Turn into a thunk and update user.
(gcrypt-sqlite3&co): Move to…
(store-database): … here.

Reported-by: Luca Cirrottola <luca.cirrottola@inria.fr>
Change-Id: I345a872a7c2a94ad148052fef3b2b674cc94c9d0
This commit is contained in:
Ludovic Courtès 2025-07-08 17:33:53 +02:00
parent b1dfc274ad
commit 7af0d64677
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5

View file

@ -55,10 +55,12 @@
#:use-module ((guix docker) #:select (%docker-image-max-layers)) #:use-module ((guix docker) #:select (%docker-image-max-layers))
#:use-module (gnu compression) #:use-module (gnu compression)
#:use-module (gnu packages) #:use-module (gnu packages)
#:use-module (gnu packages bootstrap) #:autoload (gnu packages bootstrap) (%bootstrap-coreutils&co
#:use-module ((gnu packages compression) #:hide (zip)) %bootstrap-inputs
#:use-module (gnu packages guile) %bootstrap-guile)
#:use-module (gnu packages base) #:autoload (gnu packages compression) (gzip squashfs-tools)
#:autoload (gnu packages guile) (guile-json-3 guile-sqlite3)
#:autoload (gnu packages base) (binutils tar libc-utf8-locales-for-target)
#:autoload (gnu packages appimage) (appimage-type2-runtime) #:autoload (gnu packages appimage) (appimage-type2-runtime)
#:autoload (gnu packages gnupg) (guile-gcrypt) #:autoload (gnu packages gnupg) (guile-gcrypt)
#:autoload (gnu packages guile) (guile2.0-json guile-json) #:autoload (gnu packages guile) (guile2.0-json guile-json)
@ -90,7 +92,7 @@
;;; Code: ;;; Code:
;; This one is only for use in this module, so don't put it in %compressors. ;; This one is only for use in this module, so don't put it in %compressors.
(define bootstrap-xz (define (bootstrap-xz)
(compressor "bootstrap-xz" ".xz" (compressor "bootstrap-xz" ".xz"
#~(append (list #+(file-append %bootstrap-coreutils&co "/bin/xz") #~(append (list #+(file-append %bootstrap-coreutils&co "/bin/xz")
"-e") "-e")
@ -104,15 +106,6 @@
(('gnu _ ...) #t) (('gnu _ ...) #t)
(_ #f))) (_ #f)))
(define gcrypt-sqlite3&co
;; Guile-Gcrypt, Guile-SQLite3, and their propagated inputs.
(append-map (lambda (package)
(cons package
(match (package-transitive-propagated-inputs package)
(((labels packages) ...)
packages))))
(list guile-gcrypt guile-sqlite3)))
(define (store-database items) (define (store-database items)
"Return a directory containing a store database where all of ITEMS and their "Return a directory containing a store database where all of ITEMS and their
dependencies are registered." dependencies are registered."
@ -126,6 +119,15 @@ dependencies are registered."
(string-append "closure" (number->string n))) (string-append "closure" (number->string n)))
(iota (length items)))) (iota (length items))))
(define gcrypt-sqlite3&co
;; Guile-Gcrypt, Guile-SQLite3, and their propagated inputs.
(append-map (lambda (package)
(cons package
(match (package-transitive-propagated-inputs package)
(((labels packages) ...)
packages))))
(list guile-gcrypt guile-sqlite3)))
(define build (define build
(with-extensions gcrypt-sqlite3&co (with-extensions gcrypt-sqlite3&co
(with-imported-modules `(((guix config) => ,(make-config.scm)) (with-imported-modules `(((guix config) => ,(make-config.scm))
@ -1828,7 +1830,7 @@ Create a bundle of PACKAGE.\n"))
(target (assoc-ref opts 'target)) (target (assoc-ref opts 'target))
(bootstrap? (assoc-ref opts 'bootstrap?)) (bootstrap? (assoc-ref opts 'bootstrap?))
(compressor (if bootstrap? (compressor (if bootstrap?
bootstrap-xz (bootstrap-xz)
(assoc-ref opts 'compressor))) (assoc-ref opts 'compressor)))
(archiver (if (equal? pack-format 'squashfs) (archiver (if (equal? pack-format 'squashfs)
squashfs-tools squashfs-tools