Files
gtk2/debian/patches/022_module-files-append-compat-module-files-d.patch
2010-04-10 13:01:35 +00:00

109 lines
3.5 KiB
Diff

Index: b/gtk/gtkimmodule.c
===================================================================
--- a/gtk/gtkimmodule.c 2010-04-10 14:52:09.765946296 +0200
+++ b/gtk/gtkimmodule.c 2010-04-10 14:52:10.681942580 +0200
@@ -29,6 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
#include <glib/gstdio.h>
#include <gmodule.h>
@@ -489,10 +490,32 @@
GTK_BINARY_VERSION,
"immodule-files.d",
NULL);
+
+#if defined(__linux__) && defined (__i386__)
+ gchar *compat_im_module_files_d_str = g_build_filename ("/usr/lib32/gtk-2.0",
+ GTK_BINARY_VERSION,
+ "immodule-files.d",
+ NULL);
+#elif defined(__linux__) && ( defined (__x86_64__) || defined(__ia64__) )
+ gchar *compat_im_module_files_d_str = g_build_filename ("/usr/lib64/gtk-2.0",
+ GTK_BINARY_VERSION,
+ "immodule-files.d",
+ NULL);
+#endif
FILE *file;
gchar *list_str;
char **files;
int n;
+#if defined(__linux__) && ( defined(__i386__) || defined (__x86_64__) || defined(__ia64__) )
+ /* prefer compat_im_module_files_d_str over im_module_files_d_str on the
+ * above arches if it's usable */
+ if (! g_access(compat_im_module_files_d_str, R_OK|X_OK))
+ list_str = g_strjoin (G_SEARCHPATH_SEPARATOR_S,
+ compat_im_module_files_d_str,
+ im_module_file_str,
+ NULL);
+ else /* continued below */
+#endif
list_str = g_strjoin (G_SEARCHPATH_SEPARATOR_S,
im_module_files_d_str,
@@ -544,6 +567,9 @@
g_strfreev (files);
g_free (list_str);
+#if defined(__linux__) && ( defined(__i386__) || defined (__x86_64__) || defined(__ia64__) )
+ g_free (compat_im_module_files_d_str);
+#endif
g_free (im_module_files_d_str);
g_free (im_module_file_str);
}
Index: b/gdk-pixbuf/gdk-pixbuf-io.c
===================================================================
--- a/gdk-pixbuf/gdk-pixbuf-io.c 2010-04-10 14:52:10.065944562 +0200
+++ b/gdk-pixbuf/gdk-pixbuf-io.c 2010-04-10 14:52:10.685945884 +0200
@@ -554,6 +554,18 @@
#ifdef USE_GMODULE
GIOChannel *channel;
gchar *gdkpixbuf_module_file_str = gdk_pixbuf_get_module_file ();
+
+#if defined(__linux__) && defined (__i386__)
+ gchar *compat_gdkpixbuf_module_files_d_str = g_build_filename ("/usr/lib32/gtk-2.0",
+ GTK_BINARY_VERSION,
+ "loader-files.d",
+ NULL);
+#elif defined(__linux__) && ( defined (__x86_64__) || defined(__ia64__) )
+ gchar *compat_gdkpixbuf_module_files_d_str = g_build_filename ("/usr/lib64/gtk-2.0",
+ GTK_BINARY_VERSION,
+ "loader-files.d",
+ NULL);
+#endif
gchar *list_str;
char **files;
GError *error = NULL;
@@ -640,6 +652,18 @@
#undef load_one_builtin_module
#ifdef USE_GMODULE
+
+#if defined(__linux__) && ( defined(__i386__) || defined (__x86_64__) || defined(__ia64__) )
+ /* prefer compat_gdkpixbuf_module_files_d_str over PIXBUF_FILES_LIBDIR
+ * on the above arches if it's usable */
+ if (! g_access(compat_gdkpixbuf_module_files_d_str, R_OK|X_OK))
+ list_str = g_strjoin (G_SEARCHPATH_SEPARATOR_S,
+ gdkpixbuf_module_file_str,
+ compat_gdkpixbuf_module_files_d_str,
+ NULL);
+ else /* continued below */
+#endif
+
list_str = g_strjoin (G_SEARCHPATH_SEPARATOR_S,
gdkpixbuf_module_file_str,
PIXBUF_FILES_LIBDIR,
@@ -695,6 +719,10 @@
}
g_strfreev (files);
+#if defined(__linux__) && ( defined(__i386__) || defined (__x86_64__) || defined(__ia64__) )
+
+ g_free (compat_gdkpixbuf_module_files_d_str);
+#endif
g_free (list_str);
g_free (gdkpixbuf_module_file_str);
#endif