summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorK900 <me@0upti.me>2022-02-28 20:10:56 +0300
committerK900 <me@0upti.me>2022-02-28 20:15:33 +0300
commit1e2662c5fdceeebb8060214f457791a57da7c19c (patch)
tree7c734e82131041642a21ce5d433f888766f46476 /pkgs
parent93a789543ae6b5831ae8040532202caa927f314c (diff)
downloadnixpkgs-1e2662c5fdceeebb8060214f457791a57da7c19c.tar
nixpkgs-1e2662c5fdceeebb8060214f457791a57da7c19c.tar.gz
nixpkgs-1e2662c5fdceeebb8060214f457791a57da7c19c.tar.bz2
nixpkgs-1e2662c5fdceeebb8060214f457791a57da7c19c.tar.lz
nixpkgs-1e2662c5fdceeebb8060214f457791a57da7c19c.tar.xz
nixpkgs-1e2662c5fdceeebb8060214f457791a57da7c19c.tar.zst
nixpkgs-1e2662c5fdceeebb8060214f457791a57da7c19c.zip
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.
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/misc/prusa-slicer/default.nix4
-rw-r--r--pkgs/applications/misc/prusa-slicer/super-slicer.nix2
-rw-r--r--pkgs/build-support/make-desktopitem/default.nix9
-rw-r--r--pkgs/development/tools/scenebuilder/default.nix4
-rw-r--r--pkgs/games/domination/default.nix4
-rw-r--r--pkgs/games/lunar-client/default.nix2
6 files changed, 15 insertions, 10 deletions
diff --git a/pkgs/applications/misc/prusa-slicer/default.nix b/pkgs/applications/misc/prusa-slicer/default.nix
index d72d605f021..6ae7f422f02 100644
--- a/pkgs/applications/misc/prusa-slicer/default.nix
+++ b/pkgs/applications/misc/prusa-slicer/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";
diff --git a/pkgs/applications/misc/prusa-slicer/super-slicer.nix b/pkgs/applications/misc/prusa-slicer/super-slicer.nix
index de00c1174b9..7a4d2ee1d25 100644
--- a/pkgs/applications/misc/prusa-slicer/super-slicer.nix
+++ b/pkgs/applications/misc/prusa-slicer/super-slicer.nix
@@ -33,7 +33,7 @@ let
 
     desktopItems = [
       (makeDesktopItem {
-        name = appname;
+        name = "superslicer";
         exec = "superslicer";
         icon = appname;
         comment = description;
diff --git a/pkgs/build-support/make-desktopitem/default.nix b/pkgs/build-support/make-desktopitem/default.nix
index 787f0f67847..e0a57f4aa3f 100644
--- a/pkgs/build-support/make-desktopitem/default.nix
+++ b/pkgs/build-support/make-desktopitem/default.nix
@@ -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";
 }
diff --git a/pkgs/development/tools/scenebuilder/default.nix b/pkgs/development/tools/scenebuilder/default.nix
index 3ae31bbadb9..77928a1f22a 100644
--- a/pkgs/development/tools/scenebuilder/default.nix
+++ b/pkgs/development/tools/scenebuilder/default.nix
@@ -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" ];
   };
diff --git a/pkgs/games/domination/default.nix b/pkgs/games/domination/default.nix
index dd044656534..b7eae5e5acd 100644
--- a/pkgs/games/domination/default.nix
+++ b/pkgs/games/domination/default.nix
@@ -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";
diff --git a/pkgs/games/lunar-client/default.nix b/pkgs/games/lunar-client/default.nix
index dceb9755fa2..fbebe85cf00 100644
--- a/pkgs/games/lunar-client/default.nix
+++ b/pkgs/games/lunar-client/default.nix
@@ -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";