summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoé Lopez <[email protected]>2025-01-23 21:26:24 +0100
committerLudovic Courtès <[email protected]>2025-01-24 23:43:35 +0100
commit1ec7bf9f29fc345ccdacc240d3b8893fe5380557 (patch)
tree856ef43854adf6410b1941db0e31db3597cdb4e3
parent9f9e89a8ca0c18d0ca0292a3eb58d1da9a8cc119 (diff)
pack: Support localstatedir in AppImage format.
* guix/scripts/pack.scm (self-contained-appimage): Support localstatedir option. Change-Id: I296b3d3e442aa90f36de62a9b23aba4a2c3de9a0 Signed-off-by: Ludovic Courtès <[email protected]>
-rw-r--r--guix/scripts/pack.scm13
1 files changed, 12 insertions, 1 deletions
diff --git a/guix/scripts/pack.scm b/guix/scripts/pack.scm
index d0e66c3013..7f5a5f2aa7 100644
--- a/guix/scripts/pack.scm
+++ b/guix/scripts/pack.scm
@@ -1018,15 +1018,22 @@ generating the AppImage. Valid compressors are: ~a~%")
compressor-name
%valid-compressors)))
+ (define database
+ (and localstatedir?
+ (file-append (store-database (list profile))
+ "/db/db.sqlite")))
+
(define builder
(with-extensions (list guile-gcrypt)
(with-imported-modules (source-module-closure
'((guix build store-copy)
- (guix build utils))
+ (guix build utils)
+ (gnu build install))
#:select? not-config?)
#~(begin
(use-modules (guix build utils)
(guix build store-copy)
+ (gnu build install)
(rnrs io ports)
(srfi srfi-1)
(srfi srfi-26))
@@ -1060,6 +1067,10 @@ generating the AppImage. Valid compressors are: ~a~%")
(string-append appdir "/" #$name ".desktop")
#:name #$name
#:exec #$entry-point)
+ ;; Install database and gc roots.
+ (when #+database
+ ;; Initialize /var/guix.
+ (install-database-and-gc-roots appdir #+database profile))
;; Compress the AppDir.
(invoke #+(file-append squashfs-tools "/bin/mksquashfs") appdir
squashfs "-root-owned" "-noappend"