···
assert withQt -> qt6 != null;
-
variant = if withQt then "qt" else "cli";
-
pname = "wireshark-${variant}";
outputs = [ "out" "dev" ];
-
hash = "sha256-bNg0yhNb1GRsTclNWWO+Bamm2wOnUjVKU+JftJu+LTo=";
-
"-DBUILD_wireshark=${if withQt then "ON" else "OFF"}"
-
"-DENABLE_APPLICATION_BUNDLE=${if withQt && stdenv.isDarwin then "ON" else "OFF"}"
-
# Fix `extcap` and `plugins` paths. See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=16444
-
"-DCMAKE_INSTALL_LIBDIR=lib"
-
"-DLEMON_C_COMPILER=cc"
-
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
-
"-DHAVE_C99_VSNPRINTF_EXITCODE=0"
-
"-DHAVE_C99_VSNPRINTF_EXITCODE__TRYRUN_OUTPUT="
-
# Avoid referencing -dev paths because of debug assertions.
-
env.NIX_CFLAGS_COMPILE = toString [ "-DQT_NO_DEBUG" ];
-
nativeBuildInputs = [ asciidoctor bison cmake ninja flex makeWrapper pkg-config python3 perl ]
-
++ lib.optionals withQt [ qt6.wrapQtAppsHook wrapGAppsHook ];
-
depsBuildBuild = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ buildPackages.stdenv.cc ];
···
-
] ++ lib.optionals withQt (with qt6; [ qtbase qtmultimedia qtsvg qttools qt5compat ])
-
++ lib.optionals (withQt && stdenv.isLinux) [ qt6.qtwayland ]
-
++ lib.optionals stdenv.isLinux [ libcap libnl sbc ]
-
++ lib.optionals stdenv.isDarwin [ SystemConfiguration ApplicationServices gmp ];
-
patches = [ ./wireshark-lookup-dumpcap-in-path.patch ];
sed -i -e '1i cmake_policy(SET CMP0025 NEW)' CMakeLists.txt
···
cp ../wsutil/wmem/*.h $dev/include/wsutil/wmem/
-
# Prevent double-wrapping, inject wrapper args manually instead.
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
-
# to be able to run the resulting binary
-
export WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1
-
homepage = "https://www.wireshark.org/";
-
changelog = "https://www.wireshark.org/docs/relnotes/wireshark-${version}.html";
description = "Powerful network protocol analyzer";
-
license = licenses.gpl2Plus;
Wireshark (formerly known as "Ethereal") is a powerful network
protocol analyzer developed by an international team of networking
experts. It runs on UNIX, macOS and Windows.
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ bjornfor fpletz paveloom ];
mainProgram = if withQt then "wireshark" else "tshark";
···
assert withQt -> qt6 != null;
+
stdenv.mkDerivation rec {
+
pname = "wireshark-${if withQt then "qt" else "cli"}";
outputs = [ "out" "dev" ];
+
hash = "sha256-R8CoatIZC7vkKn4UZ3G7h5qBexfKMdJJ0swi+IxAjG0=";
+
./wireshark-lookup-dumpcap-in-path.patch
+
depsBuildBuild = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+
buildPackages.stdenv.cc
+
] ++ lib.optionals withQt [
···
+
] ++ lib.optionals withQt (with qt6; [
+
]) ++ lib.optionals (withQt && stdenv.isLinux) [
+
] ++ lib.optionals stdenv.isLinux [
+
] ++ lib.optionals stdenv.isDarwin [
+
"-DBUILD_wireshark=${if withQt then "ON" else "OFF"}"
+
"-DENABLE_APPLICATION_BUNDLE=${if withQt && stdenv.isDarwin then "ON" else "OFF"}"
+
# Fix `extcap` and `plugins` paths. See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=16444
+
"-DCMAKE_INSTALL_LIBDIR=lib"
+
"-DLEMON_C_COMPILER=cc"
+
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+
"-DHAVE_C99_VSNPRINTF_EXITCODE=0"
+
"-DHAVE_C99_VSNPRINTF_EXITCODE__TRYRUN_OUTPUT="
+
# Avoid referencing -dev paths because of debug assertions.
+
env.NIX_CFLAGS_COMPILE = toString [ "-DQT_NO_DEBUG" ];
+
# Prevent double-wrapping, inject wrapper args manually instead.
+
# to be able to run the resulting binary
+
export WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1
sed -i -e '1i cmake_policy(SET CMP0025 NEW)' CMakeLists.txt
···
cp ../wsutil/wmem/*.h $dev/include/wsutil/wmem/
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
description = "Powerful network protocol analyzer";
Wireshark (formerly known as "Ethereal") is a powerful network
protocol analyzer developed by an international team of networking
experts. It runs on UNIX, macOS and Windows.
+
homepage = "https://www.wireshark.org";
+
changelog = "https://www.wireshark.org/docs/relnotes/wireshark-${version}.html";
+
license = licenses.gpl2Plus;
platforms = platforms.linux ++ platforms.darwin;
maintainers = with maintainers; [ bjornfor fpletz paveloom ];
mainProgram = if withQt then "wireshark" else "tshark";