wireshark: add CLI and Qt versions
In addition to our existing GTK version. * Only install desktop file if building a GUI version. * The Qt build appends "-qt" to the wireshark binary name. Undo it so the desktop file works. * The 'wireshark' attribute still refers to the GTK version, for backwards compatibility.
This commit is contained in:
parent
1daa2e5a7e
commit
8983b60f87
@ -1,12 +1,21 @@
|
|||||||
{ stdenv, fetchurl, pkgconfig, perl, flex, bison, libpcap, libnl, c-ares
|
{ stdenv, fetchurl, pkgconfig, perl, flex, bison, libpcap, libnl, c-ares
|
||||||
, gnutls, libgcrypt, geoip, heimdal, lua5, gtk, makeDesktopItem, python
|
, gnutls, libgcrypt, geoip, heimdal, lua5, makeDesktopItem, python, libcap, glib
|
||||||
, libcap
|
, withGtk ? false, gtk ? null
|
||||||
|
, withQt ? false, qt4 ? null
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let version = "1.12.1"; in
|
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
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
stdenv.mkDerivation {
|
||||||
name = "wireshark-${version}";
|
name = "wireshark-${variant}-${version}";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "http://www.wireshark.org/download/src/wireshark-${version}.tar.bz2";
|
url = "http://www.wireshark.org/download/src/wireshark-${version}.tar.bz2";
|
||||||
@ -15,12 +24,18 @@ stdenv.mkDerivation {
|
|||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
bison flex perl pkgconfig libpcap lua5 heimdal libgcrypt gnutls
|
bison flex perl pkgconfig libpcap lua5 heimdal libgcrypt gnutls
|
||||||
geoip libnl c-ares gtk python libcap
|
geoip libnl c-ares python libcap glib
|
||||||
];
|
] ++ optional withQt qt4
|
||||||
|
++ optional withGtk gtk;
|
||||||
|
|
||||||
patches = [ ./wireshark-lookup-dumpcap-in-path.patch ];
|
patches = [ ./wireshark-lookup-dumpcap-in-path.patch ];
|
||||||
|
|
||||||
configureFlags = "--disable-usr-local --disable-silent-rules --with-gtk2 --without-gtk3 --without-qt --with-ssl";
|
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 {
|
desktopItem = makeDesktopItem {
|
||||||
name = "Wireshark";
|
name = "Wireshark";
|
||||||
@ -32,11 +47,13 @@ stdenv.mkDerivation {
|
|||||||
categories = "Network;System";
|
categories = "Network;System";
|
||||||
};
|
};
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = optionalString (withQt || withGtk) ''
|
||||||
mkdir -p "$out"/share/applications/
|
mkdir -p "$out"/share/applications/
|
||||||
mkdir -p "$out"/share/icons/
|
mkdir -p "$out"/share/icons/
|
||||||
cp "$desktopItem/share/applications/"* "$out/share/applications/"
|
cp "$desktopItem/share/applications/"* "$out/share/applications/"
|
||||||
cp image/wsicon.svg "$out"/share/icons/wireshark.svg
|
cp image/wsicon.svg "$out"/share/icons/wireshark.svg
|
||||||
|
'' + optionalString withQt ''
|
||||||
|
mv "$out/bin/wireshark-qt" "$out/bin/wireshark"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
@ -8983,7 +8983,13 @@ let
|
|||||||
|
|
||||||
wavesurfer = callPackage ../applications/misc/audio/wavesurfer { };
|
wavesurfer = callPackage ../applications/misc/audio/wavesurfer { };
|
||||||
|
|
||||||
wireshark = callPackage ../applications/networking/sniffers/wireshark { };
|
wireshark-cli = callPackage ../applications/networking/sniffers/wireshark {
|
||||||
|
withQt = false;
|
||||||
|
withGtk = false;
|
||||||
|
};
|
||||||
|
wireshark-gtk = wireshark-cli.override { withGtk = true; };
|
||||||
|
wireshark-qt = wireshark-cli.override { withQt = true; };
|
||||||
|
wireshark = wireshark-gtk;
|
||||||
|
|
||||||
wvdial = callPackage ../os-specific/linux/wvdial { };
|
wvdial = callPackage ../os-specific/linux/wvdial { };
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user