treewide: fix some desktop file names

pkgs.writeTextFile doesn't like spaces in filenames.
This is fixed in #162246, but other tools will probably dislike
spaces in .desktop file names as well, and that PR will take forever,
so let's fix this anyway.
main
K900 2 years ago
parent 93a789543a
commit 1e2662c5fd
  1. 4
      pkgs/applications/misc/prusa-slicer/default.nix
  2. 2
      pkgs/applications/misc/prusa-slicer/super-slicer.nix
  3. 9
      pkgs/build-support/make-desktopitem/default.nix
  4. 4
      pkgs/development/tools/scenebuilder/default.nix
  5. 4
      pkgs/games/domination/default.nix
  6. 2
      pkgs/games/lunar-client/default.nix

@ -93,7 +93,7 @@ stdenv.mkDerivation rec {
desktopItems = [
(makeDesktopItem {
name = "PrusaSlicer";
name = "prusa-slicer";
exec = "prusa-slicer";
icon = "PrusaSlicer";
comment = "G-code generator for 3D printers";
@ -102,7 +102,7 @@ stdenv.mkDerivation rec {
categories = [ "Development" ];
})
(makeDesktopItem {
name = "PrusaSlicer G-code Viewer";
name = "prusa-gcodeviewer";
exec = "prusa-gcodeviewer";
icon = "PrusaSlicer-gcodeviewer";
comment = "G-code viewer for 3D printers";

@ -33,7 +33,7 @@ let
desktopItems = [
(makeDesktopItem {
name = appname;
name = "superslicer";
exec = "superslicer";
icon = appname;
comment = description;

@ -34,6 +34,11 @@
, extraConfig ? {} # Additional values to be added literally to the final item, e.g. vendor extensions
}:
let
# FIXME: workaround until https://github.com/NixOS/nixpkgs/pull/162246 lands
cleanName = if lib.hasInfix " " name
then throw "Name must not contain spaces!"
else name;
# There are multiple places in the FDO spec that make "boolean" values actually tristate,
# e.g. StartupNotify, where "unset" is literally defined as "do something reasonable".
# So, handle null values separately.
@ -111,8 +116,8 @@ let
content = [ mainSectionRendered ] ++ actionsRendered;
in
writeTextFile {
name = "${name}.desktop";
destination = "/share/applications/${name}.desktop";
name = "${cleanName}.desktop";
destination = "/share/applications/${cleanName}.desktop";
text = builtins.concatStringsSep "\n" content;
checkPhase = "${desktop-file-utils}/bin/desktop-file-validate $target";
}

@ -64,11 +64,11 @@ let
'';
desktopItem = makeDesktopItem {
name = "Scene Builder";
name = "scenebuilder";
exec = "scenebuilder";
icon = "scenebuilder";
comment = "A visual, drag'n'drop, layout tool for designing JavaFX application user interfaces.";
desktopName = pname;
desktopName = "Scene Builder";
mimeTypes = [ "application/java" "application/java-vm" "application/java-archive" ];
categories = [ "Development" ];
};

@ -11,13 +11,13 @@
let
desktopItem = makeDesktopItem {
name = "Domination";
name = "domination";
desktopName = "Domination";
exec = "domination";
icon = "domination";
};
editorDesktopItem = makeDesktopItem {
name = "Domination Map Editor";
name = "domination-map-editor";
desktopName = "Domination Map Editor";
exec = "domination-map-editor";
icon = "domination";

@ -5,7 +5,7 @@ let
version = "2.9.3";
desktopItem = makeDesktopItem {
name = "Lunar Client";
name = "lunar-client";
exec = "lunar-client";
icon = "lunarclient";
comment = "Minecraft 1.7, 1.8, 1.12, 1.15, and 1.16 Client";

Loading…
Cancel
Save