diff --git a/nixos/doc/manual/release-notes/rl-unstable.xml b/nixos/doc/manual/release-notes/rl-unstable.xml index 48771d8c2251..cd828dfc8887 100644 --- a/nixos/doc/manual/release-notes/rl-unstable.xml +++ b/nixos/doc/manual/release-notes/rl-unstable.xml @@ -24,6 +24,17 @@ nixos.path = ./nixpkgs-unstable-2015-12-06/nixos; + + Firefox and similar browsers are now wrapped by default. + The package and attribute names are plain firefox + or midori, etc. Backward-compatibility attributes were set up, + but note that nix-env -u will not update + your current firefox-with-plugins; + you have to uninstall it and install firefox instead. + More discussion is + on the PR. + + The following new services were added since the last release: diff --git a/pkgs/applications/networking/browsers/firefox/default.nix b/pkgs/applications/networking/browsers/firefox/default.nix index 80f5e7212c8c..846c79d0b746 100644 --- a/pkgs/applications/networking/browsers/firefox/default.nix +++ b/pkgs/applications/networking/browsers/firefox/default.nix @@ -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"; diff --git a/pkgs/applications/networking/browsers/firefox/wrapper.nix b/pkgs/applications/networking/browsers/firefox/wrapper.nix index db51dc8b148b..8c805b0bf5fe 100644 --- a/pkgs/applications/networking/browsers/firefox/wrapper.nix +++ b/pkgs/applications/networking/browsers/firefox/wrapper.nix @@ -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 }; } diff --git a/pkgs/applications/networking/irc/chatzilla/default.nix b/pkgs/applications/networking/irc/chatzilla/default.nix index 765066bb4371..82d9912192ed 100644 --- a/pkgs/applications/networking/irc/chatzilla/default.nix +++ b/pkgs/applications/networking/irc/chatzilla/default.nix @@ -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.*/' diff --git a/pkgs/build-support/make-desktopitem/default.nix b/pkgs/build-support/make-desktopitem/default.nix index d4baf17adf1b..2f6c827d8758 100644 --- a/pkgs/build-support/make-desktopitem/default.nix +++ b/pkgs/build-support/make-desktopitem/default.nix @@ -13,10 +13,10 @@ }: stdenv.mkDerivation { - inherit name; + name = "${name}.desktop"; buildCommand = '' mkdir -p $out/share/applications - cat > $out/share/applications/$name.desktop < $out/share/applications/${name}.desktop <