about summary refs log tree commit diff
path: root/pkgs/applications/networking/ostinato
diff options
context:
space:
mode:
authorRobert Schütz <nix@dotlambda.de>2022-05-25 20:32:28 +0000
committerRobert Schütz <nix@dotlambda.de>2022-05-25 20:46:56 +0000
commitdcd7915d177acd0ce63ef3b54fe61d23c6733e0f (patch)
tree15c106d98893490830816610b8756c2ef0be1ba0 /pkgs/applications/networking/ostinato
parent37b04e54e3dabcb7b27a0cf81ea231bd52c719ce (diff)
ostinato: fix desktop file
Diffstat (limited to 'pkgs/applications/networking/ostinato')
-rw-r--r--pkgs/applications/networking/ostinato/default.nix22
1 files changed, 13 insertions, 9 deletions
diff --git a/pkgs/applications/networking/ostinato/default.nix b/pkgs/applications/networking/ostinato/default.nix
index 45307504d7318..b3ff51ab7c190 100644
--- a/pkgs/applications/networking/ostinato/default.nix
+++ b/pkgs/applications/networking/ostinato/default.nix
@@ -1,6 +1,7 @@
 { lib, mkDerivation, fetchFromGitHub, fetchurl, qmake, makeDesktopItem
 , qtbase, qtscript, protobuf, libpcap, wireshark, gzip, diffutils, gawk
 , libnl
+, copyDesktopItems
 }:
 
 mkDerivation rec {
@@ -21,31 +22,34 @@ mkDerivation rec {
 
   buildInputs = [ qtbase protobuf libpcap qtscript libnl ];
 
-  nativeBuildInputs = [ qmake ];
+  nativeBuildInputs = [
+    copyDesktopItems
+    qmake
+  ];
 
   patches = [ ./drone_ini.patch ];
   prePatch = ''
     sed -i 's|/usr/include/libnl3|${libnl.dev}/include/libnl3|' server/drone.pro
   '';
 
-  desktopItem = makeDesktopItem {
+  desktopItems = lib.singleton (makeDesktopItem {
     name          = "ostinato";
     desktopName   = "Ostinato";
     genericName   = "Packet/Traffic Generator and Analyzer";
     comment       = "Network packet and traffic generator and analyzer with a friendly GUI";
     categories    = [ "Network" ];
     startupNotify = true;
-    exec          = "$out/bin/ostinato";
+    exec          = "@out@/bin/ostinato";
     icon          =  ostinatoIcon;
     extraConfig   = {
       "GenericName[it]" = "Generatore ed Analizzatore di pacchetti di rete";
       "Comment[it]"     = "Generatore ed Analizzatore di pacchetti di rete con interfaccia amichevole";
     };
-  };
+  });
 
-  postInstall = ''
-    mkdir -p $out/share/applications
-    ln -s ${desktopItem}/share/applications/* $out/share/applications/
+  preFixup = ''
+    substituteInPlace $out/share/applications/ostinato.desktop \
+      --subst-var out
 
     cat > $out/bin/ostinato.ini <<EOF
     WiresharkPath=${wireshark}/bin/wireshark
@@ -62,8 +66,8 @@ mkDerivation rec {
 
   meta = with lib; {
     description = "A packet traffic generator and analyzer";
-    homepage    = "https://ostinato.org";
-    license     = licenses.gpl3;
+    homepage    = "https://ostinato.org/";
+    license     = licenses.gpl3Plus;
     maintainers = with maintainers; [ rick68 ];
     platforms   = with platforms; linux ++ darwin ++ cygwin;
   };