summaryrefslogtreecommitdiff
path: root/package/libgtk2/old_patches/0815_ia32-hack.patch
blob: fb10d853a80b80357a3b9297b9fa1ba48fe78ab7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
--- gtk+-2.8.13/gdk-pixbuf/gdk-pixbuf-io.c~	2005-10-03 17:11:49.000000000 +0200
+++ gtk+-2.8.13/gdk-pixbuf/gdk-pixbuf-io.c	2006-03-01 20:33:36.524552192 +0100
@@ -32,6 +32,7 @@
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
+#include <sys/utsname.h>
 
 #include "gdk-pixbuf-private.h"
 #include "gdk-pixbuf-io.h"
@@ -276,8 +277,21 @@
   gchar *result = g_strdup (g_getenv ("GDK_PIXBUF_MODULE_FILE"));
 
   if (!result)
-	  result = g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "gdk-pixbuf.loaders", NULL);
+#if defined(__linux__) && defined (__i386__)
+	{
+	  struct utsname uts;
 
+	  uname(&uts);
+	  result = g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "gdk-pixbuf.loaders.32", NULL);
+	  if (strcmp("x86_64", uts.machine) || access(result, R_OK))
+	    {
+	      g_free(result);
+	      result = g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "gdk-pixbuf.loaders", NULL);
+	    }
+	}
+#else
+	  result = g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "gdk-pixbuf.loaders", NULL);
+#endif
   return result;
 }
 
--- gtk+-2.8.13/gtk/gtkprivate.h~	2005-03-22 03:14:55.000000000 +0100
+++ gtk+-2.8.13/gtk/gtkprivate.h	2006-03-01 19:51:42.510740384 +0100
@@ -96,6 +96,13 @@
 
 #endif /* G_OS_WIN32 */
 
+#if defined(__linux__) && defined (__i386__)
+const gchar *_gtk_get_libdir ();
+
+#undef GTK_LIBDIR
+#define GTK_LIBDIR _gtk_get_libdir ()
+#endif
+
 gboolean _gtk_fnmatch (const char *pattern,
 		       const char *string,
 		       gboolean    no_leading_period);
--- gtk+-2.8.13/gtk/gtkmain.c~	2005-12-06 17:14:30.000000000 +0100
+++ gtk+-2.8.13/gtk/gtkmain.c	2006-03-01 20:36:05.175953744 +0100
@@ -42,6 +42,7 @@
 #include <unistd.h>
 #endif
 #include <sys/types.h>		/* For uid_t, gid_t */
+#include <sys/utsname.h>
 
 #ifdef G_OS_WIN32
 #define STRICT
@@ -336,6 +337,28 @@
 
 #endif /* G_OS_WIN32 */
 
+#if defined(__linux__) && defined (__i386__)
+const gchar *
+_gtk_get_libdir (void)
+{
+  static char *gtk_libdir = NULL;
+  if (gtk_libdir == NULL)
+    {
+#if defined(__linux__) && defined (__i386__)
+      struct utsname uts;
+
+      uname(&uts);
+      if (!strcmp("x86_64", uts.machine)
+	  && !access("/usr/lib32/gtk-2.0", R_OK|X_OK))
+	gtk_libdir = "/usr/lib32";
+      else
+#endif
+      gtk_libdir = "/usr/lib";
+    }
+  return gtk_libdir;
+}
+#endif
+
 static gboolean do_setlocale = TRUE;
 
 /**
--- gtk+-2.8.13/gtk/gtkrc.c~	2005-11-23 15:24:51.000000000 +0100
+++ gtk+-2.8.13/gtk/gtkrc.c	2006-03-01 20:33:25.952159440 +0100
@@ -38,6 +38,10 @@
 #include <string.h>
 #include <stdio.h>
 #include <stdlib.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <sys/utsname.h>
 
 
 #include <glib.h>
@@ -364,7 +368,21 @@
       if (im_module_file)
 	result = g_strdup (im_module_file);
       else
+#if defined(__linux__) && defined (__i386__)
+	{
+	  struct utsname uts;
+
+	  uname(&uts);
+	  result = g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "gtk.immodules.32", NULL);
+	  if (strcmp("x86_64", uts.machine) || access(result, R_OK))
+	    {
+	      g_free(result);
+	      result = g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "gtk.immodules", NULL);
+	    }
+	}
+#else
 	result = g_build_filename (GTK_SYSCONFDIR, "gtk-2.0", "gtk.immodules", NULL);
+#endif
     }
 
   return result;