Subject: Epiphany effort
To: None <tech-pkg@netbsd.org>
From: Bruce J.A. Nourish <bjan+tech-pkg@bjan.net>
List: tech-pkg
Date: 12/20/2003 20:19:28
Hey everyone,

This afternoon, I made a stab at getting Epiphany, the new GNOME browser
to work. Unfortunately, I've hit a snag, and I really don't have the
energy to debug mozilla. Perhaps someone with more experience hacking
mozilla can finish the job. 

Also, it would be really helpful if we could have a separate pkgsrc
package for gtk2 mozilla-stable. I'll send-pr regarding this.

Anyhow, here's how you can build Epiphany: it worked for me on 1.6ZG
(note that vanilla mozilla and co work fine, so I don't think I'm
encountering the recent alleged pthread bug).

First, patch www/mozilla/Makefile.common as follows:

Index: Makefile.common
===================================================================
RCS file: /cvsroot/pkgsrc/www/mozilla/Makefile.common,v
retrieving revision 1.23
diff -u -r1.23 Makefile.common
--- Makefile.common	2003/12/20 10:28:45	1.23
+++ Makefile.common	2003/12/21 03:02:13
@@ -36,11 +36,18 @@
 UNLIMIT_RESOURCES=	datasize memorysize stacksize
 
 .include	"../../graphics/freetype2/buildlink2.mk"
-.include	"../../graphics/gdk-pixbuf/buildlink2.mk"
 .include	"../../graphics/jpeg/buildlink2.mk"
 .include	"../../graphics/png/buildlink2.mk"
-.include	"../../net/ORBit/buildlink2.mk"
+
+.ifdef MOZILLA_USE_GTK2
+.include	"../../x11/gtk2/buildlink2.mk"
+.include	"../../net/libIDL/buildlink2.mk"
+CONFIGURE_ARGS+=	--enable-default-toolkit=gtk2
+.else
 .include	"../../x11/gtk/buildlink2.mk"
+.include	"../../graphics/gdk-pixbuf/buildlink2.mk"
+.include	"../../net/ORBit/buildlink2.mk"
+.endif
 
 # NetBSD-*-m68k builds, but "regchrome" dumps core.
 NOT_FOR_PLATFORM=	NetBSD-1.4.*-* NetBSD-*-m68k

Make and install www/mozilla-stable, bieng sure to define 
MOZILLA_USE_XFT=YES and MOZILLA_USE_GTK2=YES. You will get PLIST
errors, as MOZILLA_USE_GTK2 changes it, and I haven't bothered
to fix this.

Then:

# cd /usr/pkgsrc/www/mozilla-stable/work/mozilla/build/unix/
# perl -i.orig -wpe 's/mozilla-1.4.1/mozilla-stable/g' moz*.pc 
# cp moz*.pc /usr/pkg/lib/pkgconfig

Download http://bjan.freeshell.org/nb/moz.tgz. Unpack it in
pkgsrc/wip. Build and install.

You should now be able to run Epiphany, but I doubt it. It will die with
a pretty GNOME crash dialog and the following backtrace:

Program received signal SIGTRAP, Trace/breakpoint trap.

0x48c7173f in poll () from /usr/lib/libc.so.12
(gdb) bt
#0  0x48c7173f in poll () from /usr/lib/libc.so.12
#1  0x4810efd9 in dlopen () from /usr/libexec/ld.elf_so
#2  0x4824e8b9 in PR_OpenDir () from /usr/pkg/lib/mozilla-stable/libnspr4.so
#3  0x49047502 in nsSocketTransportService::Poll() ()
   from /usr/pkg/lib/mozilla-stable/components/libnecko.so
#4  0x49047d69 in nsSocketTransportService::Run() ()
   from /usr/pkg/lib/mozilla-stable/components/libnecko.so
#5  0x481dcd5b in nsThread::Main(void*) ()
   from /usr/pkg/lib/mozilla-stable/libxpcom.so
#6  0x4824fe09 in PR_Select () from /usr/pkg/lib/mozilla-stable/libnspr4.so
#7  0x48b529f9 in pthread_create () from /usr/lib/libpthread.so.0
(gdb) cont
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x4810f43d in _rtld_linkmap_add () from /usr/libexec/ld.elf_so
(gdb) bt
#0  0x4810f43d in _rtld_linkmap_add () from /usr/libexec/ld.elf_so
#1  0x48115400 in __isthreaded () from /usr/libexec/ld.elf_so

Note that the TRAP is not a breakpoint that I set up - it happens of it's 
own accord.

Ho Ho Ho,
-- 
Bruce J.A. Nourish <bjan+public@bjan.net> http://bjan.net