~ubuntu-desktop/gdk-pixbuf/ubuntu

« back to all changes in this revision

Viewing changes to debian/patches/041_ia32-libs.patch

  • Committer: Sebastien Bacher
  • Date: 2011-02-16 17:55:47 UTC
  • Revision ID: seb128@ubuntu.com-20110216175547-2mehn53ki1e41je1
Tags: 2.23.0-1ubuntu1
releasing version 2.23.0-1ubuntu1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
--- a/gdk-pixbuf/gdk-pixbuf-io.c
2
 
+++ b/gdk-pixbuf/gdk-pixbuf-io.c
3
 
@@ -303,8 +303,20 @@ gdk_pixbuf_get_module_file (void)
 
1
Index: gdk-pixbuf-2.21.7/gdk-pixbuf/gdk-pixbuf-io.c
 
2
===================================================================
 
3
--- gdk-pixbuf-2.21.7.orig/gdk-pixbuf/gdk-pixbuf-io.c   2010-07-10 02:52:30.000000000 +0200
 
4
+++ gdk-pixbuf-2.21.7/gdk-pixbuf/gdk-pixbuf-io.c        2010-09-10 15:41:29.312943754 +0200
 
5
@@ -303,8 +303,20 @@
4
6
   gchar *result = g_strdup (g_getenv ("GDK_PIXBUF_MODULE_FILE"));
5
7
 
6
8
   if (!result)
9
11
+    {
10
12
+#if defined(__linux__) && ( defined(__i386__) || defined (__x86_64__) || defined(__ia64__) )
11
13
+# if defined (__i386__)
12
 
+      result = g_build_filename ("/usr", "lib32", "gdk-pixbuf-2.0", GDK_PIXBUF_BINARY_VERSION, "loaders.cache", NULL);
 
14
+      result = g_build_filename (GDK_PIXBUF_LIBDIR, "gdk-pixbuf-2.0", GDK_PIXBUF_BINARY_VERSION, "loaders.cache.32", NULL);
13
15
+# else
14
 
+      result = g_build_filename ("/usr", "lib64", "gdk-pixbuf-2.0", GDK_PIXBUF_BINARY_VERSION, "loaders.cache", NULL);
 
16
+      result = g_build_filename (GDK_PIXBUF_LIBDIR, "gdk-pixbuf-2.0", GDK_PIXBUF_BINARY_VERSION, "loaders.cache.64", NULL);
15
17
+#endif
16
18
+      /* Prefer compat gdk-pixbuf.loaders file if it's usable. */
17
19
+      if (g_file_test(result, G_FILE_TEST_EXISTS))
23
25
   return result;
24
26
 }
25
27
 
26
 
--- a/gdk-pixbuf/queryloaders.c
27
 
+++ b/gdk-pixbuf/queryloaders.c
28
 
@@ -303,14 +303,28 @@ int main (int argc, char **argv)
29
 
 #ifdef USE_GMODULE
30
 
                 const char *path;
31
 
                 GDir *dir;
32
 
+#if defined(__linux__) && defined(__i386__)
33
 
+               gchar *tmp;
34
 
+#endif
35
 
 
36
 
                 path = g_getenv ("GDK_PIXBUF_MODULEDIR");
37
 
 #ifdef G_OS_WIN32
38
 
                 if (path != NULL && *path != '\0')
39
 
                         path = g_locale_to_utf8 (path, -1, NULL, NULL, NULL);
40
 
 #endif
41
 
-                if (path == NULL || *path == '\0')
42
 
+                if (path == NULL || *path == '\0') {
43
 
+#if defined(__linux__) && defined(__i386__)
44
 
+                       /* Prefer compat path first (i386 running on x86_64) */
45
 
+                       tmp = g_build_filename ("/usr", "lib32", "gdk-pixbuf-2.0", GDK_PIXBUF_BINARY_VERSION, "loaders", NULL);
46
 
+
47
 
+                       if (g_file_test (tmp, G_FILE_TEST_IS_DIR))
48
 
+                               path = (const char *) tmp;
49
 
+                       else
50
 
+                               path = PIXBUF_LIBDIR;
51
 
+#else
52
 
                         path = PIXBUF_LIBDIR;
53
 
+#endif
54
 
+               }
55
 
 
56
 
                 g_string_append_printf (contents, "# LoaderDir = %s\n#\n", path);
57
 
 
58
 
@@ -327,6 +341,9 @@ int main (int argc, char **argv)
59
 
                         }
60
 
                         g_dir_close (dir);
61
 
                 }
62
 
+#if defined(__linux__) && defined(__i386__)
63
 
+               g_free (tmp);
64
 
+#endif
65
 
 #else
66
 
                 g_string_append_printf (contents, "# dynamic loading of modules not supported\n");
67
 
 #endif