[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/02: gnu: gdk-pixbuf: Honor GUIX_GDK_PIXBUF_MODULE_FILES search path.
From: |
guix-commits |
Subject: |
01/02: gnu: gdk-pixbuf: Honor GUIX_GDK_PIXBUF_MODULE_FILES search path. |
Date: |
Mon, 27 Jan 2025 14:05:44 -0500 (EST) |
lilyp pushed a commit to branch gnome-team
in repository guix.
commit b47d44674298e7c6e9486a70722c8d48550f6584
Author: Sou Bunnbu (宋文武) <iyzsong@gmail.com>
AuthorDate: Mon Jan 27 19:04:53 2025 +0800
gnu: gdk-pixbuf: Honor GUIX_GDK_PIXBUF_MODULE_FILES search path.
* gnu/packages/patches/gdk-pixbuf-honor-GUIX_GDK_PIXBUF_MODULE_FILES.patch:
New file.
* gnu/local.mk (dist_patch_DATA): Register patch.
* gnu/packages/gtk.scm (gdk-pixbuf)[source]: Add patch.
[native-search-paths]: Replace GDK_PIXBUF_MODULE_FILE with
GUIX_GDK_PIXBUF_MODULE_FILES.
Change-Id: Ibcf6ebf33f5de2c889bc27a88d59a5f444b77906
Fixes: GDK_PIXBUF_MODULE_FILE conflicts on foreign distros
<https://issues.guix.gnu.org/75523>
Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Signed-off-by: Liliana Marie Prikler <liliana.prikler@gmail.com>
---
gnu/local.mk | 1 +
gnu/packages/gtk.scm | 8 +++--
...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 ca7ff0a89a..56cf534ac3 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1398,6 +1398,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 fac94e293b..011a1db687 100644
--- a/gnu/packages/gtk.scm
+++ b/gnu/packages/gtk.scm
@@ -725,7 +725,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
@@ -779,9 +782,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