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.
This commit is contained in:
parent
551c52f1a2
commit
887590e1d2
@ -1,22 +1,21 @@
|
|||||||
{ stdenv, fetchurl, pkgconfig, perl, flex, bison, libpcap, libnl, c-ares
|
{ stdenv, lib, fetchurl, pkgconfig, pcre, perl, flex, bison, gettext, libpcap, libnl, c-ares
|
||||||
, gnutls, libgcrypt, geoip, openssl, lua5, makeDesktopItem, python, libcap, glib
|
, gnutls, libgcrypt, libgpgerror, geoip, openssl, lua5, makeDesktopItem, python, libcap, glib
|
||||||
, zlib
|
, libssh, zlib, cmake, ecm
|
||||||
, withGtk ? false, gtk2 ? null, pango ? null, cairo ? null, gdk_pixbuf ? null
|
, withGtk ? false, gtk3 ? null, pango ? null, cairo ? null, gdk_pixbuf ? null
|
||||||
, withQt ? false, qt4 ? null
|
, withQt ? false, qt5 ? null
|
||||||
, ApplicationServices, SystemConfiguration, gmp
|
, ApplicationServices, SystemConfiguration, gmp
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert withGtk -> !withQt && gtk2 != null;
|
assert withGtk -> !withQt && gtk3 != null;
|
||||||
assert withQt -> !withGtk && qt4 != null;
|
assert withQt -> !withGtk && qt5 != null;
|
||||||
|
|
||||||
with stdenv.lib;
|
with stdenv.lib;
|
||||||
|
|
||||||
let
|
let
|
||||||
version = "2.2.4";
|
version = "2.2.4";
|
||||||
variant = if withGtk then "gtk" else if withQt then "qt" else "cli";
|
variant = if withGtk then "gtk" else if withQt then "qt" else "cli";
|
||||||
in
|
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
in stdenv.mkDerivation {
|
||||||
name = "wireshark-${variant}-${version}";
|
name = "wireshark-${variant}-${version}";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
@ -25,45 +24,35 @@ stdenv.mkDerivation {
|
|||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [
|
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
|
geoip c-ares python glib zlib
|
||||||
] ++ optional withQt qt4
|
] ++ (optionals withQt (with qt5; [ qtbase qtmultimedia qtsvg qttools ]))
|
||||||
++ (optionals withGtk [gtk2 pango cairo gdk_pixbuf])
|
++ (optionals withGtk [ gtk3 pango cairo gdk_pixbuf ])
|
||||||
++ optionals stdenv.isLinux [ libcap libnl ]
|
++ optionals stdenv.isLinux [ libcap libnl ]
|
||||||
++ optionals stdenv.isDarwin [ SystemConfiguration ApplicationServices gmp ];
|
++ optionals stdenv.isDarwin [ SystemConfiguration ApplicationServices gmp ];
|
||||||
|
|
||||||
patches = [ ./wireshark-lookup-dumpcap-in-path.patch ];
|
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");
|
|
||||||
|
|
||||||
desktopItem = makeDesktopItem {
|
|
||||||
name = "Wireshark";
|
|
||||||
exec = "wireshark";
|
|
||||||
icon = "wireshark";
|
|
||||||
comment = "Powerful network protocol analysis suite";
|
|
||||||
desktopName = "Wireshark";
|
|
||||||
genericName = "Network packet analyzer";
|
|
||||||
categories = "Network;System";
|
|
||||||
};
|
|
||||||
|
|
||||||
postInstall = optionalString (withQt || withGtk) ''
|
postInstall = optionalString (withQt || withGtk) ''
|
||||||
mkdir -p "$out"/share/applications/
|
${optionalString withGtk ''
|
||||||
mkdir -p "$out"/share/icons/
|
install -Dm644 -t $out/share/applications ../wireshark-gtk.desktop
|
||||||
cp "$desktopItem/share/applications/"* "$out/share/applications/"
|
''}
|
||||||
cp image/wsicon.svg "$out"/share/icons/wireshark.svg
|
${optionalString withQt ''
|
||||||
|
install -Dm644 -t $out/share/applications ../wireshark.desktop
|
||||||
|
''}
|
||||||
|
|
||||||
|
substituteInPlace $out/share/applications/*.desktop \
|
||||||
|
--replace "Exec=wireshark" "Exec=$out/bin/wireshark"
|
||||||
|
|
||||||
|
install -Dm644 ../image/wsicon.svg $out/share/icons/wireshark.svg
|
||||||
'';
|
'';
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
meta = {
|
meta = with stdenv.lib; {
|
||||||
homepage = http://www.wireshark.org/;
|
homepage = http://www.wireshark.org/;
|
||||||
description = "Powerful network protocol analyzer";
|
description = "Powerful network protocol analyzer";
|
||||||
license = stdenv.lib.licenses.gpl2;
|
license = licenses.gpl2;
|
||||||
|
|
||||||
longDescription = ''
|
longDescription = ''
|
||||||
Wireshark (formerly known as "Ethereal") is a powerful network
|
Wireshark (formerly known as "Ethereal") is a powerful network
|
||||||
@ -71,7 +60,7 @@ stdenv.mkDerivation {
|
|||||||
experts. It runs on UNIX, OS X and Windows.
|
experts. It runs on UNIX, OS X and Windows.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
platforms = stdenv.lib.platforms.unix;
|
platforms = platforms.unix;
|
||||||
maintainers = with stdenv.lib.maintainers; [ bjornfor fpletz ];
|
maintainers = with maintainers; [ bjornfor fpletz ];
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -13273,6 +13273,7 @@ with pkgs;
|
|||||||
withGtk = false;
|
withGtk = false;
|
||||||
inherit (darwin.apple_sdk.frameworks) ApplicationServices SystemConfiguration;
|
inherit (darwin.apple_sdk.frameworks) ApplicationServices SystemConfiguration;
|
||||||
};
|
};
|
||||||
|
# The GTK UI is deprecated by upstream. You probably want the QT version.
|
||||||
wireshark-gtk = wireshark-cli.override { withGtk = true; };
|
wireshark-gtk = wireshark-cli.override { withGtk = true; };
|
||||||
wireshark-qt = wireshark-cli.override { withQt = true; };
|
wireshark-qt = wireshark-cli.override { withQt = true; };
|
||||||
wireshark = wireshark-qt;
|
wireshark = wireshark-qt;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user