summary refs log tree commit diff
path: root/pkgs/applications/networking/sniffers/wireshark
diff options
context:
space:
mode:
authorPeter Hoeg <peter@speartail.com>2017-01-31 18:41:23 +0800
committerBjørn Forsman <bjorn.forsman@gmail.com>2017-01-31 21:20:12 +0100
commit887590e1d260bb5fba8ca1c5861d69b5987723ab (patch)
tree9e95be6cb0d75fad2ae93f1e4a25881c2f395694 /pkgs/applications/networking/sniffers/wireshark
parent551c52f1a24e20fb66546229c4a819cfbe806504 (diff)
downloadnixlib-887590e1d260bb5fba8ca1c5861d69b5987723ab.tar
nixlib-887590e1d260bb5fba8ca1c5861d69b5987723ab.tar.gz
nixlib-887590e1d260bb5fba8ca1c5861d69b5987723ab.tar.bz2
nixlib-887590e1d260bb5fba8ca1c5861d69b5987723ab.tar.lz
nixlib-887590e1d260bb5fba8ca1c5861d69b5987723ab.tar.xz
nixlib-887590e1d260bb5fba8ca1c5861d69b5987723ab.tar.zst
nixlib-887590e1d260bb5fba8ca1c5861d69b5987723ab.zip
wireshark: use cmake and move to gtk3/qt5
wireshark used to use autotools, but instead we now use cmake. The
change alone brought to light a few missing required dependencies.

Additionally, wireshark was using gtk2 and qt4, so that has changed to
gtk3 and qt5.
Diffstat (limited to 'pkgs/applications/networking/sniffers/wireshark')
-rw-r--r--pkgs/applications/networking/sniffers/wireshark/default.nix63
1 files changed, 26 insertions, 37 deletions
diff --git a/pkgs/applications/networking/sniffers/wireshark/default.nix b/pkgs/applications/networking/sniffers/wireshark/default.nix
index 56fe9859caa5..d3c3b2786070 100644
--- a/pkgs/applications/networking/sniffers/wireshark/default.nix
+++ b/pkgs/applications/networking/sniffers/wireshark/default.nix
@@ -1,22 +1,21 @@
-{ stdenv, fetchurl, pkgconfig, perl, flex, bison, libpcap, libnl, c-ares
-, gnutls, libgcrypt, geoip, openssl, lua5, makeDesktopItem, python, libcap, glib
-, zlib
-, withGtk ? false, gtk2 ? null, pango ? null, cairo ? null, gdk_pixbuf ? null
-, withQt ? false, qt4 ? null
+{ stdenv, lib, fetchurl, pkgconfig, pcre, perl, flex, bison, gettext, libpcap, libnl, c-ares
+, gnutls, libgcrypt, libgpgerror, geoip, openssl, lua5, makeDesktopItem, python, libcap, glib
+, libssh, zlib, cmake, ecm
+, withGtk ? false, gtk3 ? null, pango ? null, cairo ? null, gdk_pixbuf ? null
+, withQt ? false, qt5 ? null
 , ApplicationServices, SystemConfiguration, gmp
 }:
 
-assert withGtk -> !withQt && gtk2 != null;
-assert withQt -> !withGtk && qt4 != null;
+assert withGtk -> !withQt  && gtk3 != null;
+assert withQt  -> !withGtk && qt5  != null;
 
 with stdenv.lib;
 
 let
   version = "2.2.4";
   variant = if withGtk then "gtk" else if withQt then "qt" else "cli";
-in
 
-stdenv.mkDerivation {
+in stdenv.mkDerivation {
   name = "wireshark-${variant}-${version}";
 
   src = fetchurl {
@@ -25,45 +24,35 @@ stdenv.mkDerivation {
   };
 
   buildInputs = [
-    bison flex perl pkgconfig libpcap lua5 openssl libgcrypt gnutls
+    bison cmake ecm flex gettext pcre perl pkgconfig libpcap lua5 libssh openssl libgcrypt libgpgerror gnutls
     geoip c-ares python glib zlib
-  ] ++ optional withQt qt4
-    ++ (optionals withGtk [gtk2 pango cairo gdk_pixbuf])
-    ++ optionals stdenv.isLinux [ libcap libnl ]
+  ] ++ (optionals withQt  (with qt5; [ qtbase qtmultimedia qtsvg qttools ]))
+    ++ (optionals withGtk [ gtk3 pango cairo gdk_pixbuf ])
+    ++ optionals stdenv.isLinux  [ libcap libnl ]
     ++ optionals stdenv.isDarwin [ SystemConfiguration ApplicationServices gmp ];
 
   patches = [ ./wireshark-lookup-dumpcap-in-path.patch ];
 
-  configureFlags = "--disable-usr-local --disable-silent-rules --with-ssl"
-    + (if withGtk then
-         " --with-gtk2 --without-gtk3 --without-qt"
-       else if withQt then
-         " --without-gtk2 --without-gtk3 --with-qt"
-       else " --disable-wireshark");
+  postInstall = optionalString (withQt || withGtk) ''
+    ${optionalString withGtk ''
+      install -Dm644 -t $out/share/applications ../wireshark-gtk.desktop
+    ''}
+    ${optionalString withQt ''
+      install -Dm644 -t $out/share/applications ../wireshark.desktop
+    ''}
 
-  desktopItem = makeDesktopItem {
-    name = "Wireshark";
-    exec = "wireshark";
-    icon = "wireshark";
-    comment = "Powerful network protocol analysis suite";
-    desktopName = "Wireshark";
-    genericName = "Network packet analyzer";
-    categories = "Network;System";
-  };
+    substituteInPlace $out/share/applications/*.desktop \
+      --replace "Exec=wireshark" "Exec=$out/bin/wireshark"
 
-  postInstall = optionalString (withQt || withGtk) ''
-    mkdir -p "$out"/share/applications/
-    mkdir -p "$out"/share/icons/
-    cp "$desktopItem/share/applications/"* "$out/share/applications/"
-    cp image/wsicon.svg "$out"/share/icons/wireshark.svg
+    install -Dm644 ../image/wsicon.svg $out/share/icons/wireshark.svg
   '';
 
   enableParallelBuilding = true;
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://www.wireshark.org/;
     description = "Powerful network protocol analyzer";
-    license = stdenv.lib.licenses.gpl2;
+    license = licenses.gpl2;
 
     longDescription = ''
       Wireshark (formerly known as "Ethereal") is a powerful network
@@ -71,7 +60,7 @@ stdenv.mkDerivation {
       experts. It runs on UNIX, OS X and Windows.
     '';
 
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ bjornfor fpletz ];
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ bjornfor fpletz ];
   };
 }