Merge pull request #60499 from JohnAZoidberg/chromium-upstream-desktop-entry

chromium: Use upstream desktop entry
This commit is contained in:
Silvan Mosberger 2019-05-27 18:28:20 +02:00 committed by GitHub
commit 526a0b2277
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 26 deletions

View file

@ -38,6 +38,25 @@ mkChromiumDerivation (base: rec {
mkdir -vp "$logo_output_path"
cp -v "$icon_file" "$logo_output_path/$packageName.png"
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; };

View file

@ -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 "";
sandboxExecutableName = chromium.browser.passthru.sandboxExecutableName;
@ -135,7 +110,6 @@ in stdenv.mkDerivation {
for f in '${chromium.browser}'/share/*; do # hello emacs */
ln -s -t "$out/share/" "$f"
done
cp -v "${desktopItem}/share/applications/"* "$out/share/applications"
'';
inherit (chromium.browser) packageName;