git.iko.soy/typeable/nixpkgs
on master help sign in
firefox: restore gstreamer support for older firefox releases
5445e52Nikolay Amiantov
lib/strings.nix+1−1
@@ -346,7 +346,7 @@ rec {
346 */
346 */
347 versionOlder = v1: v2: builtins.compareVersions v2 v1 == 1;
347 versionOlder = v1: v2: builtins.compareVersions v2 v1 == 1;
348
348
349− /* Return true iff string v1 denotes a version equal to or newer than v2.
349+ /* Return true if string v1 denotes a version equal to or newer than v2.
350
350
351 Example:
351 Example:
352 versionAtLeast "1.1" "1.0"
352 versionAtLeast "1.1" "1.0"
pkgs/applications/networking/browsers/firefox-bin/default.nix+2
@@ -172,6 +172,8 @@ stdenv.mkDerivation {
172 --suffix XDG_DATA_DIRS : "$XDG_ICON_DIRS"
172 --suffix XDG_DATA_DIRS : "$XDG_ICON_DIRS"
173 '';
173 '';
174
174
175+ passthru.ffmpegSupport = true;
176+
175 meta = with stdenv.lib; {
177 meta = with stdenv.lib; {
176 description = "Mozilla Firefox, free web browser (binary package)";
178 description = "Mozilla Firefox, free web browser (binary package)";
177 homepage = http://www.mozilla.org/firefox/;
179 homepage = http://www.mozilla.org/firefox/;
pkgs/applications/networking/browsers/firefox/default.nix+5−3
@@ -3,7 +3,7 @@
3, freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
3, freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
4, yasm, mesa, sqlite, unzip, makeWrapper, pysqlite
4, yasm, mesa, sqlite, unzip, makeWrapper, pysqlite
5, hunspell, libevent, libstartup_notification, libvpx
5, hunspell, libevent, libstartup_notification, libvpx
6−, cairo, icu, libpng, jemalloc, libpulseaudio
6+, cairo, gstreamer, gst_plugins_base, icu, libpng, jemalloc, libpulseaudio
7, enableGTK3 ? false
7, enableGTK3 ? false
8, debugBuild ? false
8, debugBuild ? false
9, # If you want the resulting program to call itself "Firefox" instead
9, # If you want the resulting program to call itself "Firefox" instead
@@ -39,7 +39,8 @@ common = { pname, version, sha512 }: stdenv.mkDerivation rec {
39 icu libpng jemalloc
39 icu libpng jemalloc
40 libpulseaudio # only headers are needed
40 libpulseaudio # only headers are needed
41 ]
41 ]
42− ++ lib.optional enableGTK3 gtk3;
42+ ++ lib.optional enableGTK3 gtk3
43+ ++ lib.optionals (!passthru.ffmpegSupport) [ gstreamer gst_plugins_base ];
43
44
44 configureFlags =
45 configureFlags =
45 [ "--enable-application=browser"
46 [ "--enable-application=browser"
@@ -122,7 +123,8 @@ common = { pname, version, sha512 }: stdenv.mkDerivation rec {
122 passthru = {
123 passthru = {
123 inherit gtk nspr version;
124 inherit gtk nspr version;
124 isFirefox3Like = true;
125 isFirefox3Like = true;
125− browserName = pname;
126+ browserName = "firefox";
127+ ffmpegSupport = lib.versionAtLeast version "46.0";
126 };
128 };
127};
129};
128
130
pkgs/applications/networking/browsers/firefox/wrapper.nix+7−4
@@ -2,7 +2,7 @@
2
2
3## various stuff that can be plugged in
3## various stuff that can be plugged in
4, gnash, flashplayer, hal-flash
4, gnash, flashplayer, hal-flash
5−, MPlayerPlugin, gecko_mediaplayer, ffmpeg, xorg, libpulseaudio, libcanberra
5+, MPlayerPlugin, gecko_mediaplayer, ffmpeg, gst_all, xorg, libpulseaudio, libcanberra
6, supportsJDK, jrePlugin, icedtea_web
6, supportsJDK, jrePlugin, icedtea_web
7, trezor-bridge, bluejeans, djview4, adobe-reader
7, trezor-bridge, bluejeans, djview4, adobe-reader
8, google_talk_plugin, fribid, gnome3/*.gnome_shell*/
8, google_talk_plugin, fribid, gnome3/*.gnome_shell*/
@@ -23,6 +23,7 @@ let
23 cfg = stdenv.lib.attrByPath [ browserName ] {} config;
23 cfg = stdenv.lib.attrByPath [ browserName ] {} config;
24 enableAdobeFlash = cfg.enableAdobeFlash or false;
24 enableAdobeFlash = cfg.enableAdobeFlash or false;
25 enableGnash = cfg.enableGnash or false;
25 enableGnash = cfg.enableGnash or false;
26+ ffmpegSupport = browser.ffmpegSupport or false;
26 jre = cfg.jre or false;
27 jre = cfg.jre or false;
27 icedtea = cfg.icedtea or false;
28 icedtea = cfg.icedtea or false;
28
29
@@ -45,11 +46,12 @@ let
45 ++ lib.optional (cfg.enableAdobeReader or false) adobe-reader
46 ++ lib.optional (cfg.enableAdobeReader or false) adobe-reader
46 ++ lib.optional (cfg.enableEsteid or false) esteidfirefoxplugin
47 ++ lib.optional (cfg.enableEsteid or false) esteidfirefoxplugin
47 );
48 );
48− libs = [ ffmpeg ]
49+ libs = (if ffmpegSupport then [ ffmpeg ] else with gst_all; [ gstreamer gst-plugins-base ])
49 ++ lib.optionals (cfg.enableQuakeLive or false)
50 ++ lib.optionals (cfg.enableQuakeLive or false)
50 (with xorg; [ stdenv.cc libX11 libXxf86dga libXxf86vm libXext libXt alsaLib zlib ])
51 (with xorg; [ stdenv.cc libX11 libXxf86dga libXxf86vm libXext libXt alsaLib zlib ])
51 ++ lib.optional (enableAdobeFlash && (cfg.enableAdobeFlashDRM or false)) hal-flash
52 ++ lib.optional (enableAdobeFlash && (cfg.enableAdobeFlashDRM or false)) hal-flash
52 ++ lib.optional (config.pulseaudio or false) libpulseaudio;
53 ++ lib.optional (config.pulseaudio or false) libpulseaudio;
54+ gst-plugins = with gst_all; [ gst-plugins-base gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-ffmpeg ];
53 gtk_modules = [ libcanberra ];
55 gtk_modules = [ libcanberra ];
54
56
55in
57in
@@ -75,7 +77,7 @@ stdenv.mkDerivation {
75 ];
77 ];
76 };
78 };
77
79
78− buildInputs = [makeWrapper];
80+ buildInputs = [makeWrapper] ++ lib.optionals (!ffmpegSupport) gst-plugins;
79
81
80 buildCommand = ''
82 buildCommand = ''
81 if [ ! -x "${browser}/bin/${browserName}" ]
83 if [ ! -x "${browser}/bin/${browserName}" ]
@@ -91,7 +93,8 @@ stdenv.mkDerivation {
91 --suffix-each GTK_PATH ':' "$gtk_modules" \
93 --suffix-each GTK_PATH ':' "$gtk_modules" \
92 --suffix-each LD_PRELOAD ':' "$(cat $(filterExisting $(addSuffix /extra-ld-preload $plugins)))" \
94 --suffix-each LD_PRELOAD ':' "$(cat $(filterExisting $(addSuffix /extra-ld-preload $plugins)))" \
93 --prefix-contents PATH ':' "$(filterExisting $(addSuffix /extra-bin-path $plugins))" \
95 --prefix-contents PATH ':' "$(filterExisting $(addSuffix /extra-bin-path $plugins))" \
94− --set MOZ_OBJDIR "$(ls -d "${browser}/lib/${browserName}"*)"
96+ --set MOZ_OBJDIR "$(ls -d "${browser}/lib/${browserName}"*)" \
97+ ${lib.optionalString (!ffmpegSupport) ''--prefix GST_PLUGIN_SYSTEM_PATH : "$GST_PLUGIN_SYSTEM_PATH"''}
95
98
96 ${ lib.optionalString libtrick
99 ${ lib.optionalString libtrick
97 ''
100 ''