MPlayerPlugin: Allow compilation with GNU IceCat 3.

Similar changes would allow it to be compiled for Mozilla Firefox 3.

svn path=/nixpkgs/trunk/; revision=12929
This commit is contained in:
Ludovic Courtès 2008-09-29 21:56:17 +00:00
parent c4906848f4
commit 2e30347099
2 changed files with 21 additions and 5 deletions

View file

@ -1,4 +1,4 @@
{stdenv, fetchurl, pkgconfig, firefox, libXpm, gettext}:
{stdenv, fetchurl, pkgconfig, browser, browserName, libXpm, gettext}:
stdenv.mkDerivation rec {
name = "mplayerplug-in-3.55";
@ -8,7 +8,22 @@ stdenv.mkDerivation rec {
sha256 = "0zkvqrzibrbljiccvz3rhbmgifxadlrfjylqpz48jnjx9kggynms";
};
buildInputs = [pkgconfig firefox (firefox.gtk) libXpm gettext];
patches =
(if browserName == "icecat" # FIXME: Should match Firefox 3 as well.
then [ ./icecat3-idldir.patch ]
else []);
postConfigure =
(if browserName == "icecat" # FIXME: Should match Firefox 3 as well.
then ''
# Cause a rebuild of these file from the IDL file, needed for GNU IceCat 3
# and Mozilla Firefox 3.
# See, e.g., http://article.gmane.org/gmane.comp.mozilla.mplayerplug-in/2104 .
rm -f Source/nsIScriptableMplayerPlugin.h
''
else "");
buildInputs = [ pkgconfig browser (browser.gtk) libXpm gettext ];
installPhase = ''
ensureDir $out/lib/mozilla/plugins
@ -22,5 +37,6 @@ stdenv.mkDerivation rec {
meta = {
description = "A browser plugin that uses mplayer to play digital media from websites";
homepage = http://mplayerplug-in.sourceforge.net/;
licenses = [ "GPLv2+" "LGPLv2+" "MPLv1+" ];
};
}

View file

@ -6537,9 +6537,9 @@ let
};
*/
MPlayerPlugin = browser:
MPlayerPlugin = browser: browserName:
import ../applications/networking/browsers/mozilla-plugins/mplayerplug-in {
firefox = browser;
inherit browser browserName;
inherit fetchurl stdenv pkgconfig gettext;
inherit (xlibs) libXpm;
# !!! should depend on MPlayer
@ -6960,7 +6960,7 @@ let
++ lib.optional (enableAdobeFlash) flashplayer
# RealPlayer is disabled by default for legal reasons.
++ lib.optional (system != "i686-linux" && getConfig [browserName "enableRealPlayer"] false) RealPlayer
++ lib.optional (getConfig [browserName "enableMPlayer"] true) (MPlayerPlugin browser)
++ lib.optional (getConfig [browserName "enableMPlayer"] true) (MPlayerPlugin browser browserName)
++ lib.optional (supportsJDK && getConfig [browserName "jre"] false && jrePlugin ? mozillaPlugin) jrePlugin
);
};