2011-12-12 17:25:51 +00:00
|
|
|
{ stdenv, browser, makeDesktopItem, makeWrapper, plugins, libs
|
2011-10-06 13:52:54 +00:00
|
|
|
, browserName, desktopName, nameSuffix, icon
|
2010-05-18 14:58:45 +00:00
|
|
|
}:
|
2004-10-17 13:28:28 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2008-07-28 16:25:09 +00:00
|
|
|
name = browser.name + "-with-plugins";
|
2004-10-17 13:28:28 +00:00
|
|
|
|
2009-05-10 12:03:53 +00:00
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = browserName;
|
2012-03-20 23:23:00 +00:00
|
|
|
exec = browserName + " %U";
|
2011-10-06 13:52:54 +00:00
|
|
|
icon = icon;
|
2009-05-10 12:03:53 +00:00
|
|
|
comment = "";
|
2010-05-18 14:58:45 +00:00
|
|
|
desktopName = desktopName;
|
2009-05-10 12:03:53 +00:00
|
|
|
genericName = "Web Browser";
|
2012-03-20 23:23:00 +00:00
|
|
|
categories = "Application;Network;WebBrowser;";
|
2009-05-10 12:03:53 +00:00
|
|
|
};
|
|
|
|
|
2008-06-14 21:42:07 +00:00
|
|
|
buildInputs = [makeWrapper];
|
2004-10-17 13:28:28 +00:00
|
|
|
|
2008-06-14 21:42:07 +00:00
|
|
|
buildCommand = ''
|
2008-07-28 16:25:09 +00:00
|
|
|
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}" \
|
2008-06-14 21:42:07 +00:00
|
|
|
--suffix-each MOZ_PLUGIN_PATH ':' "$plugins" \
|
2011-12-12 17:25:51 +00:00
|
|
|
--suffix-each LD_LIBRARY_PATH ':' "$libs" \
|
2012-04-01 15:32:48 +00:00
|
|
|
--suffix-each LD_PRELOAD ':' "$(cat $(filterExisting $(addSuffix /extra-ld-preload $plugins)))" \
|
2009-07-16 11:22:37 +00:00
|
|
|
--prefix-contents PATH ':' "$(filterExisting $(addSuffix /extra-bin-path $plugins))"
|
2009-05-10 12:03:53 +00:00
|
|
|
|
2012-01-18 20:16:00 +00:00
|
|
|
mkdir -p $out/share/applications
|
2009-05-10 12:03:53 +00:00
|
|
|
cp $desktopItem/share/applications/* $out/share/applications
|
2012-03-25 20:21:45 +00:00
|
|
|
|
|
|
|
# For manpages, in case the program supplies them
|
|
|
|
mkdir -p $out/nix-support
|
|
|
|
echo ${browser} > $out/nix-support/propagated-user-env-packages
|
2008-06-14 21:42:07 +00:00
|
|
|
'';
|
2007-11-24 10:49:52 +00:00
|
|
|
|
2005-02-16 11:24:40 +00:00
|
|
|
# Let each plugin tell us (through its `mozillaPlugin') attribute
|
|
|
|
# where to find the plugin in its tree.
|
2006-08-09 15:05:30 +00:00
|
|
|
plugins = map (x: x + x.mozillaPlugin) plugins;
|
2011-12-12 17:25:51 +00:00
|
|
|
libs = map (x: x + "/lib") libs ++ map (x: x + "/lib64") libs;
|
2006-03-10 16:12:46 +00:00
|
|
|
|
|
|
|
meta = {
|
2006-10-12 10:53:16 +00:00
|
|
|
description =
|
2008-07-28 16:25:09 +00:00
|
|
|
browser.meta.description
|
2006-10-12 10:53:16 +00:00
|
|
|
+ " (with plugins: "
|
|
|
|
+ (let lib = import ../../../../lib;
|
|
|
|
in lib.concatStrings (lib.intersperse ", " (map (x: x.name) plugins)))
|
|
|
|
+ ")";
|
2006-03-10 16:12:46 +00:00
|
|
|
};
|
2004-10-17 13:28:28 +00:00
|
|
|
}
|