I currently run media-gfx/gimp-2.99.18-r1[-X] but have x11-libs/cairo and x11-libs/gtk+ built with the X USE flag. This combination works fine for me, but as of >=media-gfx/gimp-2.99.18-r2 no longer satisfies Gimp's dependencies, since it depends on [X=] for Cairo, GTK+, Pango and libwmf. That means I'll need to build Gimp with X (which I don't need/want) or Cairo and GTK+ without X (which breaks other packages). Reading the discussion in bug 942358 there is no indication that Gimp built without X does not work correctly when Cairo/GTK+/Pango/libwmf are built with X. I believe Gimp's [X=] USE dependencies should be replaced with [X?]. Reproducible: Always Steps to Reproduce: 1. USE=X emerge x11-libs/cairo x11-libs/gtk+ 2. USE=-X emerge '>=media-gfx/gimp-2.99.18-r2' Actual Results: Portage refuses to build Gimp. Expected Results: Gimp gets compiled.
Created attachment 908358 [details] emerge --info
> I believe Gimp's [X=] USE dependencies should be replaced with [X?]. No. The gimp[-X] fails to built with gtk+[X] etc. Initially I think about [X?] flags but then gimp[-X] failed on configuration phase (pkgconfig etc) or later with others x11-libs/*[X] or its x11-libs/*[X] dependencies. To test it I switched to wayland session and remove some x11 libs that are required. Otherwise it will require to "fix" gtk+, pango, cairo, libwmf. > I currently run media-gfx/gimp-2.99.18-r1[-X] but have x11-libs/cairo and x11-libs/gtk+ built with the X USE flag. But why? The gimp[X] bring additionnaly xcursor library and others are already presented in the system in your case.
> media-gfx/gimp-2.99.18-r1[-X] I.e. this only brings libXcursor feature while gimp-2.99.18-r2 fix additional x11-libs/* optional dependensies e.g. for wayland session. I thought about separate USE="xcursor" but desides it's too tiny to split it from USE="X".
(In reply to Sergey Torokhov from comment #2) > > I believe Gimp's [X=] USE dependencies should be replaced with [X?]. > > No. The gimp[-X] fails to built with gtk+[X] etc. Initially I think about > [X?] flags but then gimp[-X] failed on configuration phase (pkgconfig etc) > or later with others x11-libs/*[X] or its x11-libs/*[X] dependencies. To > test it I switched to wayland session and remove some x11 libs that are > required. Otherwise it will require to "fix" gtk+, pango, cairo, libwmf. Well, I suppose you did better testing than I did. I successfully build Gimp with -X, but I'll admit that the dependencies of that flag happen to be installed on my system. Seems like I unknowingly built it with X11 support anyway. > > I currently run media-gfx/gimp-2.99.18-r1[-X] but have x11-libs/cairo and x11-libs/gtk+ built with the X USE flag. > > But why? The gimp[X] bring additionnaly xcursor library and others are > already presented in the system in your case. I mostly use Wayland-native applications and therefore disable the X USE flag globally. I enabled it for the few packages that actually need it. It struck me as odd that I now need to enable X on Gimp (and Pango) so that I can have it enabled on GTK+ and Cairo. I still think this is not ideal, but if there's no way to overrule the magic in Gimp's build system, feel free to close this bug.
(In reply to Sebastian Hamann from comment #4) > (In reply to Sergey Torokhov from comment #2) > > > I believe Gimp's [X=] USE dependencies should be replaced with [X?]. > > > > No. The gimp[-X] fails to built with gtk+[X] etc. Initially I think about > > [X?] flags but then gimp[-X] failed on configuration phase (pkgconfig etc) > > or later with others x11-libs/*[X] or its x11-libs/*[X] dependencies. To > > test it I switched to wayland session and remove some x11 libs that are > > required. Otherwise it will require to "fix" gtk+, pango, cairo, libwmf. > > Well, I suppose you did better testing than I did. > I successfully build Gimp with -X, but I'll admit that the dependencies of > that flag happen to be installed on my system. Seems like I unknowingly > built it with X11 support anyway. Have not dug into this, but this feels suspiciously similar to Bug 942352 and Bug 903707. There's some automagic stuff going on there as well that causes the build to fail if some x11-libs/* are built with +X.
Yes, it looks similar with my case. I'm thinking about to retry build gimp that way to reproduce it and when put logs here.
Seems like a two part fix: In src_prepare(): use !X && sed -i -e 's/x11_target = /x11_target = false #/' meson.build || die In src_configure(): use X || append-cflags -DGENTOO_GTK_HIDE_X11 (looking at the meson.build code below the x11_target line, appears there is an automagic X only dependency on x11-libs/libXfixes too) I've only investigated with USE="-wmf" also on a machine that has all the X dependencies installed.
Use of GENTOO_GTK_HIDE_X11 should also make REQUIRED_USE="xpm? ( X )" unnecessary.
(In reply to Chris Mayo from comment #8) > Use of GENTOO_GTK_HIDE_X11 should also make REQUIRED_USE="xpm? ( X )" > unnecessary. Great thanks for proposed changes and tests. Currently I want to make gimp-3.0.2 bump and then I will test with this changes.
Created attachment 928505 [details] gimp-3.0.2-r1.ebuild Could anybody test attached gimp-3.0.2-r1.ebuild on wayland-based system? I'm not sure if REQUIRED_USE="?? ( X wayland )" is really needed here but afraid the order in > # defang automagic dependencies. Bug 943164 > use wayland || append-flags -DGENTOO_GTK_HIDE_WAYLAND > use X || append-flags -DGENTOO_GTK_HIDE_X11 could affect.
(In reply to Sergey Torokhov from comment #10) > Created attachment 928505 [details] > gimp-3.0.2-r1.ebuild > > Could anybody test attached gimp-3.0.2-r1.ebuild on wayland-based system? Builds and starts fine on my system with 'wayland -X'. But I can still run Gimp in Xwayland, so I think it still builds with X support. It may be a runtime thing, though. I still have all dependencies for X support installed.
Looking at the attachment it doesn't have: use !X && sed -i -e 's/x11_target = /x11_target = false #/' meson.build || die The line it is editing is: x11_target = gtk3.get_variable(pkgconfig: 'targets').contains('x11') so that won't be affected by append-flags.
... or actually looks like the sed only saves some dependency checking (In reply to Sebastian Hamann from comment #11) > > Builds and starts fine on my system with 'wayland -X'. > But I can still run Gimp in Xwayland, so I think it still builds with X > support. It may be a runtime thing, though. I still have all dependencies > for X support installed. Running x11-apps/xprop and moving the cursor over an application indicates if it is running as an X application by changing to a cross (and you can also then click on it)
... maybe you already meant by "running in Xwayland" that you had checked. The only other thing I can see is that the append-flags are in src_prepare() not src_configure() - and append-cflags was enough for me. Unclear if any that would make a difference though.
(In reply to Chris Mayo from comment #14) > ... maybe you already meant by "running in Xwayland" that you had checked. Yes, that's what I meant. To be very clear: I can run gimp-3.0.2-r2 as a Wayland native application *and* as an X11 application on my system.
OK. Me too (with GDK_BACKEND=x11). I think that is expected when GTK itself has X11 support - maybe some things in GIMP won't work properly.
(In reply to Chris Mayo from comment #14) > ... maybe you already meant by "running in Xwayland" that you had checked. > > The only other thing I can see is that the append-flags are in src_prepare() > not src_configure() - and append-cflags was enough for me. Unclear if any > that would make a difference though. Yes, it's my fault. I will fix and then recheck. When initially I set gtk[X=] etc dependencies I have to rebuild the set of dependencies with USE=X to check the Gimp build within wayland system. And the splash screen differs for me compare with Xorg system. I need to try build with sed line mentioned by Chris Mayo too.
I checked the sed and it is needed - Meson's dependency() defaults to required=true. I don't have x11-libs/libXmu installed, without the sed I get a failure: Run-time dependency xmu found: NO (tried pkgconfig and cmake) meson.build:707:21: ERROR: Dependency "xmu" not found, tried pkgconfig and cmake On append-flags, meson.build has project('gimp', 'c', 'cpp', so maybe append-flags is safer after all. I really don't know.
Created attachment 929041 [details] gimp-3.0.2-r2 I'm not able to reproduce initial problem anymore but I prepared new Gimp revision and tested it within KDE Plasma Wayland session with x11-libs/gtk+:3[-X] x11-libs/pango[-X] and x11-libs/cairo[-X] preliminary rebuilded. The same patched ebuild I'm planing to use for Gimp-3.0.4 release. The `use !X && sed -i -e 's/x11_target = /x11_target = false #/' meson.build || die` patch seems isn't required as `append-cflags -DGENTOO_GTK_HIDE_X11` is used.
Created attachment 929042 [details] gimp-3.0.2-r2 Yes, if gtk+[X] is built then libXmu is actually searched on configuration phase despite of trying to configure gimp[-X -xpm wayland]. I replace the ebuild with sed. Thanks.
Created attachment 929043 [details] gimp-3.0.2-r2
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=20a34f246d1cc42b98880edef15abd07de26ed5b commit 20a34f246d1cc42b98880edef15abd07de26ed5b Author: Sergey Torokhov <torokhov-s-a@yandex.ru> AuthorDate: 2025-05-19 17:59:37 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-05-21 20:58:25 +0000 media-gfx/gimp: 3.0.2-r2 revbump, depend on [X?] instead of [X=] Compared with gimp-3.0.2-r1 add USE="wayland" with forced disabling of 'x11_target', add 'append-cflags -DGENTOO_GTK_HIDE_WAYLAND' or 'append-cflags -DGENTOO_GTK_HIDE_X11' depend on USE='wayland' or 'X' Closes: https://bugs.gentoo.org/943164 Signed-off-by: Sergey Torokhov <torokhov-s-a@yandex.ru> Part-of: https://github.com/gentoo/gentoo/pull/42157 Signed-off-by: Sam James <sam@gentoo.org> media-gfx/gimp/gimp-3.0.2-r2.ebuild | 248 ++++++++++++++++++++++++++++++++++++ 1 file changed, 248 insertions(+) Additionally, it has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=090e2767abb07926d6b9249bcac10833b01ee944 commit 090e2767abb07926d6b9249bcac10833b01ee944 Author: Sergey Torokhov <torokhov-s-a@yandex.ru> AuthorDate: 2025-05-19 18:06:44 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-05-21 20:58:26 +0000 media-gfx/gimp: 3.0.4 version bump Bug: https://bugs.gentoo.org/936290 Bug: https://bugs.gentoo.org/943164 Signed-off-by: Sergey Torokhov <torokhov-s-a@yandex.ru> Part-of: https://github.com/gentoo/gentoo/pull/42157 Closes: https://github.com/gentoo/gentoo/pull/42157 Signed-off-by: Sam James <sam@gentoo.org> media-gfx/gimp/Manifest | 1 + media-gfx/gimp/gimp-3.0.4.ebuild | 248 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 249 insertions(+)
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=279d9c96b379fbf5a037a513fdef6297193bb05c commit 279d9c96b379fbf5a037a513fdef6297193bb05c Author: Sam James <sam@gentoo.org> AuthorDate: 2025-05-21 23:49:03 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2025-05-21 23:49:03 +0000 profiles: mask new gimp versions When merging the bumps for GIMP, I'd erred on the side of "well, any automagic is definitely bad", but the UX of exactly-one-of X or Wayland isn't great, so let's discuss it more in bug #956402 first. Bug: https://bugs.gentoo.org/943164 Bug: https://bugs.gentoo.org/956402 Signed-off-by: Sam James <sam@gentoo.org> profiles/package.mask | 5 +++++ 1 file changed, 5 insertions(+)