[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
138/227: profiles: Add a gdk-pixbuf-loaders-cache-file hook.
From: |
guix-commits |
Subject: |
138/227: profiles: Add a gdk-pixbuf-loaders-cache-file hook. |
Date: |
Thu, 11 Nov 2021 12:30:26 -0500 (EST) |
apteryx pushed a commit to branch core-updates-frozen
in repository guix.
commit 20e3dd052d7e4f59273e3646d3533d43c87c30b0
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
AuthorDate: Sat Oct 2 21:28:24 2021 -0400
profiles: Add a gdk-pixbuf-loaders-cache-file hook.
This paves the way toward properly fixing https://issues.guix.gnu.org/50957.
* guix/profiles.scm (gdk-pixbuf-loaders-cache-file): Add procedure...
(%default-profile-hooks): ... and register it as a profile hook.
* guix/status.scm (hook-message): Register it here too.
---
guix/profiles.scm | 47 ++++++++++++++++++++++++++++++++++++++++++++++-
guix/status.scm | 2 ++
2 files changed, 48 insertions(+), 1 deletion(-)
diff --git a/guix/profiles.scm b/guix/profiles.scm
index dcd0d30..885d7c8 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -7,7 +7,7 @@
;;; Copyright © 2016, 2018, 2019, 2021 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2016 Chris Marusich <cmmarusich@gmail.com>
;;; Copyright © 2017 Huang Ying <huang.ying.caritas@gmail.com>
-;;; Copyright © 2017 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2017, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2019 Kyle Meyer <kyle@kyleam.com>
;;; Copyright © 2019 Mathieu Othacehe <m.othacehe@gmail.com>
;;; Copyright © 2020 Danny Milosavljevic <dannym@scratchpost.org>
@@ -1180,6 +1180,50 @@ MANIFEST. Single-file bundles are required by programs
such as Git and Lynx."
`((type . profile-hook)
(hook . emacs-subdirs))))
+(define (gdk-pixbuf-loaders-cache-file manifest)
+ "Return a derivation that produces a loaders cache file for every gdk-pixbuf
+loaders discovered in MANIFEST."
+ (define gdk-pixbuf ;lazy reference
+ (module-ref (resolve-interface '(gnu packages gtk)) 'gdk-pixbuf))
+
+ (mlet* %store-monad
+ ((gdk-pixbuf (manifest-lookup-package manifest "gdk-pixbuf"))
+ (librsvg (manifest-lookup-package manifest "librsvg"))
+ (gdk-pixbuf-bin -> (file-append gdk-pixbuf "/bin")))
+
+ (define build
+ (with-imported-modules (source-module-closure
+ '((guix build glib-or-gtk-build-system)))
+ #~(begin
+ (use-modules (guix build glib-or-gtk-build-system))
+ (setenv "PATH" (string-append #$gdk-pixbuf-bin ":" (getenv
"PATH")))
+
+ (generate-gdk-pixbuf-loaders-cache
+ ;; XXX: MANIFEST-LOOKUP-PACKAGE transitively searches through
+ ;; every input referenced by the manifest, while MANIFEST-INPUTS
+ ;; only retrieves the immediate inputs as well as their
+ ;; propagated inputs; to avoid causing an empty output derivation
+ ;; we must ensure that the inputs contain at least one
+ ;; loaders.cache file. This is why we include gdk-pixbuf or
+ ;; librsvg when they are transitively found.
+ (list #$@(if gdk-pixbuf
+ (list gdk-pixbuf)
+ '())
+ #$@(if librsvg
+ (list librsvg)
+ '())
+ #$@(manifest-inputs manifest))
+ (list #$output)))))
+
+ (if gdk-pixbuf
+ (gexp->derivation "gdk-pixbuf-loaders-cache-file" build
+ #:local-build? #t
+ #:substitutable? #f
+ #:properties
+ '((type . profile-hook)
+ (hook . gdk-pixbuf-loaders-cache-file)))
+ (return #f))))
+
(define (glib-schemas manifest)
"Return a derivation that unions all schemas from manifest entries and
creates the Glib 'gschemas.compiled' file."
@@ -1799,6 +1843,7 @@ MANIFEST."
ghc-package-cache-file
ca-certificate-bundle
emacs-subdirs
+ gdk-pixbuf-loaders-cache-file
glib-schemas
gtk-icon-themes
gtk-im-modules
diff --git a/guix/status.scm b/guix/status.scm
index f351a56..eefe183 100644
--- a/guix/status.scm
+++ b/guix/status.scm
@@ -381,6 +381,8 @@ the current build phase."
(G_ "building CA certificate bundle..."))
('emacs-subdirs
(G_ "listing Emacs sub-directories..."))
+ ('gdk-pixbuf-loaders-cache-file
+ (G_ "generating GdkPixbuf loaders cache..."))
('glib-schemas
(G_ "generating GLib schema cache..."))
('gtk-icon-themes
- 131/227: gnu: pulseaudio: Add doxygen to fix build., (continued)
- 131/227: gnu: pulseaudio: Add doxygen to fix build., guix-commits, 2021/11/11
- 134/227: gnu: llvm: Add make-lld-wrapper, lld-wrapper and lld-as-ld-wrapper., guix-commits, 2021/11/11
- 117/227: gnu: graphviz: Update to 2.49.0., guix-commits, 2021/11/11
- 119/227: gnu: openssl: Absorb 1.1.1l graft., guix-commits, 2021/11/11
- 125/227: gnu: glib: Update to 2.70, specify a bindir prefix and hide package., guix-commits, 2021/11/11
- 132/227: gnu: webkitgtk: Add a debug output., guix-commits, 2021/11/11
- 157/227: gnu: python-dateutil: Update to 2.8.2., guix-commits, 2021/11/11
- 116/227: gnu: mesa: Update to 21.2.4., guix-commits, 2021/11/11
- 129/227: gnu: libsoup: Update to 3.0.1., guix-commits, 2021/11/11
- 120/227: gnu: mit-krb5: Absorb 1.19.2 graft., guix-commits, 2021/11/11
- 138/227: profiles: Add a gdk-pixbuf-loaders-cache-file hook.,
guix-commits <=
- 141/227: gnu: librsvg: Preserve the loaders.cache file., guix-commits, 2021/11/11
- 147/227: gnu: nss: Update to 3.71., guix-commits, 2021/11/11
- 153/227: gnu: boost: Update to 1.77.0., guix-commits, 2021/11/11
- 154/227: gnu: python-dbusmock: Update to 0.24.0., guix-commits, 2021/11/11
- 158/227: gnu: gdk-pixbuf: Remove obsolete jasper support., guix-commits, 2021/11/11
- 162/227: gnu: zxing-cpp: Update to 1.2.0-0.00783db., guix-commits, 2021/11/11
- 163/227: gnu: python-numpy: Update to 1.21.3 and cleanup., guix-commits, 2021/11/11
- 128/227: gnu: libsoup: Reverse inheritance relationship with libsoup-minimal., guix-commits, 2021/11/11
- 130/227: gnu: webkitgtk: Use libsoup 3 and build with GCC., guix-commits, 2021/11/11
- 118/227: gnu: cmake-bootstrap: Update to 3.21.3., guix-commits, 2021/11/11