Merge #12299: make firefox-like browsers wrapped by default

This commit is contained in:
Vladimír Čunát 2016-01-15 08:44:38 +01:00
commit 98218971c2
7 changed files with 118 additions and 93 deletions

View File

@ -24,6 +24,17 @@ nixos.path = ./nixpkgs-unstable-2015-12-06/nixos;
<xref linkend="module-misc-nixos" /></para>
</listitem>
<listitem>
<para>Firefox and similar browsers are now <emphasis>wrapped by default</emphasis>.
The package and attribute names are plain <literal>firefox</literal>
or <literal>midori</literal>, etc. Backward-compatibility attributes were set up,
but note that <command>nix-env -u</command> will <emphasis>not</emphasis> update
your current <literal>firefox-with-plugins</literal>;
you have to uninstall it and install <literal>firefox</literal> instead.
More discussion is <link xlink:href="https://github.com/NixOS/nixpkgs/pull/12299">
on the PR</link>. </para>
</listitem>
</itemizedlist>
<para>The following new services were added since the last release:

View File

@ -19,7 +19,7 @@ assert stdenv.cc ? libc && stdenv.cc.libc != null;
let
common = { pname, version, sha256 }: stdenv.mkDerivation rec {
name = "${pname}-${version}";
name = "${pname}-unwrapped-${version}";
src = fetchurl {
url =
@ -131,13 +131,13 @@ common = { pname, version, sha256 }: stdenv.mkDerivation rec {
in {
firefox = common {
firefox-unwrapped = common {
pname = "firefox";
version = "43.0.4";
sha256 = "0xjs4j26h8fyy8izrcc482vfvgg4gqzap5kh17jfv7flhn9akkvn";
};
firefox-esr = common {
firefox-esr-unwrapped = common {
pname = "firefox-esr";
version = "38.5.2esr";
sha256 = "0xqirpiys2pgzk9hs4s93svknc0sss8ry60zar7n9jj74cgz590m";

View File

@ -1,11 +1,58 @@
{ stdenv, lib, browser, makeDesktopItem, makeWrapper, plugins, gst_plugins, libs, gtk_modules
, browserName, desktopName, nameSuffix, icon, libtrick ? true
{ stdenv, lib, makeDesktopItem, makeWrapper, config
## various stuff that can be plugged in
, gnash, flashplayer, hal-flash
, MPlayerPlugin, gecko_mediaplayer, gst_all, xorg, libpulseaudio, libcanberra
, supportsJDK, jrePlugin, icedtea_web
, trezor-bridge, bluejeans, djview4
, google_talk_plugin, fribid, gnome3/*.gnome_shell*/
}:
let p = builtins.parseDrvName browser.name; in
## configurability of the wrapper itself
browser :
{ browserName ? (lib.head (lib.splitString "-" browser.name)) # name of the executable
, name ? (browserName + "-" + (builtins.parseDrvName browser.name).version)
, desktopName ? # browserName with first letter capitalized
(lib.toUpper (lib.substring 0 1 browserName) + lib.substring 1 (-1) browserName)
, nameSuffix ? ""
, icon ? browserName, libtrick ? true
}:
let
cfg = stdenv.lib.attrByPath [ browserName ] {} config;
enableAdobeFlash = cfg.enableAdobeFlash or false;
enableGnash = cfg.enableGnash or false;
jre = cfg.jre or false;
icedtea = cfg.icedtea or false;
plugins =
assert !(enableGnash && enableAdobeFlash);
assert !(jre && icedtea);
([ ]
++ lib.optional enableGnash gnash
++ lib.optional enableAdobeFlash flashplayer
++ lib.optional (cfg.enableDjvu or false) (djview4)
++ lib.optional (cfg.enableMPlayer or false) (MPlayerPlugin browser)
++ lib.optional (cfg.enableGeckoMediaPlayer or false) gecko_mediaplayer
++ lib.optional (supportsJDK && jre && jrePlugin ? mozillaPlugin) jrePlugin
++ lib.optional icedtea icedtea_web
++ lib.optional (cfg.enableGoogleTalkPlugin or false) google_talk_plugin
++ lib.optional (cfg.enableFriBIDPlugin or false) fribid
++ lib.optional (cfg.enableGnomeExtensions or false) gnome3.gnome_shell
++ lib.optional (cfg.enableTrezor or false) trezor-bridge
++ lib.optional (cfg.enableBluejeans or false) bluejeans
);
libs = [ gst_all.gstreamer gst_all.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
stdenv.mkDerivation {
name = "${p.name}-with-plugins-${p.version}";
inherit name;
desktopItem = makeDesktopItem {
name = browserName;
@ -26,7 +73,7 @@ stdenv.mkDerivation {
];
};
buildInputs = [makeWrapper] ++ gst_plugins;
buildInputs = [makeWrapper] ++ gst-plugins;
buildCommand = ''
if [ ! -x "${browser}/bin/${browserName}" ]
@ -82,11 +129,15 @@ stdenv.mkDerivation {
libs = map (x: x + "/lib") libs ++ map (x: x + "/lib64") libs;
gtk_modules = map (x: x + x.gtkModule) gtk_modules;
meta = {
passthru = { unwrapped = browser; };
meta = browser.meta // {
description =
browser.meta.description
+ " (with plugins: "
+ lib.concatStrings (lib.intersperse ", " (map (x: x.name) plugins))
+ ")";
hydraPlatforms = [];
priority = (browser.meta.priority or 0) - 1; # prefer wrapper over the package
};
}

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, unzip, firefox, makeWrapper }:
{ stdenv, fetchurl, unzip, firefox-unwrapped, makeWrapper }:
stdenv.mkDerivation rec {
name = "chatzilla-0.9.91";
@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
mkdir -p $out/libexec/chatzilla
unzip $src -d $out/libexec/chatzilla
makeWrapper ${firefox}/bin/firefox $out/bin/chatzilla \
makeWrapper ${firefox-unwrapped}/bin/firefox $out/bin/chatzilla \
--add-flags "-app $out/libexec/chatzilla/application.ini"
sed -i $out/libexec/chatzilla/application.ini -e 's/.*MaxVersion.*/MaxVersion=99.*/'

View File

@ -13,10 +13,10 @@
}:
stdenv.mkDerivation {
inherit name;
name = "${name}.desktop";
buildCommand = ''
mkdir -p $out/share/applications
cat > $out/share/applications/$name.desktop <<EOF
cat > $out/share/applications/${name}.desktop <<EOF
[Desktop Entry]
Type=${type}
Exec=${exec}

View File

@ -3,18 +3,18 @@
, freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
, yasm, mesa, sqlite, unzip, makeWrapper, pysqlite
, hunspell, libevent, libstartup_notification, libvpx
, cairo, gstreamer, gst_plugins_base, icu, firefox
, cairo, gstreamer, gst_plugins_base, icu, firefox-unwrapped
, debugBuild ? false
}:
assert stdenv.cc ? libc && stdenv.cc.libc != null;
let version = firefox.version; in
let version = firefox-unwrapped.version; in
stdenv.mkDerivation rec {
name = "xulrunner-${version}";
src = firefox.src;
src = firefox-unwrapped.src;
buildInputs =
[ pkgconfig gtk perl zip libIDL libjpeg zlib bzip2

View File

@ -4204,12 +4204,12 @@ let
icedtea7_web = callPackage ../development/compilers/icedtea-web {
jdk = jdk7;
xulrunner = firefox;
xulrunner = firefox-unwrapped;
};
icedtea8_web = callPackage ../development/compilers/icedtea-web {
jdk = jdk8;
xulrunner = firefox;
xulrunner = firefox-unwrapped;
};
icedtea_web = icedtea8_web;
@ -6636,6 +6636,14 @@ let
gstPluginsGood = pkgs.gst_plugins_good;
gstPluginsUgly = pkgs.gst_plugins_ugly;
gstFfmpeg = pkgs.gst_ffmpeg;
# aliases with the dashed naming, same as in gst_all_1
gst-plugins-base = pkgs.gst_plugins_base;
gst-plugins-bad = pkgs.gst_plugins_bad;
gst-plugins-good = pkgs.gst_plugins_good;
gst-plugins-ugly = pkgs.gst_plugins_ugly;
gst-ffmpeg = pkgs.gst_ffmpeg;
gst-python = pkgs.gst_python;
};
gstreamer = callPackage ../development/libraries/gstreamer/legacy/gstreamer {
@ -11328,13 +11336,8 @@ let
comical = callPackage ../applications/graphics/comical { };
conkeror = callPackage ../applications/networking/browsers/conkeror { };
conkerorWrapper = wrapFirefox {
browser = conkeror;
browserName = "conkeror";
desktopName = "Conkeror";
};
conkeror-unwrapped = callPackage ../applications/networking/browsers/conkeror { };
conkeror = wrapFirefox conkeror-unwrapped { };
csdp = callPackage ../applications/science/math/csdp {
liblapack = liblapackWithoutAtlas;
@ -11442,11 +11445,8 @@ let
dvd-slideshow = callPackage ../applications/video/dvd-slideshow { };
dwb = callPackage ../applications/networking/browsers/dwb { dconf = gnome3.dconf; };
dwbWrapper = wrapFirefox
{ browser = dwb; browserName = "dwb"; desktopName = "dwb";
};
dwb-unwrapped = callPackage ../applications/networking/browsers/dwb { dconf = gnome3.dconf; };
dwb = wrapFirefox dwb-unwrapped { desktopName = "dwb"; };
dwm = callPackage ../applications/window-managers/dwm {
patches = config.dwm.patches or [];
@ -11838,10 +11838,10 @@ let
inherit (pythonPackages) pysqlite;
libpng = libpng_apng;
enableGTK3 = false;
}) firefox firefox-esr;
}) firefox-unwrapped firefox-esr-unwrapped;
firefox-wrapper = wrapFirefox { browser = pkgs.firefox; };
firefox-esr-wrapper = wrapFirefox { browser = pkgs.firefox-esr; };
firefox = wrapFirefox firefox-unwrapped { };
firefox-esr = wrapFirefox firefox-esr-unwrapped { };
firefox-bin = callPackage ../applications/networking/browsers/firefox-bin {
gconf = pkgs.gnome.GConf;
@ -12033,7 +12033,7 @@ let
gecko_mediaplayer = callPackage ../applications/networking/browsers/mozilla-plugins/gecko-mediaplayer {
inherit (gnome) GConf;
browser = firefox;
browser = firefox-unwrapped;
};
geeqie = callPackage ../applications/graphics/geeqie { };
@ -12460,12 +12460,10 @@ let
mid2key = callPackage ../applications/audio/mid2key { };
midori = callPackage ../applications/networking/browsers/midori {
midori-unwrapped = callPackage ../applications/networking/browsers/midori {
webkitgtk = webkitgtk24x;
};
midoriWrapper = wrapFirefox
{ browser = midori; browserName = "midori"; desktopName = "Midori"; };
midori = wrapFirefox midori-unwrapped { };
mikmod = callPackage ../applications/audio/mikmod { };
@ -13629,43 +13627,7 @@ let
inherit (python27Packages) cheetah;
};
wrapFirefox =
{ browser, browserName ? "firefox", desktopName ? "Firefox", nameSuffix ? ""
, icon ? browserName }:
let
cfg = stdenv.lib.attrByPath [ browserName ] {} config;
enableAdobeFlash = cfg.enableAdobeFlash or false;
enableGnash = cfg.enableGnash or false;
jre = cfg.jre or false;
icedtea = cfg.icedtea or false;
in
callPackage ../applications/networking/browsers/firefox/wrapper.nix {
inherit browser browserName desktopName nameSuffix icon;
libtrick = true;
plugins =
assert !(enableGnash && enableAdobeFlash);
assert !(jre && icedtea);
([ ]
++ lib.optional enableGnash gnash
++ lib.optional enableAdobeFlash flashplayer
++ lib.optional (cfg.enableDjvu or false) (djview4)
++ lib.optional (cfg.enableMPlayer or false) (MPlayerPlugin browser)
++ lib.optional (cfg.enableGeckoMediaPlayer or false) gecko_mediaplayer
++ lib.optional (supportsJDK && jre && jrePlugin ? mozillaPlugin) jrePlugin
++ lib.optional icedtea icedtea_web
++ lib.optional (cfg.enableGoogleTalkPlugin or false) google_talk_plugin
++ lib.optional (cfg.enableFriBIDPlugin or false) fribid
++ lib.optional (cfg.enableGnomeExtensions or false) gnome3.gnome_shell
++ lib.optional (cfg.enableTrezor or false) trezor-bridge
++ lib.optional (cfg.enableBluejeans or false) bluejeans
);
libs = [ 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 = [ gst_plugins_base gst_plugins_good gst_plugins_bad gst_plugins_ugly gst_ffmpeg ];
gtk_modules = [ libcanberra ];
};
wrapFirefox = callPackage ../applications/networking/browsers/firefox/wrapper.nix { };
retroArchCores =
let
@ -13962,7 +13924,9 @@ let
pygtk = pyGtkGlade;
};
zotero = callPackage ../applications/office/zotero {};
zotero = callPackage ../applications/office/zotero {
firefox = firefox-unwrapped;
};
zscroll = callPackage ../applications/misc/zscroll {};
@ -14686,7 +14650,8 @@ let
tag = "-client-without-kde";
});
rekonq = callPackage ../applications/networking/browsers/rekonq { };
rekonq-unwrapped = callPackage ../applications/networking/browsers/rekonq { };
rekonq = wrapFirefox rekonq-unwrapped { };
kwebkitpart = callPackage ../applications/networking/browsers/kwebkitpart { };
@ -15688,27 +15653,17 @@ let
inherit (darwin.apple_sdk.frameworks) Cocoa;
});
vimprobable2 = callPackage ../applications/networking/browsers/vimprobable2 {
vimprobable2-unwrapped = callPackage ../applications/networking/browsers/vimprobable2 {
webkit = webkitgtk2;
};
vimprobable2 = wrapFirefox vimprobable2-unwrapped { };
vimprobable2Wrapper = wrapFirefox
{ browser = vimprobable2; browserName = "vimprobable2"; desktopName = "Vimprobable2";
};
inherit (kde4) rekonq;
rekonqWrapper = wrapFirefox {
browser = kde4.rekonq; browserName = "rekonq"; desktopName = "Rekonq";
};
vimb = callPackage ../applications/networking/browsers/vimb {
vimb-unwrapped = callPackage ../applications/networking/browsers/vimb {
webkit = webkitgtk2;
};
vimbWrapper = wrapFirefox {
browser = vimb;
browserName = "vimb";
desktopName = "Vimb";
};
vimb = wrapFirefox vimb-unwrapped { };
vips = callPackage ../tools/graphics/vips { };
nip2 = callPackage ../tools/graphics/nip2 { };
@ -15839,12 +15794,16 @@ aliases = with self; rec {
buildbotSlave = buildbot-slave; # added 2014-12-09
cheetahTemplate = pythonPackages.cheetah; # 2015-06-15
clangAnalyzer = clang-analyzer; # added 2015-02-20
conkerorWrapper = conkeror; # added 2015-01
cool-old-term = cool-retro-term; # added 2015-01-31
cupsBjnp = cups-bjnp; # added 2016-01-02
cv = progress; # added 2015-09-06
dwbWrapper = dwb; # added 2015-01
enblendenfuse = enblend-enfuse; # 2015-09-30
exfat-utils = exfat; # 2015-09-11
firefoxWrapper = firefox-wrapper;
firefoxWrapper = firefox; # 2015-09
firefox-wrapper = firefox; # 2016-01
firefox-esr-wrapper = firefox-esr; # 2016-01
fuse_exfat = exfat; # 2015-09-11
grantlee5 = qt5.grantlee; # added 2015-12-19
gupnptools = gupnp-tools; # added 2015-12-19
@ -15856,6 +15815,7 @@ aliases = with self; rec {
libtidy = html-tidy; # added 2014-12-21
lttngTools = lttng-tools; # added 2014-07-31
lttngUst = lttng-ust; # added 2014-07-31
midoriWrapper = midori; # added 2015-01
mlt-qt5 = qt5.mlt; # added 2015-12-19
nfsUtils = nfs-utils; # added 2014-12-06
phonon_qt5 = qt5.phonon; # added 2015-12-19
@ -15870,6 +15830,7 @@ aliases = with self; rec {
quasselClient_kf5 = kde5.quasselClient; # added 2015-09-30
qwt6 = qt5.qwt; # added 2015-12-19
rdiff_backup = rdiff-backup; # added 2014-11-23
rekonqWrapper = rekonq; # added 2015-01
rssglx = rss-glx; #added 2015-03-25
rxvt_unicode_with-plugins = rxvt_unicode-with-plugins; # added 2015-04-02
signon = qt5.signon; # added 2015-12-19
@ -15882,6 +15843,8 @@ aliases = with self; rec {
xlibs = xorg; # added 2015-09
youtube-dl = pythonPackages.youtube-dl; # added 2015-06-07
youtubeDL = youtube-dl; # added 2014-10-26
vimbWrapper = vimb; # added 2015-01
vimprobable2Wrapper = vimprobable2; # added 2015-01
pidginlatexSF = pidginlatex; # added 2014-11-02
tftp_hpa = tftp-hpa; # added 2015-04-03
manpages = man-pages; # added 2015-12-06