gentoo-ebuilds/games-puzzle/gweled/files/gweled-0.9.1-librsvg.patch
Ionen Wolkens 5250193d6c
games-puzzle/gweled: EAPI6->8, fix startup, icons, clang16
Also:
* GPL-2 -> GPL-2+
* replace dead HOMEPAGE
* remove -Wl,--export-dynamic, this used to fix a glade issue
  but glade is no longer used
* use gamestat, hopefully letting scores work (untested)
* drop unnecessary gentoo.patch, replace by --localstatedir

May still be a bit finnicky, but is not completely unusable.

Closes: https://bugs.gentoo.org/697514
Closes: https://bugs.gentoo.org/830532
Closes: https://bugs.gentoo.org/874738
Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
2022-11-11 03:26:31 -05:00

45 lines
1.1 KiB
Diff

Fix startup issues with >=librsvg-2.42.3
https://bugs.gentoo.org/697514
https://bugs.launchpad.net/gweled/+bug/1869038
--- a/src/sge_utils.c
+++ b/src/sge_utils.c
@@ -19,4 +19,5 @@
*/
+#include <gio/gio.h>
#include <gtk/gtk.h>
#include <librsvg/rsvg.h>
@@ -30,5 +31,6 @@
gchar *full_pathname;
GdkPixbuf *pixbuf = NULL;
- GError *error;
+ GError *error = NULL;
+ GFile *file;
full_pathname = g_strconcat(DATADIR "/pixmaps/",
@@ -38,11 +40,23 @@
pixbuf = rsvg_pixbuf_from_file_at_size (full_pathname, width,
height, &error);
- g_free (full_pathname);
+ if (pixbuf == NULL) {
+ // Some versions of librsvg need URI instead of path.
+ // https://gitlab.gnome.org/GNOME/librsvg/issues/198
+ g_clear_error (&error);
+ file = g_file_new_for_path (full_pathname);
+ g_free (full_pathname);
+ full_pathname = g_file_get_uri (file);
+ g_object_unref (file);
+ pixbuf = rsvg_pixbuf_from_file_at_size (full_pathname, width,
+ height, &error);
+ }
if (pixbuf == NULL)
- g_free (error);
+ g_error_free (error);
} else
g_warning ("%s not found", filename);
+ g_free (full_pathname);
+
return pixbuf;
}