Created attachment 880228 [details] colorsvg2png.c for gimp-2.99.10 that allow to compile with libsrvg-2.40 The latest Gimp 3 fails to compile with =gnome-base/librsvg-2.40.21. The problem is struct RsvgRectangle appeared in librsvg-2.46. The two ways of fixing this issue are 1) Change librsvg dependency in the ebuild. Any version >= 2.46 should work. Some people will not like it because virtual/rust is a requirement to compile librsvg version >2.40 (*yicks*) -OR- 2) Make a patch to undo a little change between gimp-2.99.16 and gimp-2.99.10. The offending file is colorsvg2png.c in tools directory. Please see provided file which comes from https://download.gimp.org/gimp/v2.99/gimp-2.99.10.tar.bz2 tarball. Replacing the file in the build, just make this package compile again with gnome-base/librsvg-2.40.21. No issue observed so ever. [12/3574] x86_64-pc-linux-gnu-gcc -Itools/colorsvg2png.p -Itools -I../gimp-2.99.16/tools -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/librsvg-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/lib64/libffi/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/libpng16 -I/usr/include/pixman-1 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -march=corei7-avx -O2 -fomit-frame-pointer -pipe -pthread -MD -MQ tools/colorsvg2png.p/colorsvg2png.c.o -MF tools/colorsvg2png.p/colorsvg2png.c.o.d -o tools/colorsvg2png.p/colorsvg2png.c.o -c ../gimp-2.99.16/tools/colorsvg2png.c FAILED: tools/colorsvg2png.p/colorsvg2png.c.o x86_64-pc-linux-gnu-gcc -Itools/colorsvg2png.p -Itools -I../gimp-2.99.16/tools -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/librsvg-2.0 -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/lib64/libffi/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/libpng16 -I/usr/include/pixman-1 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -march=corei7-avx -O2 -fomit-frame-pointer -pipe -pthread -MD -MQ tools/colorsvg2png.p/colorsvg2png.c.o -MF tools/colorsvg2png.p/colorsvg2png.c.o.d -o tools/colorsvg2png.p/colorsvg2png.c.o -c ../gimp-2.99.16/tools/colorsvg2png.c ../gimp-2.99.16/tools/colorsvg2png.c: In function 'main': ../gimp-2.99.16/tools/colorsvg2png.c:28:3: error: unknown type name 'RsvgRectangle'; did you mean 'RsvgHandle'? 28 | RsvgRectangle target_rect; | ^~~~~~~~~~~~~ | RsvgHandle
If you're going to make such a request, it would be nice to format it as a patch, which isn't hard to do. See https://wiki.gentoo.org/wiki/Creating_a_patch. Anyway, thanks for the report.
Created attachment 880229 [details, diff] patch for gimp-2.99.16 to compile against libsrvg-2.40 Patch tested with libsrvg-2.40 only. May or may not compile with the latest libsrvg that requires Rust to compile.
The gnome-base/libsrvg-2.40 was unkeyworded where it possible three years ago for security reasons. I don't know is it reasonable to restore compatibility for it and how many packages incompatible with librsvg-2.40. Maybe conditional patching will be suitable here with checking the installed librsvg version to avoid some other issues that could appear for >=librsvg-2.56 if apply patch unconditionally. I could prepare and test new ebuild revision for it.
(In reply to Sergey Torokhov from comment #3) > The gnome-base/libsrvg-2.40 was unkeyworded where it possible three years > ago for security reasons. I don't know is it reasonable to restore > compatibility for it and how many packages incompatible with librsvg-2.40. librsvg-2.40 is still keyworded in portage tree. GTK3 and GTK4 (and many more) can still use it.
I finaly tried this revert compilation of two upstream patch against new gimp-2.99.18 release and it's insufficient to build gimp-2.99 against gnome-base/librsvg-2.40.21 due to error (with gcc-13): FAILED: plug-ins/common/file-svg.p/file-svg.c.o x86_64-pc-linux-gnu-gcc -Iplug-ins/common/file-svg.p -Iplug-ins/common -I../gimp-2.99.18/plug-ins/common -I. -I../gimp-2.99.18 -I/usr/include/gtk-3.0 -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/atk-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/harfbuzz -I/usr/include/freetype2 -I/usr/lib64/libffi/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/libpng16 -I/usr/include/pixman-1 -I/usr/include/at-spi2-atk/2.0 -I/usr/include/at-spi-2.0 -I/usr/include/dbus-1.0 -I/usr/lib64/dbus-1.0/include -I/usr/include/fribidi -I/usr/include/gio-unix-2.0 -I/usr/include/gegl-0.4 -I/usr/include/json-glib-1.0 -I/usr/include/babl-0.1 -I/usr/include/librsvg-2.0 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wabsolute-value -Wdeclaration-after-statement -Wenum-conversion -Wno-strict-prototypes -Wold-style-definition -Wunused-function -Wunused-value -Werror=implicit-function-declaration -fdiagnostics-show-option -fno-common -Wformat -Wformat-security -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-format-attribute -Wpointer-arith -Wreturn-type -Wtype-limits -DHAVE_CONFIG_H -march=native -O2 -pipe -Wno-incompatible-pointer-types -pthread -MD -MQ plug-ins/common/file-svg.p/file-svg.c.o -MF plug-ins/common/file-svg.p/file-svg.c.o.d -o plug-ins/common/file-svg.p/file-svg.c.o -c ../gimp-2.99.18/plug-ins/common/file-svg.c ../gimp-2.99.18/plug-ins/common/file-svg.c: In function ‘load_rsvg_pixbuf’: ../gimp-2.99.18/plug-ins/common/file-svg.c:544:3: warning: ‘rsvg_handle_set_size_callback’ is deprecated [-Wdeprecated-declarations] 544 | rsvg_handle_set_size_callback (handle, load_set_size_callback, vals, NULL); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from ../gimp-2.99.18/plug-ins/common/file-svg.c:29: /usr/include/librsvg-2.0/librsvg/rsvg.h:225:6: note: declared here 225 | void rsvg_handle_set_size_callback (RsvgHandle * handle, | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../gimp-2.99.18/plug-ins/common/file-svg.c:544:66: error: incompatible type for argument 3 of ‘rsvg_handle_set_size_callback’ 544 | rsvg_handle_set_size_callback (handle, load_set_size_callback, vals, NULL); | ^~~~ | | | SvgLoadVals /usr/include/librsvg-2.0/librsvg/rsvg.h:227:46: note: expected ‘gpointer’ {aka ‘void *’} but argument is of type ‘SvgLoadVals’ 227 | gpointer user_data, GDestroyNotify user_data_destroy); | ~~~~~~~~~^~~~~~~~~ This line was added in upstream commit https://gitlab.gnome.org/GNOME/gimp/-/commit/c9b114e6e9c0dc1d7620fac018402029deb06551 along with many other changes of `plug-ins/common/file-svg.c` file. This changes were made before 2.99.16 release. Does the gimp-2.99.16 was built successfully with your patch? What gcc version was used by you? I'm not a fan of rust but I still think it's more reasonable to use `dev-lang/rust-bin` to build new `gnome-base/librsvg` instead of trying to support gimp against too old gnome-base/librsvg-2.40.21 :(
I also assume that there is should be another possibility to avoid of installing of rust - to use binary librsvg from official Gentoo bin repository where it's available: https://wiki.gentoo.org/wiki/Gentoo_Binary_Host_Quickstart
(In reply to Sergey Torokhov from comment #6) Still no problem on my side compiling with my patch & sys-devel/gcc-13.2.1_p20240210:13::gentoo Might be relevant or not, I'm compiling gimp only with jpeg2k and webp flags enabled, all others off. My patch completely replace one file (no other modification) with one of an older version of gimp (2.99.10) Going rust would be sad, just for installing 50Megs+ to compile only one library in my system.
Yes, gimp-2.99.16 is compiled with patch but gimp-2.99.18 isn't with the error above. Therefore this is required additional support of unsupported old version '=gnome-base/librsvg-2.40.21' and gimp-2.99.16 anyway will be dropped rather soon after update portage tree with gimp-2.99.18. I could attached the 'gimp-2.99.16-r1.ebuild' with conditional patch to build against librsvg-2.40.21 but please also consider the migration to new version of librsvg from official Gentoo binary repository then there is no need to install rust as librsvg library is already compiled.
Created attachment 886557 [details, diff] gimp-2.99_revert_for_librvg-2.40.21.patch
Created attachment 886558 [details] gimp-2.99.16-r1.ebuild
The media-gfx/gimp-2.99.16 was dropped as planning and proposed patch isn't compatible with gimp-2.99.18 as was mentioned above. I close this issue as obsolete.