Subject: bug#78537: closed (Re: bug#78667: gimp crashes on startup on Ubuntu 25.10 foreign distro)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 08 Jul 2025 16:36:07 +0000

Your bug report

#78667: GIMP startup crash on minimal xorg/wm unless gtk+ in profile

which was filed against the guix package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
78667: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=78667
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#78667: gimp crashes on startup on Ubuntu 25.10 foreign distro
From: Maxim Cournoyer <[email-masked]>
To: Runciter <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked]
Date: Tue, 08 Jul 2025 22:09:56 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

Hi,

Runciter <[email-masked]> writes:

> * gnu/packages/gimp.scm (gimp-3)[arguments]<phases>:
>   Wrap value of GDK_PIXBUF_MODULE_FILE in wrapper script.
>   Add wrapping for gtk+ data files in prefix to XDG_DATA_DIRS.
>   Add wrapping for ahared-mime-info data files in prefix to XDG_DATA_DIRS.
>   Change wrapping of GI_TYPELIB_PATH and GUIX_PYTHONPATH to prefix.

Pushed as 6f9e15b913853762707f31974156069708b06e3b with some
modifications. The commit message now reads:

--8<---------------cut here---------------start------------->8---
gnu: gimp-3: Fix execution outside of a profile.

* gnu/packages/gimp.scm (gimp-3) [arguments]
<phases> {wrap}: Adjust to wrap in prefix mode. Also wrap
GDK_PIXBUF_MODULE_FILE, and XDG_DATA_DIRS.
[native-inputs]: Add shared-mime-info.
--8<---------------cut here---------------end--------------->8---

[...]

>                        (wrap-program prog
> -                        ;; Ensure GI_TYPELIB_PATH is not extended from the
> +                        ;; Ensure GI_TYPELIB_PATH is not suffixed to the
>                          ;; environment, as it could cause Gimp to crash (see
>                          ;; bug#77921).
> -                        `("GI_TYPELIB_PATH" =
> +                        `("GI_TYPELIB_PATH" prefix
>                            (,(getenv "GI_TYPELIB_PATH")))
> -                        `("GUIX_PYTHONPATH" suffix
> -                          (,(getenv "GUIX_PYTHONPATH")))))
> +                        `("GUIX_PYTHONPATH" prefix
> +                          (,(getenv "GUIX_PYTHONPATH")))
> +                        `("GDK_PIXBUF_MODULE_FILE" =
> +                          (,(getenv "GDK_PIXBUF_MODULE_FILE")))
> +                        `("XDG_DATA_DIRS" prefix
> +                          (,(string-append #$gtk+ "/share")))
> +                        `("XDG_DATA_DIRS" prefix
> +                          (,(string-append #$shared-mime-info "/share")))))
>                      (find-files (string-append #$output "/bin")
>                                  (lambda (_ stat)
>                                    (eq? 'regular (stat:type stat))))))))))

XDG_DATA_DIRS need not be duplicated, and references to packages should
be done via this-package-input/this-package-native-input or
search-input-file rather than ungexp directly, as this would make
rewriting inputs impossible:

--8<---------------cut here---------------start------------->8---
@@ -460,13 +461,21 @@ (define-public gimp-3
                    (for-each
                     (lambda (prog)
                       (wrap-program prog
-                        ;; Ensure GI_TYPELIB_PATH is not extended from the
+                        ;; Ensure GI_TYPELIB_PATH is not suffixed to the
                         ;; environment, as it could cause Gimp to crash (see
                         ;; bug#77921).
-                        `("GI_TYPELIB_PATH" =
+                        `("GI_TYPELIB_PATH" prefix
                           (,(getenv "GI_TYPELIB_PATH")))
-                        `("GUIX_PYTHONPATH" suffix
-                          (,(getenv "GUIX_PYTHONPATH")))))
+                        `("GUIX_PYTHONPATH" prefix
+                          (,(getenv "GUIX_PYTHONPATH")))
+                        `("GDK_PIXBUF_MODULE_FILE" =
+                          (,(getenv "GDK_PIXBUF_MODULE_FILE")))
+                        `("XDG_DATA_DIRS" prefix
+                          (,(string-append #$(this-package-input "gtk+")
+                                           "/share")
+                           ,(string-append #$(this-package-native-input
+                                              "shared-mime-info")
+                                           "/share")))))
                     (find-files (string-append #$output "/bin")
                                 (lambda (_ stat)
                                   (eq? 'regular (stat:type stat))))))))))
@@ -478,7 +487,8 @@ (define-public gimp-3
     (native-inputs (modify-inputs (package-native-inputs gimp-2)
                      (prepend appstream-glib
                               gi-docgen
-                              libarchive)))))
+                              libarchive
+                              shared-mime-info)))))
--8<---------------cut here---------------end--------------->8---

I've followed-up with a couple additions, such as libjxl support.

Closing!

-- 
Thanks,
Maxim

Subject: GIMP startup crash on minimal xorg/wm unless gtk+ in profile
From: Runciter <[email-masked]>
To: [email-masked]
Date: Wed, 21 May 2025 15:34:39 +0000
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello Guix,

I've noticed that the new Gimp version 3.0.0 crashed on startup for me.
The error message is:

(gimp:5025): GLib-GIO-ERROR **: 22:39:28.588: Settings schema 'org.gtk.Settings.FileChooser' is not installed
/gnu/store/vk8xddd7cr2dcsqjwvvyrhidg1brdsaq-gimp-3.0.0/lib/gimp/3.0/plug-ins/script-fu/script-fu: fatal error: GIMP crashed
Trace/breakpoint trap

Or a variant thereof.

This probably happens because my GUI is a relatively minimal Xorg + dwm.
If I install the package gtk+ onto my home profile, then Gimp 3.0.0
starts, and its file chooser apparently works.

Anyway, I don't want to have dbus in my profile anymore, and although
I've seen on the news that Gimp is now a full-blown Gtk app, it *still*
does not seem to want to play completely nice with my window
manager. Well, that is to say, its main window doesn't tile. So, I put
my foot down, no Gimp for Runciter in the near future.

Still, it occurs to me that gtk+ should probably be a propagated
input of gimp-3. Some Package(s) which probably have a similar run-time
dependency situation seem to proceed like this; such as zathura having a
propagated input to girara having a propagated input to gtk+.

I'm going to submit a patch, in case it is helpful.

Regards,
Runciter