From 4fbb44e5987ce50f5e8a0bc2cbf13734d1b80452 Mon Sep 17 00:00:00 2001
From: Eelco Dolstra <eelco.dolstra@logicblox.com>
Date: Sun, 17 Oct 2004 14:30:11 +0000
Subject: [PATCH] * Enable the Java applet plugin (through Blackdown) in
 Firefox.

svn path=/nixpkgs/trunk/; revision=1567
---
 .../browsers/firefox-wrapper/builder.sh           | 15 +++++++++------
 pkgs/system/all-packages-generic.nix              |  2 +-
 2 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/pkgs/applications/networking/browsers/firefox-wrapper/builder.sh b/pkgs/applications/networking/browsers/firefox-wrapper/builder.sh
index b4fdf2e0275..fb509126dba 100644
--- a/pkgs/applications/networking/browsers/firefox-wrapper/builder.sh
+++ b/pkgs/applications/networking/browsers/firefox-wrapper/builder.sh
@@ -1,17 +1,20 @@
 . $stdenv/setup
 
+shopt -s nullglob
+
 mkdir -p $out/bin
 
 pluginPath=
 extraLibPath=
 for i in $plugins; do
-    p=$i/lib/mozilla/plugins
-    if test -e $p; then
-        pluginPath=$pluginPath${pluginPath:+:}$p
-        if test -e $p/extra-library-path; then
-            extraLibPath=$extraLibPath${extraLibPath:+:}$(cat $p/extra-library-path)
+    for p in $i/lib/mozilla/plugins $i/jre/plugin/*/mozilla; do
+        if test -e $p; then
+            pluginPath=$pluginPath${pluginPath:+:}$p
+            if test -e $p/extra-library-path; then
+                extraLibPath=$extraLibPath${extraLibPath:+:}$(cat $p/extra-library-path)
+            fi
         fi
-    fi
+    done
 done
 
 cat > $out/bin/firefox <<EOF
diff --git a/pkgs/system/all-packages-generic.nix b/pkgs/system/all-packages-generic.nix
index b1ab2224c1f..1222e1612fc 100644
--- a/pkgs/system/all-packages-generic.nix
+++ b/pkgs/system/all-packages-generic.nix
@@ -798,7 +798,7 @@ rec {
 
   firefoxWrapper = (import ../applications/networking/browsers/firefox-wrapper) {
     inherit stdenv firefox;
-    plugins = [MPlayerPlugin flashplayer];
+    plugins = [MPlayerPlugin flashplayer blackdown];
   };
 
   flashplayer = (import ../applications/networking/browsers/mozilla-plugins/flashplayer) {