nixpkgs-suyu/pkgs/applications/networking/browsers/firefox-wrapper/default.nix
Ludovic Courtès 6cb7c2fa68 Generalize `firefox-wrapper' so that it can be used for GNU IceCat.
svn path=/nixpkgs/trunk/; revision=12439
2008-07-28 16:25:09 +00:00

33 lines
1,000 B
Nix

{stdenv, browser, browserName ? "firefox", nameSuffix ? "", makeWrapper, plugins}:
stdenv.mkDerivation {
name = browser.name + "-with-plugins";
buildInputs = [makeWrapper];
buildCommand = ''
if [ ! -x "${browser}/bin/${browserName}" ]
then
echo "cannot find executable file \`${browser}/bin/${browserName}'"
exit 1
fi
makeWrapper "${browser}/bin/${browserName}" \
"$out/bin/${browserName}${nameSuffix}" \
--suffix-each MOZ_PLUGIN_PATH ':' "$plugins" \
--suffix-contents PATH ':' "$(filterExisting $(addSuffix /extra-bin-path $plugins))"
'';
# Let each plugin tell us (through its `mozillaPlugin') attribute
# where to find the plugin in its tree.
plugins = map (x: x + x.mozillaPlugin) plugins;
meta = {
description =
browser.meta.description
+ " (with plugins: "
+ (let lib = import ../../../../lib;
in lib.concatStrings (lib.intersperse ", " (map (x: x.name) plugins)))
+ ")";
};
}