diff options
-rw-r--r-- | gnu/local.mk | 1 | ||||
-rw-r--r-- | gnu/packages/gtk.scm | 8 | ||||
-rw-r--r-- | gnu/packages/patches/gdk-pixbuf-honor-GUIX_GDK_PIXBUF_MODULE_FILES.patch | 34 |
3 files changed, 40 insertions, 3 deletions
diff --git a/gnu/local.mk b/gnu/local.mk index 326875133f..a7a3238669 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1408,6 +1408,7 @@ dist_patch_DATA = \ %D%/packages/patches/gd-fix-tests-on-i686.patch \ %D%/packages/patches/gd-brect-bounds.patch \ %D%/packages/patches/gdb-hurd64.patch \ + %D%/packages/patches/gdk-pixbuf-honor-GUIX_GDK_PIXBUF_MODULE_FILES.patch \ %D%/packages/patches/gdm-default-session.patch \ %D%/packages/patches/gdm-remove-hardcoded-xwayland-path.patch \ %D%/packages/patches/gdm-wayland-session-wrapper-from-env.patch \ diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm index 35baf938fe..15b43da636 100644 --- a/gnu/packages/gtk.scm +++ b/gnu/packages/gtk.scm @@ -726,7 +726,10 @@ highlighting and other features typical of a source code editor.") name "-" version ".tar.xz")) (sha256 (base32 - "1iz392vrlrnb92hrak697bgndsbkrcxhqxilxn6f99xr8ls5nl5r")))) + "1iz392vrlrnb92hrak697bgndsbkrcxhqxilxn6f99xr8ls5nl5r")) + (patches + (search-patches + "gdk-pixbuf-honor-GUIX_GDK_PIXBUF_MODULE_FILES.patch")))) (build-system meson-build-system) (outputs '("out" "debug")) (arguments @@ -780,9 +783,8 @@ highlighting and other features typical of a source code editor.") ;; This file is produced by the gdk-pixbuf-loaders-cache-file ;; profile hook. (list (search-path-specification - (variable "GDK_PIXBUF_MODULE_FILE") + (variable "GUIX_GDK_PIXBUF_MODULE_FILES") (files (list %gdk-pixbuf-loaders-cache-file)) - (separator #f) ;single valued (file-type 'regular)))) (synopsis "Image loading library") (description "GdkPixbuf is a library that loads image data in various diff --git a/gnu/packages/patches/gdk-pixbuf-honor-GUIX_GDK_PIXBUF_MODULE_FILES.patch b/gnu/packages/patches/gdk-pixbuf-honor-GUIX_GDK_PIXBUF_MODULE_FILES.patch new file mode 100644 index 0000000000..4e97d3aa5b --- /dev/null +++ b/gnu/packages/patches/gdk-pixbuf-honor-GUIX_GDK_PIXBUF_MODULE_FILES.patch @@ -0,0 +1,34 @@ +This patch makes gdk-pixbuf look for additional modules in a list of files +specified by the environment variable "GUIX_GDK_PIXBUF_MODULE_FILES". + +A similiar patch for "GDK_PIXBUF_MODULE_FILES" had been sent to upstream: + https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/merge_requests/180 + +We use a "GUIX_" prefixed one to avoid breaking foreign programs: + https://issues.guix.gnu.org/63853 + https://issues.guix.gnu.org/75523 + +Upstream-status: N/A +--- +diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c +index e1df590..913ce89 100644 +--- a/gdk-pixbuf/gdk-pixbuf-io.c ++++ b/gdk-pixbuf/gdk-pixbuf-io.c +@@ -670,6 +670,17 @@ gdk_pixbuf_io_init (void) + gboolean ret; + + gdk_pixbuf_io_init_builtin (); ++ ++ /* Load modules from GUIX_GDK_PIXBUF_MODULE_FILES. */ ++ gchar *module_files_env = g_getenv ("GUIX_GDK_PIXBUF_MODULE_FILES"); ++ if (module_files_env) { ++ gchar **module_files = g_strsplit (module_files_env, ++ G_SEARCHPATH_SEPARATOR_S, 0); ++ for (int i = 0; module_files[i] != NULL; i++) ++ gdk_pixbuf_io_init_modules (module_files[i], NULL); ++ g_strfreev (module_files); ++ } ++ + #ifdef USE_GMODULE + module_file = gdk_pixbuf_get_module_file (); + #endif |