Loïc Minier <[EMAIL PROTECTED]> writes:

> On Fri, Jan 12, 2007, Goswin von Brederlow wrote:
>> Ah yes, that was in the old bugreport. I thought you actually had it
>> (or something equivalent) included in pango already but it wasn't
>> working.
>> 
>> I will do a test build with it and the latest pango source but from
>> reading the patch it looks fine.
>
>  It certainly wont work as is, no.
>
> -- 
> Loïc Minier <[EMAIL PROTECTED]>

The patch had a minor bug for /etc/pango32. It tested for /etc/pango32
but then overwrote the reult with /etc/pango anyway. Which is ok as
there seems to be no architecture specific file left in /etc/pango,
only the font aliases.

I fixed that and also made the patch less conditional. The test for
uname is not needed and actualy breaks stuff. You might want to have
an uname of "i686" for your www-browser so some flash or java plugin
works. But you still want to be able to read pdf links too. 'linux32
www-browser' would result in acroread being started with uname 'i686'
and then pango fails.

I also added a g_getenv("PANGO32_SYSCONFDIR"); for symetry.


Are you sure the SYSCONFDIR part is still needed? The modules conffile
used to be there iirc but no more. I can't think of a reason why 32bit
and 64bit would need different fonts:

[EMAIL PROTECTED]:~% ls -lh /etc/pango/
total 0
lrwxrwxrwx 1 root root 38 Nov  3 02:42 pangox.aliases -> 
/var/lib/defoma/pango.d/pangox.aliases

I think the 2nd chunk of the patch could be discarded leaving just 5
lines change.

MfG
        Goswin

----------------------------------------------------------------------
--- pango1.0-1.14.8.orig/pango/pango-utils.c
+++ pango1.0-1.14.8/pango/pango-utils.c
@@ -23,6 +23,7 @@
 #include <errno.h>
 #include <string.h>
 #include <stdlib.h>
+#include <unistd.h>
 
 #include "pango-font.h"
 #include "pango-impl-utils.h"
@@ -598,7 +599,28 @@
 
   return result;
 #else
-  return SYSCONFDIR "/pango";
+  static gchar *result = NULL;
+
+  if (result == NULL)
+    {
+#if defined(__linux__) && defined (__i386__)
+      result = g_getenv("PANGO32_SYSCONFDIR");
+      if (result != NULL && !access(result, R_OK|X_OK))
+       return result;
+#endif
+      result = g_getenv("PANGO_SYSCONFDIR");
+      if (result != NULL && !access(result, R_OK|X_OK))
+       return result;
+#if defined(__linux__) && defined (__i386__)
+      if (!access(SYSCONFDIR "/pango32", R_OK|X_OK))
+        {
+         result = SYSCONFDIR "/pango32";
+          return result;
+        }
+#endif
+      result = SYSCONFDIR "/pango";
+    }
+  return result;
 #endif
 }
 
@@ -626,6 +648,10 @@
 
   return result;
 #else
+#if defined(__linux__) && defined (__i386__)
+  if (!access("/usr/lib32/pango", R_OK|X_OK))
+    return "/usr/lib32/pango";
+#endif
   return LIBDIR "/pango";
 #endif
 }

Reply via email to