2014-01-17 10:37:53 +01:00
|
|
|
{ stdenv, fetchurl, pkgconfig, perl, flex, bison, libpcap, libnl, c-ares
|
2014-09-19 18:49:08 +02:00
|
|
|
, gnutls, libgcrypt, geoip, heimdal, lua5, makeDesktopItem, python, libcap, glib
|
|
|
|
, withGtk ? false, gtk ? null
|
|
|
|
, withQt ? false, qt4 ? null
|
2011-11-14 16:11:23 +01:00
|
|
|
}:
|
2007-05-14 01:24:34 +02:00
|
|
|
|
2014-09-19 18:49:08 +02:00
|
|
|
assert withGtk -> !withQt && gtk != null;
|
|
|
|
assert withQt -> !withGtk && qt4 != null;
|
|
|
|
|
|
|
|
with stdenv.lib;
|
|
|
|
|
|
|
|
let
|
|
|
|
version = "1.12.1";
|
|
|
|
variant = if withGtk then "gtk" else if withQt then "qt" else "cli";
|
|
|
|
in
|
2013-02-27 15:07:28 +01:00
|
|
|
|
2011-11-14 16:11:23 +01:00
|
|
|
stdenv.mkDerivation {
|
2014-09-19 18:49:08 +02:00
|
|
|
name = "wireshark-${variant}-${version}";
|
2011-11-14 16:11:23 +01:00
|
|
|
|
2007-05-14 01:24:34 +02:00
|
|
|
src = fetchurl {
|
2014-09-19 17:44:28 +02:00
|
|
|
url = "http://www.wireshark.org/download/src/wireshark-${version}.tar.bz2";
|
|
|
|
sha256 = "0jsqpr4s5smadvlm881l8fkhhw384ak3apkq4wxr05gc2va6pcl2";
|
2011-11-14 16:11:23 +01:00
|
|
|
};
|
|
|
|
|
2014-01-15 16:44:52 +01:00
|
|
|
buildInputs = [
|
|
|
|
bison flex perl pkgconfig libpcap lua5 heimdal libgcrypt gnutls
|
2014-09-19 18:49:08 +02:00
|
|
|
geoip libnl c-ares python libcap glib
|
|
|
|
] ++ optional withQt qt4
|
|
|
|
++ optional withGtk gtk;
|
2011-11-14 16:11:23 +01:00
|
|
|
|
2014-04-13 17:06:00 +02:00
|
|
|
patches = [ ./wireshark-lookup-dumpcap-in-path.patch ];
|
|
|
|
|
2014-09-19 18:49:08 +02:00
|
|
|
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");
|
2011-11-14 16:11:23 +01:00
|
|
|
|
2013-05-21 22:48:50 +02:00
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
name = "Wireshark";
|
|
|
|
exec = "wireshark";
|
|
|
|
icon = "wireshark";
|
|
|
|
comment = "Powerful network protocol analysis suite";
|
|
|
|
desktopName = "Wireshark";
|
|
|
|
genericName = "Network packet analyzer";
|
|
|
|
categories = "Network;System";
|
|
|
|
};
|
|
|
|
|
2014-09-19 18:49:08 +02:00
|
|
|
postInstall = optionalString (withQt || withGtk) ''
|
2013-05-21 22:48:50 +02:00
|
|
|
mkdir -p "$out"/share/applications/
|
|
|
|
mkdir -p "$out"/share/icons/
|
2014-01-15 16:44:52 +01:00
|
|
|
cp "$desktopItem/share/applications/"* "$out/share/applications/"
|
2013-05-21 22:48:50 +02:00
|
|
|
cp image/wsicon.svg "$out"/share/icons/wireshark.svg
|
2014-09-19 18:49:08 +02:00
|
|
|
'' + optionalString withQt ''
|
|
|
|
mv "$out/bin/wireshark-qt" "$out/bin/wireshark"
|
2013-05-21 22:48:50 +02:00
|
|
|
'';
|
|
|
|
|
2014-01-17 11:10:58 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2011-11-14 16:11:23 +01:00
|
|
|
meta = {
|
2013-05-11 20:30:41 +02:00
|
|
|
homepage = http://www.wireshark.org/;
|
2014-09-19 21:12:14 +02:00
|
|
|
description = "Powerful network protocol analyzer";
|
2011-11-14 16:11:23 +01:00
|
|
|
license = stdenv.lib.licenses.gpl2;
|
|
|
|
|
|
|
|
longDescription = ''
|
2013-05-21 22:48:50 +02:00
|
|
|
Wireshark (formerly known as "Ethereal") is a powerful network
|
2011-11-14 16:11:23 +01:00
|
|
|
protocol analyzer developed by an international team of networking
|
|
|
|
experts. It runs on UNIX, OS X and Windows.
|
|
|
|
'';
|
|
|
|
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
2014-04-20 19:03:05 +02:00
|
|
|
maintainers = with stdenv.lib.maintainers; [ simons bjornfor ];
|
2007-05-14 01:24:34 +02:00
|
|
|
};
|
|
|
|
}
|