about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/networking/ostinato
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:36 +0000
committerAlyssa Ross <hi@alyssa.is>2019-01-07 02:18:47 +0000
commit36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2 (patch)
treeb3faaf573407b32aa645237a4d16b82778a39a92 /nixpkgs/pkgs/applications/networking/ostinato
parent4e31070265257dc67d120c27e0f75c2344fdfa9a (diff)
parentabf060725d7614bd3b9f96764262dfbc2f9c2199 (diff)
downloadnixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.gz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.bz2
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.lz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.xz
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.tar.zst
nixlib-36f56d99fa0a0765c9f1de4a5f17a9b05830c3f2.zip
Add 'nixpkgs/' from commit 'abf060725d7614bd3b9f96764262dfbc2f9c2199'
git-subtree-dir: nixpkgs
git-subtree-mainline: 4e31070265257dc67d120c27e0f75c2344fdfa9a
git-subtree-split: abf060725d7614bd3b9f96764262dfbc2f9c2199
Diffstat (limited to 'nixpkgs/pkgs/applications/networking/ostinato')
-rw-r--r--nixpkgs/pkgs/applications/networking/ostinato/default.nix68
-rw-r--r--nixpkgs/pkgs/applications/networking/ostinato/drone_ini.patch14
2 files changed, 82 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/networking/ostinato/default.nix b/nixpkgs/pkgs/applications/networking/ostinato/default.nix
new file mode 100644
index 000000000000..962f10a99c01
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/ostinato/default.nix
@@ -0,0 +1,68 @@
+{ stdenv, fetchFromGitHub, fetchurl, qmake4Hook, makeDesktopItem
+, qt4, protobuf, libpcap, wireshark, gzip, diffutils, gawk
+}:
+
+stdenv.mkDerivation rec {
+  name    = "ostinato-${version}";
+  version = "0.9";
+
+  src = fetchFromGitHub  {
+    owner  = "pstavirs";
+    repo   = "ostinato";
+    rev    = "v${version}";
+    sha256 = "109gxj6djdsk7rp1nxpx39kfi75xfl9p9qgffh1cpcdpbsbvq5bx";
+  };
+
+  ostinatoIcon = fetchurl {
+    url = "https://ostinato.org/images/site-logo.png";
+    sha256 = "f5c067823f2934e4d358d76f65a343efd69ad783a7aeabd7ab4ce3cd03490d70";
+  };
+
+  buildInputs = [ qt4 protobuf libpcap ];
+
+  nativeBuildInputs = [ qmake4Hook ];
+
+  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
+    GzipPath=${gzip}/bin/gzip
+    DiffPath=${diffutils}/bin/diff
+    AwkPath=${gawk}/bin/awk
+    EOF
+  '';
+
+  # `cd common; qmake ostproto.pro; make pdmlreader.o`:
+  # pdmlprotocol.h:23:25: fatal error: protocol.pb.h: No such file or directory
+  enableParallelBuilding = false;
+
+  meta = with stdenv.lib; {
+    description = "A packet traffic generator and analyzer";
+    homepage    = https://ostinato.org;
+    license     = licenses.gpl3;
+    maintainers = with maintainers; [ rick68 ];
+    platforms   = with platforms; linux ++ darwin ++ cygwin;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/networking/ostinato/drone_ini.patch b/nixpkgs/pkgs/applications/networking/ostinato/drone_ini.patch
new file mode 100644
index 000000000000..5818f4e94c30
--- /dev/null
+++ b/nixpkgs/pkgs/applications/networking/ostinato/drone_ini.patch
@@ -0,0 +1,14 @@
+diff -Nru ostinato-414d89860de0987843295d149bcabeac7c6fd9e5/server/drone_main.cpp ostinato-414d89860de0987843295d149bcabeac7c6fd9e5.new/server/drone_main.cpp
+--- ostinato-414d89860de0987843295d149bcabeac7c6fd9e5/server/drone_main.cpp	2015-12-24 16:46:35.000000000 +0800
++++ ostinato-414d89860de0987843295d149bcabeac7c6fd9e5.new/server/drone_main.cpp	2015-12-30 20:59:04.319199699 +0800
+@@ -62,8 +62,8 @@
+     /* (Portable Mode) If we have a .ini file in the same directory as the 
+        executable, we use that instead of the platform specific location
+        and format for the settings */
+-    QString portableIni = QCoreApplication::applicationDirPath() 
+-            + "/drone.ini";
++    QString portableIni = argc > 2 ? argv[2] :
++            QCoreApplication::applicationDirPath() + "/drone.ini";
+     if (QFile::exists(portableIni))
+         appSettings = new QSettings(portableIni, QSettings::IniFormat);
+     else