aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVlastimil Babka <caster@gentoo.org>2012-03-02 23:20:27 +0000
committerVlastimil Babka <caster@gentoo.org>2012-03-02 23:20:27 +0000
commitec85a2829cda68e0e730a17530bdb0e25842af07 (patch)
tree8d15ac302b4f4f0b29cd5d41f1dbcb1099e6c80d
parent[games-server/minecraft-server] Version bump. (diff)
downloadjava-ec85a2829cda68e0e730a17530bdb0e25842af07.tar.gz
java-ec85a2829cda68e0e730a17530bdb0e25842af07.tar.bz2
java-ec85a2829cda68e0e730a17530bdb0e25842af07.zip
Revbump with upstream patch to fix plugin initialization.
(Portage version: 2.2.0_alpha89/svn/Linux x86_64, unsigned Manifest commit) svn path=/java-overlay/; revision=8995
-rw-r--r--dev-java/icedtea-web/ChangeLog6
-rw-r--r--dev-java/icedtea-web/Manifest4
-rw-r--r--dev-java/icedtea-web/files/fix-plugin-in-icedtea-7.patch388
-rw-r--r--dev-java/icedtea-web/icedtea-web-1.1.4-r8.ebuild139
4 files changed, 536 insertions, 1 deletions
diff --git a/dev-java/icedtea-web/ChangeLog b/dev-java/icedtea-web/ChangeLog
index cf36d4b5..c024a1eb 100644
--- a/dev-java/icedtea-web/ChangeLog
+++ b/dev-java/icedtea-web/ChangeLog
@@ -2,6 +2,12 @@
# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
# $Header: $
+*icedtea-web-1.1.4-r8 (02 Mar 2012)
+
+ 02 Mar 2012; Vlastimil Babka <caster@gentoo.org>
+ +icedtea-web-1.1.4-r8.ebuild, +files/fix-plugin-in-icedtea-7.patch:
+ Revbump with upstream patch to fix plugin initialization.
+
13 Feb 2012; Vlastimil Babka <caster@gentoo.org>
-files/0001-Support-using-NPAPI-SDK-headers-instead-of-whole-xul.patch:
Remove old.
diff --git a/dev-java/icedtea-web/Manifest b/dev-java/icedtea-web/Manifest
index 005f59e9..6d6ad10b 100644
--- a/dev-java/icedtea-web/Manifest
+++ b/dev-java/icedtea-web/Manifest
@@ -1,6 +1,8 @@
AUX 0002-Respect-LDFLAGS.patch 352 RMD160 350d3e85929372dc4193834e6994787aceed7003 SHA1 66a60a87bf6b5487a55e036bef9df42918988b9d SHA256 3e4660e84420e2ae85b00eef40e7e20c0df2c6965fda6827ab025e8167e8f866
+AUX fix-plugin-in-icedtea-7.patch 15838 RMD160 a072ac5bd931bc28f4fbb2f0671725596ae53212 SHA1 7772f2050787af819799dc203b58965f5636f51c SHA256 335ddc5f92751756f21a623f7ba82cb9046287c8eaaed574c96f71ccadb8e985
DIST icedtea-web-1.1.4.tar.gz 812273 RMD160 2aac06c05d4513694968f86861225b5329307781 SHA1 9389030878d7c3aee17f641e3095830fe722fb60 SHA256 b17a742af0153b7887cf667a160f8519afad125bc515b0f4783c66e7ee1a7f26
EBUILD icedtea-web-1.1.4-r7.ebuild 3947 RMD160 c2ca94f363127be835030b371e23eabdf0cdfbc5 SHA1 06d72d0ac062153b4e10e224becb85af5acf123f SHA256 658a99feffd54753b9ea3718e2870aa33cb9097578775448729b8e24c0c45ec5
+EBUILD icedtea-web-1.1.4-r8.ebuild 4074 RMD160 20d81aeeb1142b3c4b4b1cd258e668d737d3d0d5 SHA1 63599b3bd20407562c1506f7bde3e71f571607ed SHA256 110cb97e651d0aa2877c4dfe180695520061d127255a3380044768f6377c5a37
EBUILD icedtea-web-1.1.4.ebuild 3956 RMD160 97b5d4c531d8bd0856407a305119b28a14ef5e27 SHA1 3fd09263950f4d062bdc4b3b207545cb6c14dd05 SHA256 324335acb6270fa0e32ab905f885b828fe1e1c0964182725179f3f2df90a2cc6
-MISC ChangeLog 5323 RMD160 6698995c96fb9069bb8540cbedf1f8f554fb71ca SHA1 527e029ea6e447a9a75559f079de3633df430628 SHA256 d6ff443a1e625c08571bb81d47328f3034c8dd7a721d0114543b7c04552a940c
+MISC ChangeLog 5542 RMD160 cfed12ca259d3f00e8f5488107f206f4e0e5764d SHA1 af7b16287e6192425f0dc22a687f6fa5df8d1e14 SHA256 ac53dd1cc6a4061ed210ab77377401815e31369a454b0909791827a0d903a7b4
MISC metadata.xml 532 RMD160 475b5d799d063ecc980d17896d8b591680ac2a7d SHA1 acf45999323b8df83b432973a11d64e2577ff022 SHA256 48eafb34adc623b7f298610feaac56f61a01f52658b83be30e4cc8d3a9b9f1d7
diff --git a/dev-java/icedtea-web/files/fix-plugin-in-icedtea-7.patch b/dev-java/icedtea-web/files/fix-plugin-in-icedtea-7.patch
new file mode 100644
index 00000000..ff084fc3
--- /dev/null
+++ b/dev-java/icedtea-web/files/fix-plugin-in-icedtea-7.patch
@@ -0,0 +1,388 @@
+
+# HG changeset patch
+# User Denis Lila <dlila@redhat.com>
+# Date 1304110685 14400
+# Node ID 77640d74d21c2303b64bbc05583a3850db564894
+# Parent f0647c9385358b4fc3fe747ba7b95b9117c2f681
+Fix appcontext related plugin bugs.
+
+diff -r f0647c938535 -r 77640d74d21c netx/net/sourceforge/jnlp/Launcher.java
+--- a/netx/net/sourceforge/jnlp/Launcher.java Sat Jan 07 02:48:05 2012 -0500
++++ b/netx/net/sourceforge/jnlp/Launcher.java Fri Apr 29 16:58:05 2011 -0400
+@@ -33,7 +33,6 @@
+
+ import net.sourceforge.jnlp.cache.CacheUtil;
+ import net.sourceforge.jnlp.cache.UpdatePolicy;
+-import net.sourceforge.jnlp.runtime.AppThreadGroup;
+ import net.sourceforge.jnlp.runtime.AppletInstance;
+ import net.sourceforge.jnlp.runtime.ApplicationInstance;
+ import net.sourceforge.jnlp.runtime.JNLPClassLoader;
+@@ -707,7 +706,7 @@
+ throw new ClassNotFoundException("Can't do a codebase look up and there are no jars. Failing sooner rather than later");
+ }
+
+- AppThreadGroup group = (AppThreadGroup) Thread.currentThread().getThreadGroup();
++ ThreadGroup group = Thread.currentThread().getThreadGroup();
+
+ String appletName = file.getApplet().getMainClass();
+
+@@ -723,7 +722,6 @@
+ else
+ appletInstance = new AppletInstance(file, group, loader, applet, cont);
+
+- group.setApplication(appletInstance);
+ loader.setApplication(appletInstance);
+
+ setContextClassLoaderForAllThreads(appletInstance.getThreadGroup(), appletInstance.getClassLoader());
+@@ -770,10 +768,9 @@
+ protected ApplicationInstance createApplication(JNLPFile file) throws LaunchException {
+ try {
+ JNLPClassLoader loader = JNLPClassLoader.getInstance(file, updatePolicy);
+- AppThreadGroup group = (AppThreadGroup) Thread.currentThread().getThreadGroup();
++ ThreadGroup group = Thread.currentThread().getThreadGroup();
+
+ ApplicationInstance app = new ApplicationInstance(file, group, loader);
+- group.setApplication(app);
+ loader.setApplication(app);
+
+ return app;
+@@ -789,16 +786,16 @@
+ * then this method simply returns the existing ThreadGroup. The applet
+ * ThreadGroup has to be created at an earlier point in the applet code.
+ */
+- protected AppThreadGroup createThreadGroup(JNLPFile file) {
+- AppThreadGroup appThreadGroup = null;
++ protected ThreadGroup createThreadGroup(JNLPFile file) {
++ ThreadGroup tg = null;
+
+ if (file instanceof PluginBridge) {
+- appThreadGroup = (AppThreadGroup) Thread.currentThread().getThreadGroup();
++ tg = Thread.currentThread().getThreadGroup();
+ } else {
+- appThreadGroup = new AppThreadGroup(mainGroup, file.getTitle());
++ tg = new ThreadGroup(mainGroup, file.getTitle());
+ }
+
+- return appThreadGroup;
++ return tg;
+ }
+
+ /**
+diff -r f0647c938535 -r 77640d74d21c netx/net/sourceforge/jnlp/NetxPanel.java
+--- a/netx/net/sourceforge/jnlp/NetxPanel.java Sat Jan 07 02:48:05 2012 -0500
++++ b/netx/net/sourceforge/jnlp/NetxPanel.java Fri Apr 29 16:58:05 2011 -0400
+@@ -23,12 +23,13 @@
+ package net.sourceforge.jnlp;
+
+ import net.sourceforge.jnlp.AppletLog;
+-import net.sourceforge.jnlp.runtime.AppThreadGroup;
+ import net.sourceforge.jnlp.runtime.AppletInstance;
+ import net.sourceforge.jnlp.runtime.JNLPRuntime;
+
+ import java.net.URL;
+ import java.util.Hashtable;
++import java.util.concurrent.ConcurrentHashMap;
++import java.util.concurrent.ConcurrentMap;
+
+ import sun.applet.AppletViewerPanel;
+ import sun.awt.SunToolkit;
+@@ -44,9 +45,58 @@
+ private boolean exitOnFailure = true;
+ private AppletInstance appInst = null;
+ private boolean appletAlive;
++ private final String uKey;
++
++ // We use this so that we can create exactly one thread group
++ // for all panels with the same uKey.
++ private static final ConcurrentMap<String, ThreadGroup> uKeyToTG =
++ new ConcurrentHashMap<String, ThreadGroup>();
++
++ // This map is actually a set (unfortunately there is no ConcurrentSet
++ // in java.util.concurrent). If KEY is in this map, then we know that
++ // an app context has been created for the panel that has uKey.equals(KEY),
++ // so we avoid creating it a second time for panels with the same uKey.
++ // Because it's a set, only the keys matter. However, we can't insert
++ // null values in because if we did, we couldn't use null checks to see
++ // if a key was absent before a putIfAbsent.
++ private static final ConcurrentMap<String, Boolean> appContextCreated =
++ new ConcurrentHashMap<String, Boolean>();
+
+ public NetxPanel(URL documentURL, Hashtable<String, String> atts) {
+ super(documentURL, atts);
++
++ /* According to http://download.oracle.com/javase/6/docs/technotes/guides/deployment/deployment-guide/applet-compatibility.html,
++ * classloaders are shared iff these properties match:
++ * codebase, cache_archive, java_archive, archive
++ *
++ * To achieve this, we create the uniquekey based on those 4 values,
++ * always in the same order. The initial "<NAME>=" parts ensure a
++ * bad tag cannot trick the loader into getting shared with another.
++ */
++
++ // Firefox sometimes skips the codebase if it is default -- ".",
++ // so set it that way if absent
++ String codebaseAttr = atts.get("codebase") != null ?
++ atts.get("codebase") : ".";
++
++ String cache_archiveAttr = atts.get("cache_archive") != null ?
++ atts.get("cache_archive") : "";
++
++ String java_archiveAttr = atts.get("java_archive") != null ?
++ atts.get("java_archive") : "";
++
++ String archiveAttr = atts.get("archive") != null ?
++ atts.get("archive") : "";
++
++ this.uKey = "codebase=" + codebaseAttr +
++ "cache_archive=" + cache_archiveAttr +
++ "java_archive=" + java_archiveAttr +
++ "archive=" + archiveAttr;
++
++ // when this was being done (incorrectly) in Launcher, the call was
++ // new AppThreadGroup(mainGroup, file.getTitle());
++ ThreadGroup tg = new ThreadGroup(Launcher.mainGroup, this.documentURL.toString());
++ uKeyToTG.putIfAbsent(this.uKey, tg);
+ }
+
+ // overloaded constructor, called when initialized via plugin
+@@ -58,18 +108,6 @@
+ }
+
+ @Override
+- public void run() {
+- /*
+- * create an AppContext for this thread associated with this particular
+- * plugin instance (which runs in a different thread group from the rest
+- * of the plugin).
+- */
+- SunToolkit.createNewAppContext();
+-
+- super.run();
+- }
+-
+- @Override
+ protected void showAppletException(Throwable t) {
+ /*
+ * Log any exceptions thrown while loading, initializing, starting,
+@@ -78,7 +116,7 @@
+ AppletLog.log(t);
+ super.showAppletException(t);
+ }
+-
++
+ //Overriding to use Netx classloader. You might need to relax visibility
+ //in sun.applet.AppletPanel for runLoader().
+ protected void runLoader() {
+@@ -90,7 +128,7 @@
+ getCode(),
+ getWidth(),
+ getHeight(),
+- atts);
++ atts, uKey);
+
+ doInit = true;
+ dispatchAppletEvent(APPLET_LOADING, null);
+@@ -154,11 +192,7 @@
+ }
+ }
+
+- // when this was being done (incorrectly) in Launcher, the call was
+- // new AppThreadGroup(mainGroup, file.getTitle());
+- ThreadGroup tg = new AppThreadGroup(Launcher.mainGroup,
+- this.documentURL.toString());
+- handler = new Thread(tg, this);
++ handler = new Thread(getThreadGroup(), this);
+ handler.start();
+ }
+
+@@ -174,4 +208,19 @@
+ public boolean isAlive() {
+ return handler != null && handler.isAlive() && this.appletAlive;
+ }
++
++ public ThreadGroup getThreadGroup() {
++ return uKeyToTG.get(uKey);
++ }
++
++ public void createNewAppContext() {
++ if (Thread.currentThread().getThreadGroup() != getThreadGroup()) {
++ throw new RuntimeException("createNewAppContext called from the wrong thread.");
++ }
++ // only create a new context if one hasn't already been created for the
++ // applets with this unique key.
++ if (null == appContextCreated.putIfAbsent(uKey, Boolean.TRUE)) {
++ SunToolkit.createNewAppContext();
++ }
++ }
+ }
+diff -r f0647c938535 -r 77640d74d21c netx/net/sourceforge/jnlp/PluginBridge.java
+--- a/netx/net/sourceforge/jnlp/PluginBridge.java Sat Jan 07 02:48:05 2012 -0500
++++ b/netx/net/sourceforge/jnlp/PluginBridge.java Fri Apr 29 16:58:05 2011 -0400
+@@ -44,7 +44,8 @@
+ private boolean codeBaseLookup;
+
+ public PluginBridge(URL codebase, URL documentBase, String jar, String main,
+- int width, int height, Hashtable<String, String> atts)
++ int width, int height, Hashtable<String, String> atts,
++ String uKey)
+ throws Exception {
+ specVersion = new Version("1.0");
+ fileVersion = new Version("1.1");
+@@ -132,34 +133,7 @@
+ else
+ security = null;
+
+- /* According to http://download.oracle.com/javase/6/docs/technotes/guides/deployment/deployment-guide/applet-compatibility.html,
+- * classloaders are shared iff these properties match:
+- * codebase, cache_archive, java_archive, archive
+- *
+- * To achieve this, we create the uniquekey based on those 4 values,
+- * always in the same order. The initial "<NAME>=" parts ensure a
+- * bad tag cannot trick the loader into getting shared with another.
+- */
+-
+- // Firefox sometimes skips the codebase if it is default -- ".",
+- // so set it that way if absent
+- String codebaseAttr = atts.get("codebase") != null ?
+- atts.get("codebase") : ".";
+-
+- String cache_archiveAttr = atts.get("cache_archive") != null ?
+- atts.get("cache_archive") : "";
+-
+- String java_archiveAttr = atts.get("java_archive") != null ?
+- atts.get("java_archive") : "";
+-
+- String archiveAttr = atts.get("archive") != null ?
+- atts.get("archive") : "";
+-
+- this.uniqueKey = "codebase=" + codebaseAttr +
+- "cache_archive=" + cache_archiveAttr +
+- "java_archive=" + java_archiveAttr +
+- "archive=" + archiveAttr;
+-
++ this.uniqueKey = uKey;
+ usePack = false;
+ useVersion = false;
+ String jargs = atts.get("java_arguments");
+diff -r f0647c938535 -r 77640d74d21c netx/net/sourceforge/jnlp/runtime/AppThreadGroup.java
+--- a/netx/net/sourceforge/jnlp/runtime/AppThreadGroup.java Sat Jan 07 02:48:05 2012 -0500
++++ /dev/null Thu Jan 01 00:00:00 1970 +0000
+@@ -1,63 +0,0 @@
+-// Copyright (C) 2001-2003 Jon A. Maxwell (JAM)
+-//
+-// This library is free software; you can redistribute it and/or
+-// modify it under the terms of the GNU Lesser General Public
+-// License as published by the Free Software Foundation; either
+-// version 2.1 of the License, or (at your option) any later version.
+-//
+-// This library is distributed in the hope that it will be useful,
+-// but WITHOUT ANY WARRANTY; without even the implied warranty of
+-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+-// Lesser General Public License for more details.
+-//
+-// You should have received a copy of the GNU Lesser General Public
+-// License along with this library; if not, write to the Free Software
+-// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+-
+-package net.sourceforge.jnlp.runtime;
+-
+-/**
+- * Thread group for a JNLP application.
+- *
+- * @author <a href="mailto:jmaxwell@users.sourceforge.net">Jon A. Maxwell (JAM)</a> - initial author
+- * @version $Revision: 1.5 $
+- */
+-public class AppThreadGroup extends ThreadGroup {
+-
+- /** the app */
+- private ApplicationInstance app = null;
+-
+- /**
+- * Creates new JavaAppThreadGroup
+- *
+- * @param name of the App
+- */
+- public AppThreadGroup(ThreadGroup parent, String name) {
+- super(parent, name);
+- }
+-
+- /**
+- * Sets the JNLP app this group is for; can only be called once.
+- */
+- public void setApplication(ApplicationInstance app) {
+- if (this.app != null)
+- throw new IllegalStateException("Application can only be set once");
+-
+- this.app = app;
+- }
+-
+- /**
+- * Returns the JNLP app for this thread group.
+- */
+- public ApplicationInstance getApplication() {
+- return app;
+- }
+-
+- /**
+- * Handle uncaught exceptions for the app.
+- */
+- public void uncaughtException(Thread t, Throwable e) {
+- super.uncaughtException(t, e);
+- }
+-
+-}
+diff -r f0647c938535 -r 77640d74d21c plugin/icedteanp/java/sun/applet/PluginAppletViewer.java
+--- a/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Sat Jan 07 02:48:05 2012 -0500
++++ b/plugin/icedteanp/java/sun/applet/PluginAppletViewer.java Fri Apr 29 16:58:05 2011 -0400
+@@ -123,10 +123,10 @@
+ class PluginAppletPanelFactory {
+
+ public AppletPanel createPanel(PluginStreamHandler streamhandler,
+- int identifier,
+- long handle, int x, int y,
+- final URL doc,
+- final Hashtable<String, String> atts) {
++ final int identifier,
++ final long handle, int x, int y,
++ final URL doc,
++ final Hashtable<String, String> atts) {
+ final NetxPanel panel = AccessController.doPrivileged(new PrivilegedAction<NetxPanel>() {
+ public NetxPanel run() {
+ NetxPanel panel = new NetxPanel(doc, atts, false);
+@@ -136,13 +136,29 @@
+ }
+ });
+
+- // create the frame.
+- PluginAppletViewer.framePanel(identifier, handle, panel);
++ // Framing the panel needs to happen in a thread whose thread group
++ // is the same as the threadgroup of the applet thread. If this
++ // isn't the case, the awt eventqueue thread's context classloader
++ // won't be set to a JNLPClassLoader, and when an applet class needs
++ // to be loaded from the awt eventqueue, it won't be found.
++ Thread panelInit = new Thread(panel.getThreadGroup(), new Runnable() {
++ @Override public void run() {
++ panel.createNewAppContext();
++ // create the frame.
++ PluginAppletViewer.framePanel(identifier, handle, panel);
++ panel.init();
++ // Start the applet
++ initEventQueue(panel);
++ }
++ }, "NetXPanel initializer");
+
+- panel.init();
+-
+- // Start the applet
+- initEventQueue(panel);
++ panelInit.start();
++ while(panelInit.isAlive()) {
++ try {
++ panelInit.join();
++ } catch (InterruptedException e) {
++ }
++ }
+
+ // Wait for the panel to initialize
+ PluginAppletViewer.waitForAppletInit(panel);
+
diff --git a/dev-java/icedtea-web/icedtea-web-1.1.4-r8.ebuild b/dev-java/icedtea-web/icedtea-web-1.1.4-r8.ebuild
new file mode 100644
index 00000000..812f05f0
--- /dev/null
+++ b/dev-java/icedtea-web/icedtea-web-1.1.4-r8.ebuild
@@ -0,0 +1,139 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-java/icedtea-web/icedtea-web-1.1.4-r7.ebuild,v 1.1 2011/11/24 20:57:04 sera Exp $
+# Build written by Andrew John Hughes (ahughes@redhat.com)
+
+EAPI="4"
+
+inherit autotools eutils java-pkg-2 java-vm-2
+
+DESCRIPTION="FOSS Java browser plugin and Web Start implementation"
+HOMEPAGE="http://icedtea.classpath.org"
+SRC_URI="http://icedtea.classpath.org/download/source/${P}.tar.gz"
+
+LICENSE="GPL-2 GPL-2-with-linking-exception LGPL-2"
+SLOT="7"
+KEYWORDS="~amd64 ~x86"
+
+IUSE="build doc javascript +nsplugin test"
+
+RDEPEND="dev-java/icedtea:${SLOT}"
+# Need system junit 4.8+. Bug #389795
+DEPEND="${RDEPEND}
+ javascript? ( dev-java/rhino:1.6 )
+ nsplugin? (
+ || ( net-misc/npapi-sdk
+ >=net-libs/xulrunner-1.9.1 ) )
+ test? ( >=dev-java/junit-4.8:4 )"
+
+# a bit of hack so the VM switching is triggered without causing dependency troubles
+JAVA_PKG_NV_DEPEND=">=virtual/jdk-1.6"
+JAVA_PKG_WANT_SOURCE="1.6"
+JAVA_PKG_WANT_TARGET="1.6"
+
+pkg_setup() {
+ [[ "${MERGE_TYPE}" == "binary" ]] && return # bug 258423
+
+ # quite a hack since java-config does not provide a way for a package
+ # to limit supported VM's for building and their preferred order
+ if [[ -n "${JAVA_PKG_FORCE_VM}" ]]; then
+ einfo "Honoring user-set JAVA_PKG_FORCE_VM"
+ else
+ # migration logic
+ if [[ -L /usr/lib/jvm/icedtea${SLOT} ]]; then
+ JAVA_PKG_FORCE_VM="icedtea${SLOT}"
+ else
+ JAVA_PKG_FORCE_VM="icedtea-${SLOT}"
+ fi
+ fi
+
+ einfo "Forced vm ${JAVA_PKG_FORCE_VM}"
+ java-vm-2_pkg_setup
+ java-pkg-2_pkg_setup
+}
+
+unset_vars() {
+ unset JAVA_HOME JDK_HOME CLASSPATH JAVAC JAVACFLAGS
+}
+
+src_prepare() {
+ # bug #356645
+ epatch "${FILESDIR}"/0002-Respect-LDFLAGS.patch
+ # this should be included in next release, plugin doesn't work without it
+ epatch "${FILESDIR}"/fix-plugin-in-icedtea-7.patch
+ eautoreconf
+}
+
+src_configure() {
+ local vmhome=$(java-config -O)
+
+ if use build; then
+ icedteadir="${ICEDTEA_BIN_DIR}"
+ [[ -z ${icedteadir} ]] && die "USE=build is an internal flag and should not be enabled"
+ installdir="/opt/icedtea-web-bin-${SLOT}"
+ else
+ icedteadir="/usr/$(get_libdir)/icedtea${SLOT}"
+ installdir="/usr/$(get_libdir)/icedtea${SLOT}-web"
+ fi
+
+ unset_vars
+
+ if use build || [[ ${vmhome} == ${icedteadir} ]] ; then
+ VMHANDLE="icedtea-${SLOT}"
+ else
+ die "Unexpected install location of IcedTea${SLOT}"
+ fi
+
+ einfo "Installing IcedTea-Web in ${installdir}"
+ einfo "Installing IcedTea-Web for Icedtea${SLOT} in ${icedteadir}"
+ if [ ! -e ${vmhome} ] ; then
+ eerror "Could not find JDK install directory ${vmhome}."
+ die
+ fi
+
+ # we need to override all *dir variables that econf sets
+ # man page (javaws) is installed directly to icedteadir because it's easier than symlinking, as we don't know
+ # the suffix the man page will end up compressed with, anyway
+ econf \
+ --prefix=${installdir} --mandir=${icedteadir}/man --infodir=${installdir}/share/info --datadir=${installdir}/share \
+ --with-jdk-home=${icedteadir} \
+ $(use_enable doc docs) \
+ $(use_enable nsplugin plugin) \
+ $(use_with javascript rhino)
+}
+
+src_compile() {
+ # we need this to override the src_compile from java-pkg-2
+ default
+}
+
+src_install() {
+ # parallel make problem bug #372235
+ emake -j1 DESTDIR="${D}" install
+ dodoc AUTHORS README NEWS
+
+ if use nsplugin; then
+ install_mozilla_plugin "${installdir}/$(get_libdir)/IcedTeaPlugin.so";
+ fi
+
+ for binary in javaws itweb-settings; do
+ dosym ${installdir}/bin/${binary} ${icedteadir}/bin/${binary}
+ dosym ${installdir}/bin/${binary} ${icedteadir}/jre/bin/${binary}
+ done
+}
+
+pkg_postinst() {
+ java-vm_check-nsplugin
+ java_mozilla_clean_
+
+ if use nsplugin; then
+ elog "The icedtea browser plugin (NPPlugin) can be enabled using eselect java-nsplugin"
+ elog "Note that the plugin works only in browsers based on xulrunner-1.9.1 or later"
+ elog "such as Firefox 3.5+, Chromium and perhaps some others too."
+ fi
+}
+
+pkg_prerm() {
+ # override the java-vm-2 eclass check for removing a system VM, as it doesn't make sense here
+ :;
+}