Subject: Re: bug#75688: GUIX_ify harmful environment variables and replace wrapper scripts with search path value files

From: Maxim Cournoyer <[email-masked]>
Date: Mon, 27 Jan 2025 12:03:44 +0900

Hi,

[email-masked] writes:

> From: 宋文武 <[email-masked]>
>
> This fixes <https://issues.guix.gnu.org/75523>.
>
> * gnu/packages/patches/gdk-pixbuf-respect-GUIX_GDK_PIXBUF_MODULE_FILES.patch:

nitpick: I'd name this patch
gdk-pixbuf-honor-GUIX_GDK_PIXBUF_MODULE_FILES.patch (s/respect/honor/).

[...]

> +              (patches
> +               (search-patches
> +                "gdk-pixbuf-respect-GUIX_GDK_PIXBUF_MODULE_FILES.patch"))))
>      (build-system meson-build-system)
>      (outputs '("out" "debug"))
>      (arguments
> @@ -777,9 +780,8 @@ (define-public gdk-pixbuf
>       ;; 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-respect-GUIX_GDK_PIXBUF_MODULE_FILES.patch b/gnu/packages/patches/gdk-pixbuf-respect-GUIX_GDK_PIXBUF_MODULE_FILES.patch
> new file mode 100644
> index 0000000000..eb22761403
> --- /dev/null
> +++ b/gnu/packages/patches/gdk-pixbuf-respect-GUIX_GDK_PIXBUF_MODULE_FILES.patch
> @@ -0,0 +1,18 @@
> +diff --git a/gdk-pixbuf/gdk-pixbuf-io.c b/gdk-pixbuf/gdk-pixbuf-io.c
> +index e1df590..ba24cf6 100644
> +--- a/gdk-pixbuf/gdk-pixbuf-io.c
> ++++ b/gdk-pixbuf/gdk-pixbuf-io.c
> +@@ -670,6 +670,13 @@ gdk_pixbuf_io_init (void)
> + 	gboolean ret;
> + 
> + 	gdk_pixbuf_io_init_builtin ();
> ++
> ++	/* Load loaders from GUIX_GDK_PIXBUF_MODULE_FILES. */

nitpick: "Load loaders" reads a bit loaded ;-).  I'd write "Load modules
[...]" instead.

> ++	gchar **guix_module_files = g_build_guix_search_path_dirs ("GUIX_GDK_PIXBUF_MODULE_FILES");
> ++	for (int i = 0; guix_module_files[i] != NULL; i++)

nitpick: I read a long time ago that ++i achieves the same and is more
efficient, though I forgot the reasons.  Probably doesn't matter here,
but could be neater (here and elsewhere).

Otherwise, for this commit alone,

Reviewed-by: Maxim Cournoyer <maxim.cournoyer@gmail>

(You'll want to give this series plenty of time for others to chime in).

-- 
Thanks,
Maxim