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 {
|
stdenv.mkDerivation {
|
||||||
name = browser.name + "-with-plugins";
|
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];
|
buildInputs = [makeWrapper];
|
||||||
|
|
||||||
buildCommand = ''
|
buildCommand = ''
|
||||||
@ -16,6 +26,9 @@ stdenv.mkDerivation {
|
|||||||
"$out/bin/${browserName}${nameSuffix}" \
|
"$out/bin/${browserName}${nameSuffix}" \
|
||||||
--suffix-each MOZ_PLUGIN_PATH ':' "$plugins" \
|
--suffix-each MOZ_PLUGIN_PATH ':' "$plugins" \
|
||||||
--suffix-contents PATH ':' "$(filterExisting $(addSuffix /extra-bin-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
|
# 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;
|
inherit url;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
makeDesktopItem = import ../build-support/make-desktopitem {
|
||||||
|
inherit stdenv;
|
||||||
|
};
|
||||||
|
|
||||||
makeInitrd = {contents}: import ../build-support/kernel/make-initrd.nix {
|
makeInitrd = {contents}: import ../build-support/kernel/make-initrd.nix {
|
||||||
inherit stdenv perl cpio contents;
|
inherit stdenv perl cpio contents;
|
||||||
};
|
};
|
||||||
@ -6948,7 +6952,7 @@ let
|
|||||||
};
|
};
|
||||||
|
|
||||||
wrapFirefox = browser: browserName: nameSuffix: import ../applications/networking/browsers/firefox-wrapper {
|
wrapFirefox = browser: browserName: nameSuffix: import ../applications/networking/browsers/firefox-wrapper {
|
||||||
inherit stdenv nameSuffix makeWrapper browser browserName;
|
inherit stdenv nameSuffix makeWrapper makeDesktopItem browser browserName;
|
||||||
plugins =
|
plugins =
|
||||||
let enableAdobeFlash = getConfig [ browserName "enableAdobeFlash" ] true;
|
let enableAdobeFlash = getConfig [ browserName "enableAdobeFlash" ] true;
|
||||||
in
|
in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user