chromium: Use upstream desktop entry
Upstream provides a much more featureful desktop entry file. If we use that we take advantage of all of those features and don't have to maintain it ourselves.
This commit is contained in:
parent
356ba795cb
commit
0f537a49e1
@ -38,6 +38,25 @@ mkChromiumDerivation (base: rec {
|
|||||||
mkdir -vp "$logo_output_path"
|
mkdir -vp "$logo_output_path"
|
||||||
cp -v "$icon_file" "$logo_output_path/$packageName.png"
|
cp -v "$icon_file" "$logo_output_path/$packageName.png"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Install Desktop Entry
|
||||||
|
install -D chrome/installer/linux/common/desktop.template \
|
||||||
|
$out/share/applications/chromium-browser.desktop
|
||||||
|
|
||||||
|
substituteInPlace $out/share/applications/chromium-browser.desktop \
|
||||||
|
--replace "@@MENUNAME@@" "Chromium" \
|
||||||
|
--replace "@@PACKAGE@@" "chromium" \
|
||||||
|
--replace "Exec=/usr/bin/@@USR_BIN_SYMLINK_NAME@@" "Exec=chromium"
|
||||||
|
|
||||||
|
# Append more mime types to the end
|
||||||
|
sed -i '/^MimeType=/ s,$,x-scheme-handler/webcal;x-scheme-handler/mailto;x-scheme-handler/about;x-scheme-handler/unknown,' \
|
||||||
|
$out/share/applications/chromium-browser.desktop
|
||||||
|
|
||||||
|
# See https://github.com/NixOS/nixpkgs/issues/12433
|
||||||
|
sed -i \
|
||||||
|
-e '/\[Desktop Entry\]/a\' \
|
||||||
|
-e 'StartupWMClass=chromium-browser' \
|
||||||
|
$out/share/applications/chromium-browser.desktop
|
||||||
'';
|
'';
|
||||||
|
|
||||||
passthru = { inherit sandboxExecutableName; };
|
passthru = { inherit sandboxExecutableName; };
|
||||||
|
@ -45,31 +45,6 @@ in let
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
desktopItem = makeDesktopItem {
|
|
||||||
name = "chromium-browser";
|
|
||||||
exec = "chromium %U";
|
|
||||||
icon = "chromium";
|
|
||||||
comment = "An open source web browser from Google";
|
|
||||||
desktopName = "Chromium";
|
|
||||||
genericName = "Web browser";
|
|
||||||
mimeType = stdenv.lib.concatStringsSep ";" [
|
|
||||||
"text/html"
|
|
||||||
"text/xml"
|
|
||||||
"application/xhtml+xml"
|
|
||||||
"x-scheme-handler/http"
|
|
||||||
"x-scheme-handler/https"
|
|
||||||
"x-scheme-handler/ftp"
|
|
||||||
"x-scheme-handler/mailto"
|
|
||||||
"x-scheme-handler/webcal"
|
|
||||||
"x-scheme-handler/about"
|
|
||||||
"x-scheme-handler/unknown"
|
|
||||||
];
|
|
||||||
categories = "Network;WebBrowser";
|
|
||||||
extraEntries = ''
|
|
||||||
StartupWMClass=chromium-browser
|
|
||||||
'';
|
|
||||||
};
|
|
||||||
|
|
||||||
suffix = if channel != "stable" then "-" + channel else "";
|
suffix = if channel != "stable" then "-" + channel else "";
|
||||||
|
|
||||||
sandboxExecutableName = chromium.browser.passthru.sandboxExecutableName;
|
sandboxExecutableName = chromium.browser.passthru.sandboxExecutableName;
|
||||||
@ -135,7 +110,6 @@ in stdenv.mkDerivation {
|
|||||||
for f in '${chromium.browser}'/share/*; do # hello emacs */
|
for f in '${chromium.browser}'/share/*; do # hello emacs */
|
||||||
ln -s -t "$out/share/" "$f"
|
ln -s -t "$out/share/" "$f"
|
||||||
done
|
done
|
||||||
cp -v "${desktopItem}/share/applications/"* "$out/share/applications"
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
inherit (chromium.browser) packageName;
|
inherit (chromium.browser) packageName;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user