firefox: restore gstreamer support for older firefox releases

This commit is contained in:
Nikolay Amiantov 2016-05-19 00:07:49 +03:00
parent f10859fe89
commit 5445e521b6
4 changed files with 15 additions and 8 deletions

View file

@ -346,7 +346,7 @@ rec {
*/
versionOlder = v1: v2: builtins.compareVersions v2 v1 == 1;
/* Return true iff string v1 denotes a version equal to or newer than v2.
/* Return true if string v1 denotes a version equal to or newer than v2.
Example:
versionAtLeast "1.1" "1.0"

View file

@ -172,6 +172,8 @@ stdenv.mkDerivation {
--suffix XDG_DATA_DIRS : "$XDG_ICON_DIRS"
'';
passthru.ffmpegSupport = true;
meta = with stdenv.lib; {
description = "Mozilla Firefox, free web browser (binary package)";
homepage = http://www.mozilla.org/firefox/;

View file

@ -3,7 +3,7 @@
, freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
, yasm, mesa, sqlite, unzip, makeWrapper, pysqlite
, hunspell, libevent, libstartup_notification, libvpx
, cairo, icu, libpng, jemalloc, libpulseaudio
, cairo, gstreamer, gst_plugins_base, icu, libpng, jemalloc, libpulseaudio
, enableGTK3 ? false
, debugBuild ? false
, # If you want the resulting program to call itself "Firefox" instead
@ -39,7 +39,8 @@ common = { pname, version, sha512 }: stdenv.mkDerivation rec {
icu libpng jemalloc
libpulseaudio # only headers are needed
]
++ lib.optional enableGTK3 gtk3;
++ lib.optional enableGTK3 gtk3
++ lib.optionals (!passthru.ffmpegSupport) [ gstreamer gst_plugins_base ];
configureFlags =
[ "--enable-application=browser"
@ -122,7 +123,8 @@ common = { pname, version, sha512 }: stdenv.mkDerivation rec {
passthru = {
inherit gtk nspr version;
isFirefox3Like = true;
browserName = pname;
browserName = "firefox";
ffmpegSupport = lib.versionAtLeast version "46.0";
};
};

View file

@ -2,7 +2,7 @@
## various stuff that can be plugged in
, gnash, flashplayer, hal-flash
, MPlayerPlugin, gecko_mediaplayer, ffmpeg, xorg, libpulseaudio, libcanberra
, MPlayerPlugin, gecko_mediaplayer, ffmpeg, gst_all, xorg, libpulseaudio, libcanberra
, supportsJDK, jrePlugin, icedtea_web
, trezor-bridge, bluejeans, djview4, adobe-reader
, google_talk_plugin, fribid, gnome3/*.gnome_shell*/
@ -23,6 +23,7 @@ let
cfg = stdenv.lib.attrByPath [ browserName ] {} config;
enableAdobeFlash = cfg.enableAdobeFlash or false;
enableGnash = cfg.enableGnash or false;
ffmpegSupport = browser.ffmpegSupport or false;
jre = cfg.jre or false;
icedtea = cfg.icedtea or false;
@ -45,11 +46,12 @@ let
++ lib.optional (cfg.enableAdobeReader or false) adobe-reader
++ lib.optional (cfg.enableEsteid or false) esteidfirefoxplugin
);
libs = [ ffmpeg ]
libs = (if ffmpegSupport then [ ffmpeg ] else with gst_all; [ gstreamer gst-plugins-base ])
++ lib.optionals (cfg.enableQuakeLive or false)
(with xorg; [ stdenv.cc libX11 libXxf86dga libXxf86vm libXext libXt alsaLib zlib ])
++ lib.optional (enableAdobeFlash && (cfg.enableAdobeFlashDRM or false)) hal-flash
++ lib.optional (config.pulseaudio or false) libpulseaudio;
gst-plugins = with gst_all; [ gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-ffmpeg ];
gtk_modules = [ libcanberra ];
in
@ -75,7 +77,7 @@ stdenv.mkDerivation {
];
};
buildInputs = [makeWrapper];
buildInputs = [makeWrapper] ++ lib.optionals (!ffmpegSupport) gst-plugins;
buildCommand = ''
if [ ! -x "${browser}/bin/${browserName}" ]
@ -91,7 +93,8 @@ stdenv.mkDerivation {
--suffix-each GTK_PATH ':' "$gtk_modules" \
--suffix-each LD_PRELOAD ':' "$(cat $(filterExisting $(addSuffix /extra-ld-preload $plugins)))" \
--prefix-contents PATH ':' "$(filterExisting $(addSuffix /extra-bin-path $plugins))" \
--set MOZ_OBJDIR "$(ls -d "${browser}/lib/${browserName}"*)"
--set MOZ_OBJDIR "$(ls -d "${browser}/lib/${browserName}"*)" \
${lib.optionalString (!ffmpegSupport) ''--prefix GST_PLUGIN_SYSTEM_PATH : "$GST_PLUGIN_SYSTEM_PATH"''}
${ lib.optionalString libtrick
''