wrapFirefox: move out of all-packages.nix, change defaults
- I don't think that amount of code belonged into all-packages.nix. - Now the default name of the wrapped package is identical with the command that runs the browser. - Other defaults were changed according to how the wrapper is (almost always) used. - `meta` is improved: mostly inherited with priority above the unwrapped package.
This commit is contained in:
parent
521ed1802f
commit
95c1429e62
@ -1,11 +1,58 @@
|
|||||||
{ stdenv, lib, browser, makeDesktopItem, makeWrapper, plugins, gst_plugins, libs, gtk_modules
|
{ stdenv, lib, makeDesktopItem, makeWrapper, config
|
||||||
, browserName, desktopName, nameSuffix, icon, libtrick ? true
|
|
||||||
|
## 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 {
|
stdenv.mkDerivation {
|
||||||
name = "${p.name}-with-plugins-${p.version}";
|
inherit name;
|
||||||
|
|
||||||
desktopItem = makeDesktopItem {
|
desktopItem = makeDesktopItem {
|
||||||
name = browserName;
|
name = browserName;
|
||||||
@ -26,7 +73,7 @@ stdenv.mkDerivation {
|
|||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [makeWrapper] ++ gst_plugins;
|
buildInputs = [makeWrapper] ++ gst-plugins;
|
||||||
|
|
||||||
buildCommand = ''
|
buildCommand = ''
|
||||||
if [ ! -x "${browser}/bin/${browserName}" ]
|
if [ ! -x "${browser}/bin/${browserName}" ]
|
||||||
@ -82,11 +129,15 @@ stdenv.mkDerivation {
|
|||||||
libs = map (x: x + "/lib") libs ++ map (x: x + "/lib64") libs;
|
libs = map (x: x + "/lib") libs ++ map (x: x + "/lib64") libs;
|
||||||
gtk_modules = map (x: x + x.gtkModule) gtk_modules;
|
gtk_modules = map (x: x + x.gtkModule) gtk_modules;
|
||||||
|
|
||||||
meta = {
|
passthru = { unwrapped = browser; };
|
||||||
|
|
||||||
|
meta = browser.meta // {
|
||||||
description =
|
description =
|
||||||
browser.meta.description
|
browser.meta.description
|
||||||
+ " (with plugins: "
|
+ " (with plugins: "
|
||||||
+ lib.concatStrings (lib.intersperse ", " (map (x: x.name) plugins))
|
+ lib.concatStrings (lib.intersperse ", " (map (x: x.name) plugins))
|
||||||
+ ")";
|
+ ")";
|
||||||
|
hydraPlatforms = [];
|
||||||
|
priority = (browser.meta.priority or 0) - 1; # prefer wrapper over the package
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -13621,43 +13621,7 @@ let
|
|||||||
inherit (python27Packages) cheetah;
|
inherit (python27Packages) cheetah;
|
||||||
};
|
};
|
||||||
|
|
||||||
wrapFirefox =
|
wrapFirefox = callPackage ../applications/networking/browsers/firefox/wrapper.nix { };
|
||||||
{ 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 ];
|
|
||||||
};
|
|
||||||
|
|
||||||
retroArchCores =
|
retroArchCores =
|
||||||
let
|
let
|
||||||
|
Loading…
x
Reference in New Issue
Block a user