summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorrnhmjoj <micheleguerinirocco@me.com>2017-03-09 14:46:33 +0100
committerTuomas Tynkkynen <tuomas.tynkkynen@iki.fi>2017-03-09 22:08:33 +0200
commit16651026882e9e6c74d520be386d4eada09fb572 (patch)
tree4f217e6e7372733c2a139e4b101a15e78e39b8c5 /pkgs
parent4c33ea35b70fb222aa61f5f1c50d074b6df3e8fc (diff)
downloadnixlib-16651026882e9e6c74d520be386d4eada09fb572.tar
nixlib-16651026882e9e6c74d520be386d4eada09fb572.tar.gz
nixlib-16651026882e9e6c74d520be386d4eada09fb572.tar.bz2
nixlib-16651026882e9e6c74d520be386d4eada09fb572.tar.lz
nixlib-16651026882e9e6c74d520be386d4eada09fb572.tar.xz
nixlib-16651026882e9e6c74d520be386d4eada09fb572.tar.zst
nixlib-16651026882e9e6c74d520be386d4eada09fb572.zip
ostinato: refactor
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/networking/ostinato/default.nix67
1 files changed, 34 insertions, 33 deletions
diff --git a/pkgs/applications/networking/ostinato/default.nix b/pkgs/applications/networking/ostinato/default.nix
index 941ed60f9aff..41e64d7b721f 100644
--- a/pkgs/applications/networking/ostinato/default.nix
+++ b/pkgs/applications/networking/ostinato/default.nix
@@ -1,17 +1,19 @@
-{ stdenv, fetchgit, fetchurl, writeText
-, qt4, qmake4Hook, protobuf, libpcap
-, wireshark, gzip, diffutils, gawk
+{ stdenv, fetchFromGitHub, fetchurl, qmake4Hook, makeDesktopItem
+, qt4, protobuf, libpcap, wireshark, gzip, diffutils, gawk
 }:
 
 stdenv.mkDerivation rec {
-  name = "ostinato-2015-12-24";
-  src = fetchgit {
-    url = "https://github.com/pstavirs/ostinato.git";
-    rev = "414d89860de0987843295d149bcabeac7c6fd9e5";
-    sha256 = "1yif8z8ih027jdsgnxd82z9914wrqpkpi4xgxqv9lygnb2jjjrdx";
+  name    = "ostinato-${version}";
+  version = "0.8";
+
+  src = fetchFromGitHub  {
+    owner  = "pstavirs";
+    repo   = "ostinato";
+    rev    = "v${version}";
+    sha256 = "1b5a5gypcy9i03mj6md3lkrq05rqmdyhfykrr1z0sv8n3q48xca3";
   };
 
-  ostinato_png = fetchurl {
+  ostinatoIcon = fetchurl {
     url = "http://ostinato.org/images/site-logo.png";
     sha256 = "f5c067823f2934e4d358d76f65a343efd69ad783a7aeabd7ab4ce3cd03490d70";
   };
@@ -22,7 +24,27 @@ stdenv.mkDerivation rec {
 
   patches = [ ./drone_ini.patch ];
 
+  desktopItem = makeDesktopItem {
+    type          = "application";
+    name          = "ostinato";
+    desktopName   = "Ostinato";
+    genericName   = "Packet/Traffic Generator and Analyzer";
+    comment       = "Network packet and traffic generator and analyzer with a friendly GUI";
+    categories    = "Network";
+    terminal      = "false";
+    startupNotify = "true";
+    exec          = "$out/bin/ostinato";
+    icon          =  ostinatoIcon;
+    extraEntries  = ''
+      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/
+
     cat > $out/bin/ostinato.ini <<EOF
     WiresharkPath=${wireshark}/bin/wireshark
     TsharkPath=${wireshark}/bin/tshark
@@ -30,34 +52,13 @@ stdenv.mkDerivation rec {
     DiffPath=${diffutils}/bin/diff
     AwkPath=${gawk}/bin/awk
     EOF
-
-    mkdir -p $out/share/pixmaps
-    cp ${ostinato_png} $out/share/pixmaps/ostinato.png
-
-    # Create a desktop item.
-    mkdir -p $out/share/applications
-    cat > $out/share/applications/ostinato.desktop <<EOF
-    [Desktop Entry]
-    Type=Application
-    Encoding=UTF-8
-    Name=Ostinato
-    GenericName=Packet/Traffic Generator and Analyzer
-    GenericName[it]=Generatore ed Analizzatore di pacchetti di rete
-    Comment=Network packet and traffic generator and analyzer with a friendly GUI
-    Comment[it]=Generatore ed Analizzatore di pacchetti di rete con interfaccia amichevole
-    Icon=$out/share/pixmaps/ostinato.png
-    Exec=$out/bin/ostinato
-    Terminal=false
-    Categories=Network;
-    StartupNotify=true
-    EOF
   '';
 
   meta = with stdenv.lib; {
     description = "A packet traffic generator and analyzer";
-    homepage = http://ostinato.org;
-    license = licenses.gpl3;
+    homepage    = http://ostinato.org;
+    license     = licenses.gpl3;
     maintainers = with maintainers; [ rick68 ];
-    platforms = platforms.linux;  # also OS X and cygwin
+    platforms   = with platforms; linux ++ darwin ++ cygwin;
   };
 }