about summary refs log tree commit diff
path: root/pkgs/development/embedded
diff options
context:
space:
mode:
authorprtzl <matej.blagsic@protonmail.com>2023-06-28 21:17:15 +0200
committerprtzl <matej.blagsic@protonmail.com>2023-06-28 21:17:15 +0200
commitb8b52d7668fb53049964dfca1cf574afd6f8d425 (patch)
treec57a24415c3b278d1ec2afee61640243bf32eaaf /pkgs/development/embedded
parent3a35ba334a04712539f4e29f52d027505fc86048 (diff)
Use makeDesktopItems but copy it to the correct path in the buildCommand manualy.
Diffstat (limited to 'pkgs/development/embedded')
-rw-r--r--pkgs/development/embedded/stm32/stm32cubemx/default.nix41
1 files changed, 17 insertions, 24 deletions
diff --git a/pkgs/development/embedded/stm32/stm32cubemx/default.nix b/pkgs/development/embedded/stm32/stm32cubemx/default.nix
index bb2acf6a0adb4..9f6816425d734 100644
--- a/pkgs/development/embedded/stm32/stm32cubemx/default.nix
+++ b/pkgs/development/embedded/stm32/stm32cubemx/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, makeDesktopItem, copyDesktopItems, icoutils, fdupes, imagemagick, jdk11, fetchzip }:
+{ lib, stdenv, makeDesktopItem, icoutils, fdupes, imagemagick, jdk11, fetchzip }:
 # TODO: JDK16 causes STM32CubeMX to crash right now, so we fixed the version to JDK11
 # This may be fixed in a future version of STM32CubeMX. This issue has been reported to ST:
 # https://community.st.com/s/question/0D53W00000jnOzPSAU/stm32cubemx-crashes-on-launch-with-openjdk16
@@ -17,17 +17,21 @@ stdenv.mkDerivation rec {
     stripRoot = false;
   };
 
-  nativeBuildInputs = [ icoutils fdupes imagemagick copyDesktopItems ];
-  desktopItems = [
-    (makeDesktopItem {
-      name = "stm32CubeMX";
-      exec = "stm32cubemx";
-      desktopName = "STM32CubeMX";
-      categories = [ "Development" ];
-      comment = "STM32Cube initialization code generator";
-      icon = "stm32cubemx";
-    })
-  ];
+  nativeBuildInputs = [ icoutils fdupes imagemagick ];
+  desktopItem = makeDesktopItem {
+    name = "STM32CubeMX";
+    exec = "stm32cubemx";
+    desktopName = "STM32CubeMX";
+    categories = [ "Development" ];
+    icon = "stm32cubemx";
+    comment = meta.description;
+    terminal = false;
+    startupNotify = false;
+    mimeTypes = [
+      "x-scheme-handler/sgnl"
+      "x-scheme-handler/signalcaptcha"
+    ];
+  };
 
   buildCommand = ''
     mkdir -p $out/{bin,opt/STM32CubeMX,share/applications}
@@ -55,18 +59,7 @@ stdenv.mkDerivation rec {
       fi
     done;
 
-    cat << EOF > $out/share/applications/stm32cubemx.desktop
-    [Desktop Entry]
-    Name=STM32CubeMX
-    Exec=stm32cubemx %F
-    Terminal=false
-    Type=Application
-    Icon=stm32cubemx
-    StartupWMClass=STM32CubeMX
-    Comment=A graphical tool for configuring STM32 microcontrollers and microprocessors
-    MimeType=x-scheme-handler/sgnl;x-scheme-handler/signalcaptcha;
-    Categories=Programming;
-    EOF
+    cp ${desktopItem}/share/applications/*.desktop $out/share/applications
   '';
 
   meta = with lib; {