@@ -1,22 +1,21 @@
1−{ stdenv, fetchurl, pkgconfig, perl, flex, bison, libpcap, libnl, c-ares
2−, gnutls, libgcrypt, geoip, openssl, lua5, makeDesktopItem, python, libcap, glib
3−, zlib
4−, withGtk ? false, gtk2 ? null, pango ? null, cairo ? null, gdk_pixbuf ? null
5−, withQt ? false, qt4 ? null
1+{ stdenv, lib, fetchurl, pkgconfig, pcre, perl, flex, bison, gettext, libpcap, libnl, c-ares
2+, gnutls, libgcrypt, libgpgerror, geoip, openssl, lua5, makeDesktopItem, python, libcap, glib
3+, libssh, zlib, cmake, ecm
4+, withGtk ? false, gtk3 ? null, pango ? null, cairo ? null, gdk_pixbuf ? null
5+, withQt ? false, qt5 ? null
66, ApplicationServices, SystemConfiguration, gmp
77}:
88
9−assert withGtk -> !withQt && gtk2 != null;
10−assert withQt -> !withGtk && qt4 != null;
9+assert withGtk -> !withQt && gtk3 != null;
10+assert withQt -> !withGtk && qt5 != null;
1111
1212with stdenv.lib;
1313
1414let
1515 version = "2.2.4";
1616 variant = if withGtk then "gtk" else if withQt then "qt" else "cli";
17−in
1817
19−stdenv.mkDerivation {
18+in stdenv.mkDerivation {
2019 name = "wireshark-${variant}-${version}";
2120
2221 src = fetchurl {
@@ -25,45 +24,35 @@ stdenv.mkDerivation {
2524 };
2625
2726 buildInputs = [
28− bison flex perl pkgconfig libpcap lua5 openssl libgcrypt gnutls
27+ bison cmake ecm flex gettext pcre perl pkgconfig libpcap lua5 libssh openssl libgcrypt libgpgerror gnutls
2928 geoip c-ares python glib zlib
30− ] ++ optional withQt qt4
31− ++ (optionals withGtk [gtk2 pango cairo gdk_pixbuf])
32− ++ optionals stdenv.isLinux [ libcap libnl ]
29+ ] ++ (optionals withQt (with qt5; [ qtbase qtmultimedia qtsvg qttools ]))
30+ ++ (optionals withGtk [ gtk3 pango cairo gdk_pixbuf ])
31+ ++ optionals stdenv.isLinux [ libcap libnl ]
3332 ++ optionals stdenv.isDarwin [ SystemConfiguration ApplicationServices gmp ];
3433
3534 patches = [ ./wireshark-lookup-dumpcap-in-path.patch ];
3635
37− configureFlags = "--disable-usr-local --disable-silent-rules --with-ssl"
38− + (if withGtk then
39− " --with-gtk2 --without-gtk3 --without-qt"
40− else if withQt then
41− " --without-gtk2 --without-gtk3 --with-qt"
42− else " --disable-wireshark");
36+ postInstall = optionalString (withQt || withGtk) ''
37+ ${optionalString withGtk ''
38+ install -Dm644 -t $out/share/applications ../wireshark-gtk.desktop
39+ ''}
40+ ${optionalString withQt ''
41+ install -Dm644 -t $out/share/applications ../wireshark.desktop
42+ ''}
4343
44− desktopItem = makeDesktopItem {
45− name = "Wireshark";
46− exec = "wireshark";
47− icon = "wireshark";
48− comment = "Powerful network protocol analysis suite";
49− desktopName = "Wireshark";
50− genericName = "Network packet analyzer";
51− categories = "Network;System";
52− };
44+ substituteInPlace $out/share/applications/*.desktop \
45+ --replace "Exec=wireshark" "Exec=$out/bin/wireshark"
5346
54− postInstall = optionalString (withQt || withGtk) ''
55− mkdir -p "$out"/share/applications/
56− mkdir -p "$out"/share/icons/
57− cp "$desktopItem/share/applications/"* "$out/share/applications/"
58− cp image/wsicon.svg "$out"/share/icons/wireshark.svg
47+ install -Dm644 ../image/wsicon.svg $out/share/icons/wireshark.svg
5948 '';
6049
6150 enableParallelBuilding = true;
6251
63− meta = {
52+ meta = with stdenv.lib; {
6453 homepage = http://www.wireshark.org/;
6554 description = "Powerful network protocol analyzer";
66− license = stdenv.lib.licenses.gpl2;
55+ license = licenses.gpl2;
6756
6857 longDescription = ''
6958 Wireshark (formerly known as "Ethereal") is a powerful network
@@ -71,7 +60,7 @@ stdenv.mkDerivation {
7160 experts. It runs on UNIX, OS X and Windows.
7261 '';
7362
74− platforms = stdenv.lib.platforms.unix;
75− maintainers = with stdenv.lib.maintainers; [ bjornfor fpletz ];
63+ platforms = platforms.unix;
64+ maintainers = with maintainers; [ bjornfor fpletz ];
7665 };
7766}