Subject: sun-jre141 sun-jdk141 firefox-java mozilla-java and libjavaglue141
To: None <pkgsrc-bugs@netbsd.org>
From: BSD For Ever <bsd4ever@nospam.lan>
List: pkgsrc-bugs
Date: 05/24/2004 05:45:06
i386-current users, here are some packages that will allow you to enable
Sun's Java Virtual Machine plugin (the binary plugin for Linux) on NetBSD
*native* mozilla-based apps (mozilla, firefox). I read once in Sun's web
pages that users having problems with 1.4.2 could try the latest 1.4.1.x.
And then I was lucky enough to write a hack to make it work with native
apps.

All you need is devel/libjavaglue141, lang/sun-jre141 and www/firefox-java
and/or www/mozilla-java and/or mail/thunderbird-java as well as the usual
Linux compat settings.

lang/sun-jdk141 is provided for those willing to build their own applets.

All these packages are working well on my NetBSD-1.6U kernel and I am able
to run Java applets with both firefox and mozilla. I did all sorts of tests
to make sure the packaging was OK (building packages, deleting them,
re-installing them from binary, computing check-sums after each kind of
install...). Well, I can say the packaging rocks.
However, I have only tested all this  on i386-1.6U.

BTW, here is what "ldd libjavaplugin_oji.so" yelds once libjavaglue141 and
sun-jre141 are installed (thanks to /etc/ld.so.conf) :
ldd /usr/pkg/java/sun-1.4.1/plugin/i386/ns610/libjavaplugin_oji.so   
/usr/pkg/java/sun-1.4.1/plugin/i386/ns610/libjavaplugin_oji.so:
	-lX11.6 => /usr/X11R6/lib/libX11.so
	-lICE.6 => /usr/X11R6/lib/libICE.so.6
	-lSM.6 => /usr/X11R6/lib/libSM.so.6
	-lXt.6 => /usr/X11R6/lib/libXt.so
	-ldl.2 => /usr/lib/libc.so
	-lm.6 => /usr/lib/libm387.so.0
	-lm.6 => /usr/lib/libm.so.0
	-lc.6 => /usr/pkg/lib/libjavaglue141.so

If you want to download all these packages in a single tarball:
cd /tmp
ftp http://bsd4ever.online.fr/all.tgz
cd /usr
cd pkgsrc
tar xzf /tmp/all.tgz

Alternatively, you can download each one separately :
cd /tmp
ftp http://bsd4ever.online.fr/libjavaglue141.tgz
ftp http://bsd4ever.online.fr/sun-jre141.tgz
ftp http://bsd4ever.online.fr/sun-jdk141.tgz
ftp http://bsd4ever.online.fr/firefox-java.tgz
ftp http://bsd4ever.online.fr/mozilla-java.tgz
ftp http://bsd4ever.online.fr/thunderbird-java.tgz
cd /usr
cd pkgsrc/devel
tar xzf /tmp/libjavaglue141.tgz
cd ../lang
tar xzf /tmp/sun-jre141.tgz
tar xzf /tmp/sun-jdk141.tgz
cd ../www
tar xzf /tmp/firefox-java.tgz
tar xzf /tmp/mozilla-java.tgz
cd ../mail
tar xzf /tmp/thunderbird-java.tgz

Although thunderbird's Open JVM Integration support is disabled by
default, I have packaged thunderbird-java in case someone wants to
try it. Replacing "--disable-oji" by "--enable-oji" in
pkgsrc/mail/thunderbird/work/mozilla/mail/config
just after issuing a "make extract" and before the "make" is not
enough. I did build it successfully but there is no way to enable
Java in the prefs. Anyway, having OJI support in a mailer is not
that interesting so maybe we can forget about thunderbird-java.

FYI, the "big" tarball is 16188 bytes long, and its contents are :
tar tzvf /tmp/all.tgz | sed 's/.\{20\}\(.\{10\}\).\{18\}/\1/'
       388 devel/libjavaglue141/DESCR
       423 devel/libjavaglue141/MESSAGE.NetBSD
       717 devel/libjavaglue141/Makefile
        70 devel/libjavaglue141/PLIST
       177 devel/libjavaglue141/files/Makefile
       227 devel/libjavaglue141/files/javaglue141.c
       989 devel/libjavaglue141/files/ld.so.conf
        75 lang/sun-jre141/DESCR
       562 lang/sun-jre141/MESSAGE.NetBSD
      1423 lang/sun-jre141/Makefile
      2168 lang/sun-jre141/Makefile.common
     24738 lang/sun-jre141/PLIST
       786 lang/sun-jre141/buildlink2.mk
       703 lang/sun-jre141/buildlink3.mk
       142 lang/sun-jre141/distinfo
        75 lang/sun-jdk141/DESCR
       559 lang/sun-jdk141/MESSAGE.NetBSD
       677 lang/sun-jdk141/Makefile
     61752 lang/sun-jdk141/PLIST
       807 lang/sun-jdk141/buildlink2.mk
       724 lang/sun-jdk141/buildlink3.mk
       144 lang/sun-jdk141/distinfo
       612 lang/sun-jdk141/files/common
        92 www/firefox-java/DESCR
       895 www/firefox-java/Makefile
       176 www/firefox-java/PLIST
        88 www/mozilla-java/DESCR
       895 www/mozilla-java/Makefile
       176 www/mozilla-java/PLIST
        96 mail/thunderbird-java/DESCR
       917 mail/thunderbird-java/Makefile
       184 mail/thunderbird-java/PLIST

Sorry for my not using send-pr to submit all these new packages.
I hope this won't need too much rewriting in case it is accepted in
pkgsrc. I have carefully packaged sun-jre141, sun-jdk141, firefox-java,
mozilla-java and thunderbird-java but the makefiles in libjavaglue141
are not very pretty although they work perfectly.
BTW, both sun-jre141 and sun-jdk141 reflect the recent changes made to
the existing sun-jre14 and sun-jdk14 packages.

Last remark: It is not necessary to update pkgsrc/mk/java-vm.mk to
build, install and use sun-jre141 and sun-jdk141, but I'm inserting a
"diff -b -u" in case someone is interested.

--- pkgsrc/mk/java-vm.mk	Sat May  8 21:10:02 2004
+++ pkgsrc/mk/java-vm.mk.new	Mon May 24 05:43:49 2004
@@ -195,6 +195,8 @@
 BUILDLINK_DEPENDS.sun-jre13?=		sun-jre13-[0-9]*
 BUILDLINK_DEPENDS.sun-jdk14?=		sun-jdk14-[0-9]*
 BUILDLINK_DEPENDS.sun-jre14?=		sun-jre14-[0-9]*
+BUILDLINK_DEPENDS.sun-jdk141?=		sun-jdk141-[0-9]*
+BUILDLINK_DEPENDS.sun-jre141?=		sun-jre141-[0-9]*
 BUILDLINK_DEPENDS.blackdown-jdk13?=	blackdown-jdk13-[0-9]*
 BUILDLINK_DEPENDS.blackdown-jre13?=	blackdown-jre13-[0-9]*
 BUILDLINK_DEPENDS.kaffe?=		kaffe>=1.1.4
@@ -205,6 +207,7 @@
 _JRE.jdk13=		jdk13
 _JRE.sun-jdk13=		sun-jre13
 _JRE.sun-jdk14=		sun-jre14
+_JRE.sun-jdk141=	sun-jre141
 _JRE.blackdown-jdk13=	blackdown-jre13
 _JRE.kaffe=		kaffe
 _JRE.wonka=		wonka
@@ -231,6 +234,11 @@
 _JDK_PKGSRCDIR=		../../lang/sun-jdk14
 _JRE_PKGSRCDIR=		../../lang/sun-jre14
 _JAVA_HOME_DEFAULT=	${LOCALBASE}/java/sun-1.4
+UNLIMIT_RESOURCES+=	datasize
+.elif ${_PKG_JVM} == "sun-jdk141"
+_JDK_PKGSRCDIR=		../../lang/sun-jdk141
+_JRE_PKGSRCDIR=		../../lang/sun-jre141
+_JAVA_HOME_DEFAULT=	${LOCALBASE}/java/sun-1.4.1
 UNLIMIT_RESOURCES+=	datasize
 .elif ${_PKG_JVM} == "blackdown-jdk13"
 _JDK_PKGSRCDIR=		../../lang/blackdown-jdk13


That's all.
Many thanks for the pkgsrc system and, of course, for NetBSD.
P.S. pkgsrc-wip has a package to build a newer JRE/JDK from source.