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