Package: xulrunner
Version: 1.8.0.9-1
Severity: important
Tags: patch

Hi,

xulrunner currently FTBFS on hurd-i386. Here are two patches for fixing
it:

- xulrunner-18_kbsd_nspr.dpatch.diff which fixes
  debian/patches/18_kbsd_nspr.dpatch for proper Hurd support
- xulrunner-37_hurd.patch which mostly fixes various PATH_MAX/MAXPATHLEN
  issues

Samuel

-- System Information:
Debian Release: 4.0
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 
'experimental')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.19
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)
--- xulrunner-1.8.0.9/debian/patches/18_kbsd_nspr.dpatch.orig   2007-01-27 
12:37:09.000000000 +0100
+++ xulrunner-1.8.0.9/debian/patches/18_kbsd_nspr.dpatch        2007-01-27 
12:35:25.000000000 +0100
@@ -72,7 +72,7 @@
 diff -urN mozilla/nsprpub/pr/include/md/_pth.h 
mozilla/nsprpub/pr/include/md/_pth.h
 --- mozilla/nsprpub/pr/include/md/_pth.h       2005-08-18 19:24:28.000000000 
+0200
 +++ mozilla/nsprpub/pr/include/md/_pth.h       2006-11-20 22:10:27.000000000 
+0100
-@@ -143,10 +143,15 @@
+@@ -143,13 +143,22 @@
        (!memcmp(&(t), &pt_zero_tid, sizeof(pthread_t)))
  #define _PT_PTHREAD_COPY_THR_HANDLE(st, dt)   (dt) = (st)
  #elif defined(IRIX) || defined(OSF1) || defined(AIX) || defined(SOLARIS) \
@@ -83,13 +83,20 @@
        || defined(VMS) || defined(NTO) || defined(DARWIN) \
        || defined(UNIXWARE) || defined(RISCOS)
 +#ifdef __GNU__
-+/* Hurd pthreads don't have an invalid value for pthread_t. -- rmh */
-+#error Using Hurd pthreads
-+#endif
++/* Hurd pthread_ts are allocated from 0, and you just _won't_ be able to 
create
++ * 4G threads :) */
++#define _PT_PTHREAD_INVALIDATE_THR_HANDLE(t)  (t) = -1
++#define _PT_PTHREAD_THR_HANDLE_IS_INVALID(t)  (t) == -1
++#define _PT_PTHREAD_COPY_THR_HANDLE(st, dt)   (dt) = (st)
++#else
  #define _PT_PTHREAD_INVALIDATE_THR_HANDLE(t)  (t) = 0
  #define _PT_PTHREAD_THR_HANDLE_IS_INVALID(t)  (t) == 0
  #define _PT_PTHREAD_COPY_THR_HANDLE(st, dt)   (dt) = (st)
-@@ -195,7 +200,8 @@
++#endif
+ #else 
+ #error "invalid pthread ID is not supported for this architecture"
+ #endif
+@@ -201,7 +210,8 @@
  /*
   * These platforms don't have sigtimedwait()
   */
@@ -99,7 +106,7 @@
        || defined(FREEBSD) || defined(NETBSD) || defined(OPENBSD) \
        || defined(BSDI) || defined(VMS) || defined(UNIXWARE) \
        || defined(DARWIN)
-@@ -235,7 +241,8 @@
+@@ -235,7 +245,8 @@
  #define PT_PRIO_MAX            sched_get_priority_max(SCHED_OTHER)
  #endif /* defined(_PR_DCETHREADS) */
  
@@ -109,7 +116,7 @@
  #define PT_PRIO_MIN            sched_get_priority_min(SCHED_OTHER)
  #define PT_PRIO_MAX            sched_get_priority_max(SCHED_OTHER)
  #elif defined(NTO)
-@@ -291,7 +298,8 @@
+@@ -291,7 +302,8 @@
                onemillisec.tv_nsec = 1000000L;                 \
          nanosleep(&onemillisec,NULL);                 \
      PR_END_MACRO
--- nsprpub/pr/src/md/unix/uxrng.c.orig 2007-01-27 13:12:45.000000000 +0000
+++ nsprpub/pr/src/md/unix/uxrng.c      2007-01-27 13:12:59.000000000 +0000
@@ -139,7 +139,8 @@
 }
 
 #elif (defined(LINUX) || defined(FREEBSD) || defined(__FreeBSD_kernel__) \
-    || defined(NETBSD) || defined(__NetBSD_kernel__) || defined(OPENBSD))
+    || defined(NETBSD) || defined(__NetBSD_kernel__) || defined(OPENBSD)) \
+    || defined(__GNU__)
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
--- dbm/src/ndbm.c.orig 2007-01-27 13:15:59.000000000 +0000
+++ dbm/src/ndbm.c      2007-01-27 13:16:37.000000000 +0000
@@ -67,7 +67,7 @@
 dbm_open(const char *file, int flags, int mode)
 {
        HASHINFO info;
-       char path[MAXPATHLEN];
+       char path[strlen(file) + strlen(DBM_SUFFIX) + 1];
 
        info.bsize = 4096;
        info.ffactor = 40;
--- xpcom/io/nsDirectoryService.cpp.orig        2007-01-27 13:27:22.000000000 
+0000
+++ xpcom/io/nsDirectoryService.cpp     2007-01-27 13:29:44.000000000 +0000
@@ -233,6 +233,9 @@
 
 #elif defined(XP_UNIX)
 
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 1024
+#endif
     // In the absence of a good way to get the executable directory let
     // us try this for unix:
     // - if MOZILLA_FIVE_HOME is defined, that is it
--- xpcom/io/nsLocalFileUnix.cpp.orig   2007-01-27 13:32:03.000000000 +0000
+++ xpcom/io/nsLocalFileUnix.cpp        2007-01-27 13:33:38.000000000 +0000
@@ -524,6 +524,9 @@
 NS_IMETHODIMP
 nsLocalFile::Normalize()
 {
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
     char    resolved_path[PATH_MAX] = "";
     char *resolved_path_ptr = nsnull;
 
--- xpcom/obsolete/nsSpecialSystemDirectory.cpp.orig    2007-01-27 
13:40:06.000000000 +0000
+++ xpcom/obsolete/nsSpecialSystemDirectory.cpp 2007-01-27 13:45:21.000000000 
+0000
@@ -266,7 +266,6 @@
     // us try this for unix:
     // - if MOZILLA_FIVE_HOME is defined, that is it
     // - else give the current directory
-    char buf[MAXPATHLEN];
     char *moz5 = PR_GetEnv("MOZILLA_FIVE_HOME");
     if (moz5)
     {
@@ -285,12 +284,19 @@
         }
 #endif /* DEBUG */
 
-        // Fall back to current directory.
-        if (getcwd(buf, sizeof(buf)))
-        {
-            aFileSpec = buf;
-            return;
-        }
+        size_t size = 256;
+        while(1) {
+           char buf[size];
+            // Fall back to current directory.
+            if (getcwd(buf, sizeof(buf)))
+            {
+                aFileSpec = buf;
+                return;
+            }
+           if (errno != ERANGE)
+               break;
+           size *= 2;
+       }
     }
 
 #elif defined(XP_BEOS)
--- modules/libjar/nsZipArchive.cpp.orig        2007-01-27 14:03:57.000000000 
+0000
+++ modules/libjar/nsZipArchive.cpp     2007-01-27 14:04:20.000000000 +0000
@@ -120,11 +120,12 @@
 #  ifndef S_IFLNK
 #    define S_IFLNK  0120000
 #  endif
-#  ifndef PATH_MAX
-#    define PATH_MAX 1024
-#  endif
 #endif  /* XP_UNIX */
 
+#ifndef PATH_MAX
+#  define PATH_MAX 1024
+#endif
+
 #include "zipfile.h"
 #include "zipstruct.h"
 #include "nsZipArchive.h"
--- gfx/src/gtk/nsDeviceContextSpecG.h.orig     2007-01-27 14:15:06.000000000 
+0000
+++ gfx/src/gtk/nsDeviceContextSpecG.h  2007-01-27 14:15:34.000000000 +0000
@@ -55,6 +55,10 @@
 #define NS_PORTRAIT  0
 #define NS_LANDSCAPE 1
 
+#ifndef PATH_MAX
+#define PATH_MAX 1024
+#endif
+
 typedef enum
 {
   pmInvalid = 0,
--- toolkit/mozapps/update/src/updater/progressui_gtk.cpp.orig  2007-01-27 
16:17:03.000000000 +0000
+++ toolkit/mozapps/update/src/updater/progressui_gtk.cpp       2007-01-27 
16:27:03.000000000 +0000
@@ -39,6 +39,7 @@
 #include <stdio.h>
 #include <gtk/gtk.h>
 #include <unistd.h>
+#include <string.h>
 #include "progressui.h"
 #include "readstrings.h"
 #include "errors.h"
@@ -102,7 +103,7 @@
   if (sQuit || sProgressVal > 50.0f)
     return 0;
 
-  char path[PATH_MAX];
+  char path[strlen(sProgramPath)+4+1];
   snprintf(path, sizeof(path), "%s.ini", sProgramPath);
 
   StringTable strings;
--- security/nss/lib/freebl/unix_rand.c.orig    2007-01-27 17:02:35.000000000 
+0000
+++ security/nss/lib/freebl/unix_rand.c 2007-01-27 17:04:49.000000000 +0000
@@ -82,7 +82,8 @@
 
 #if defined(SCO) || defined(UNIXWARE) || defined(BSDI) || defined(FREEBSD) \
     || defined(NETBSD) || defined(NTO) || defined(DARWIN) || defined(OPENBSD) \
-    || defined(__FreeBSD_kernel__) || defined(__NetBSD_kernel__)
+    || defined(__FreeBSD_kernel__) || defined(__NetBSD_kernel__) \
+    || defined(__GNU__)
 #include <sys/times.h>
 
 #define getdtablesize() sysconf(_SC_OPEN_MAX)
--- security/nss/cmd/shlibsign/shlibsign.c.orig 2007-01-28 01:20:32.000000000 
+0000
+++ security/nss/cmd/shlibsign/shlibsign.c      2007-01-28 01:21:01.000000000 
+0000
@@ -163,6 +163,9 @@
 #ifdef USES_LINKS
     int ret;
     struct stat stat_buf;
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 1024
+#endif
     char link_buf[MAXPATHLEN+1];
     char *link_file = NULL;
 #endif

Reply via email to