Added desktop file generation function and desktop item for firefox
svn path=/nixpkgs/trunk/; revision=15529
This commit is contained in:
parent
52f61aa067
commit
a8315aa241
@ -1,8 +1,18 @@
|
||||
{stdenv, browser, browserName ? "firefox", nameSuffix ? "", makeWrapper, plugins}:
|
||||
{stdenv, browser, browserName ? "firefox", nameSuffix ? "", makeDesktopItem, makeWrapper, plugins}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = browser.name + "-with-plugins";
|
||||
|
||||
desktopItem = makeDesktopItem {
|
||||
name = browserName;
|
||||
exec = browserName;
|
||||
icon = "${browser}/lib/${browser.name}/icons/mozicon128.png";
|
||||
comment = "";
|
||||
desktopName = browserName;
|
||||
genericName = "Web Browser";
|
||||
categories = "Application;Network;";
|
||||
};
|
||||
|
||||
buildInputs = [makeWrapper];
|
||||
|
||||
buildCommand = ''
|
||||
@ -16,6 +26,9 @@ stdenv.mkDerivation {
|
||||
"$out/bin/${browserName}${nameSuffix}" \
|
||||
--suffix-each MOZ_PLUGIN_PATH ':' "$plugins" \
|
||||
--suffix-contents PATH ':' "$(filterExisting $(addSuffix /extra-bin-path $plugins))"
|
||||
|
||||
ensureDir $out/share/applications
|
||||
cp $desktopItem/share/applications/* $out/share/applications
|
||||
'';
|
||||
|
||||
# Let each plugin tell us (through its `mozillaPlugin') attribute
|
||||
|
33
pkgs/build-support/make-desktopitem/default.nix
Normal file
33
pkgs/build-support/make-desktopitem/default.nix
Normal file
@ -0,0 +1,33 @@
|
||||
{stdenv}:
|
||||
{ name
|
||||
, type ? "Application"
|
||||
, exec
|
||||
, icon ? ""
|
||||
, comment ? ""
|
||||
, terminal ? "false"
|
||||
, desktopName
|
||||
, genericName
|
||||
, mimeType ? ""
|
||||
, categories ? "Application;Other;"
|
||||
, encoding ? "UTF-8"
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
inherit name;
|
||||
buildCommand = ''
|
||||
ensureDir $out/share/applications
|
||||
cat > $out/share/applications/$name.desktop <<EOF
|
||||
[Desktop Entry]
|
||||
Type=${type}
|
||||
Exec=${exec}
|
||||
Icon=${icon}
|
||||
Comment=${comment}
|
||||
Terminal=${terminal}
|
||||
Name=${desktopName}
|
||||
GenericName=${genericName}
|
||||
MimeType=${mimeType}
|
||||
Categories=${categories}
|
||||
Encoding=${encoding}
|
||||
EOF
|
||||
'';
|
||||
}
|
@ -284,6 +284,10 @@ let
|
||||
inherit url;
|
||||
};
|
||||
|
||||
makeDesktopItem = import ../build-support/make-desktopitem {
|
||||
inherit stdenv;
|
||||
};
|
||||
|
||||
makeInitrd = {contents}: import ../build-support/kernel/make-initrd.nix {
|
||||
inherit stdenv perl cpio contents;
|
||||
};
|
||||
@ -6948,7 +6952,7 @@ let
|
||||
};
|
||||
|
||||
wrapFirefox = browser: browserName: nameSuffix: import ../applications/networking/browsers/firefox-wrapper {
|
||||
inherit stdenv nameSuffix makeWrapper browser browserName;
|
||||
inherit stdenv nameSuffix makeWrapper makeDesktopItem browser browserName;
|
||||
plugins =
|
||||
let enableAdobeFlash = getConfig [ browserName "enableAdobeFlash" ] true;
|
||||
in
|
||||
|
Loading…
Reference in New Issue
Block a user