2023-03-04 12:18:41 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2023-03-04 16:56:24 +00:00
|
|
|
, fetchFromGitLab
|
2023-10-05 08:51:44 +00:00
|
|
|
|
|
|
|
, ApplicationServices
|
|
|
|
, asciidoctor
|
|
|
|
, bcg729
|
2023-03-04 12:18:41 +00:00
|
|
|
, bison
|
2023-10-05 08:51:44 +00:00
|
|
|
, buildPackages
|
2023-03-04 12:18:41 +00:00
|
|
|
, c-ares
|
2023-10-05 08:51:44 +00:00
|
|
|
, cmake
|
|
|
|
, flex
|
|
|
|
, gettext
|
|
|
|
, glib
|
|
|
|
, gmp
|
2023-03-04 12:18:41 +00:00
|
|
|
, gnutls
|
2023-10-05 08:51:44 +00:00
|
|
|
, libcap
|
2023-03-04 12:18:41 +00:00
|
|
|
, libgcrypt
|
|
|
|
, libgpg-error
|
2023-10-05 08:51:44 +00:00
|
|
|
, libkrb5
|
2023-03-04 17:19:04 +00:00
|
|
|
, libmaxminddb
|
2023-10-05 08:51:44 +00:00
|
|
|
, libnl
|
2023-03-04 17:19:04 +00:00
|
|
|
, libopus
|
2023-10-05 08:51:44 +00:00
|
|
|
, libpcap
|
2023-03-04 17:19:04 +00:00
|
|
|
, libsmi
|
2023-10-05 08:51:44 +00:00
|
|
|
, libssh
|
|
|
|
, lua5
|
2023-03-04 17:19:04 +00:00
|
|
|
, lz4
|
2023-10-05 08:51:44 +00:00
|
|
|
, makeWrapper
|
2023-03-04 17:19:04 +00:00
|
|
|
, minizip
|
2023-03-04 12:18:41 +00:00
|
|
|
, nghttp2
|
2023-11-16 16:48:46 +00:00
|
|
|
, nghttp3
|
2023-03-04 16:56:24 +00:00
|
|
|
, ninja
|
2023-11-16 16:48:46 +00:00
|
|
|
, opencore-amr
|
2023-10-05 08:51:44 +00:00
|
|
|
, openssl
|
|
|
|
, pcre2
|
|
|
|
, perl
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
|
|
|
, sbc
|
|
|
|
, snappy
|
|
|
|
, spandsp3
|
|
|
|
, speexdsp
|
|
|
|
, SystemConfiguration
|
2023-03-04 12:18:41 +00:00
|
|
|
, wrapGAppsHook
|
2023-10-05 08:51:44 +00:00
|
|
|
, zlib
|
|
|
|
, zstd
|
|
|
|
|
2023-03-04 12:18:41 +00:00
|
|
|
, withQt ? true
|
2023-05-06 10:20:38 +00:00
|
|
|
, qt6 ? null
|
2011-11-14 15:11:23 +00:00
|
|
|
}:
|
2007-05-13 23:24:34 +00:00
|
|
|
|
2023-05-06 10:20:38 +00:00
|
|
|
assert withQt -> qt6 != null;
|
2014-09-19 16:49:08 +00:00
|
|
|
|
2023-10-05 08:51:44 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "wireshark-${if withQt then "qt" else "cli"}";
|
2024-04-14 11:02:53 +00:00
|
|
|
version = "4.2.4";
|
2023-10-05 08:51:44 +00:00
|
|
|
|
2018-10-27 11:15:31 +00:00
|
|
|
outputs = [ "out" "dev" ];
|
2011-11-14 15:11:23 +00:00
|
|
|
|
2023-03-04 16:56:24 +00:00
|
|
|
src = fetchFromGitLab {
|
|
|
|
repo = "wireshark";
|
|
|
|
owner = "wireshark";
|
|
|
|
rev = "v${version}";
|
2024-04-14 11:02:53 +00:00
|
|
|
hash = "sha256-yGKqklNy1SkmWOaYI0jsTy2rLq5W/dbh8fIUrBSSdw8=";
|
2011-11-14 15:11:23 +00:00
|
|
|
};
|
|
|
|
|
2023-10-05 08:51:44 +00:00
|
|
|
patches = [
|
2023-11-16 16:48:46 +00:00
|
|
|
./patches/lookup-dumpcap-in-path.patch
|
2018-01-06 04:45:23 +00:00
|
|
|
];
|
2017-08-01 09:40:53 +00:00
|
|
|
|
2023-10-05 08:51:44 +00:00
|
|
|
depsBuildBuild = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
|
|
|
|
buildPackages.stdenv.cc
|
|
|
|
];
|
2017-03-15 21:53:32 +00:00
|
|
|
|
2023-10-05 08:51:44 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
asciidoctor
|
|
|
|
bison
|
|
|
|
cmake
|
|
|
|
flex
|
|
|
|
makeWrapper
|
|
|
|
ninja
|
|
|
|
perl
|
|
|
|
pkg-config
|
|
|
|
python3
|
|
|
|
] ++ lib.optionals withQt [
|
|
|
|
qt6.wrapQtAppsHook
|
|
|
|
wrapGAppsHook
|
|
|
|
];
|
2022-04-05 02:52:26 +00:00
|
|
|
|
2014-01-15 15:44:52 +00:00
|
|
|
buildInputs = [
|
2023-11-16 16:48:22 +00:00
|
|
|
bcg729
|
|
|
|
c-ares
|
2023-03-04 12:18:41 +00:00
|
|
|
gettext
|
2023-11-16 16:48:22 +00:00
|
|
|
glib
|
|
|
|
gnutls
|
2023-03-04 12:18:41 +00:00
|
|
|
libgcrypt
|
|
|
|
libgpg-error
|
2023-11-16 16:48:22 +00:00
|
|
|
libkrb5
|
2023-03-04 17:19:04 +00:00
|
|
|
libmaxminddb
|
|
|
|
libopus
|
2023-11-16 16:48:22 +00:00
|
|
|
libpcap
|
2023-03-04 17:19:04 +00:00
|
|
|
libsmi
|
2023-11-16 16:48:22 +00:00
|
|
|
libssh
|
|
|
|
lua5
|
2023-03-04 17:19:04 +00:00
|
|
|
lz4
|
|
|
|
minizip
|
2023-11-16 16:48:22 +00:00
|
|
|
nghttp2
|
2023-11-16 16:48:46 +00:00
|
|
|
nghttp3
|
|
|
|
opencore-amr
|
2023-11-16 16:48:22 +00:00
|
|
|
openssl
|
|
|
|
pcre2
|
|
|
|
snappy
|
|
|
|
spandsp3
|
|
|
|
speexdsp
|
2023-03-04 12:18:41 +00:00
|
|
|
zlib
|
2023-11-16 16:48:22 +00:00
|
|
|
zstd
|
2023-10-05 08:51:44 +00:00
|
|
|
] ++ lib.optionals withQt (with qt6; [
|
|
|
|
qt5compat
|
|
|
|
qtbase
|
|
|
|
qtmultimedia
|
|
|
|
qtsvg
|
|
|
|
qttools
|
|
|
|
]) ++ lib.optionals (withQt && stdenv.isLinux) [
|
|
|
|
qt6.qtwayland
|
|
|
|
] ++ lib.optionals stdenv.isLinux [
|
|
|
|
libcap
|
|
|
|
libnl
|
|
|
|
sbc
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
ApplicationServices
|
|
|
|
gmp
|
|
|
|
SystemConfiguration
|
|
|
|
];
|
2011-11-14 15:11:23 +00:00
|
|
|
|
2022-04-05 02:52:26 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
2023-10-05 08:51:44 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_wireshark=${if withQt then "ON" else "OFF"}"
|
|
|
|
# Fix `extcap` and `plugins` paths. See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=16444
|
|
|
|
"-DCMAKE_INSTALL_LIBDIR=lib"
|
2023-11-16 16:48:22 +00:00
|
|
|
"-DENABLE_APPLICATION_BUNDLE=${if withQt && stdenv.isDarwin then "ON" else "OFF"}"
|
2023-10-05 08:51:44 +00:00
|
|
|
"-DLEMON_C_COMPILER=cc"
|
|
|
|
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
|
|
|
|
"-DHAVE_C99_VSNPRINTF_EXITCODE__TRYRUN_OUTPUT="
|
2023-11-16 16:48:22 +00:00
|
|
|
"-DHAVE_C99_VSNPRINTF_EXITCODE=0"
|
2023-10-05 08:51:44 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# Avoid referencing -dev paths because of debug assertions.
|
|
|
|
env.NIX_CFLAGS_COMPILE = toString [ "-DQT_NO_DEBUG" ];
|
|
|
|
|
|
|
|
dontFixCmake = true;
|
|
|
|
dontWrapGApps = true;
|
|
|
|
|
|
|
|
shellHook = ''
|
|
|
|
# to be able to run the resulting binary
|
|
|
|
export WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1
|
|
|
|
'';
|
2018-08-17 02:56:36 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
sed -i -e '1i cmake_policy(SET CMP0025 NEW)' CMakeLists.txt
|
|
|
|
'';
|
2014-04-13 15:06:00 +00:00
|
|
|
|
2019-04-08 19:46:15 +00:00
|
|
|
postInstall = ''
|
2023-11-16 16:48:46 +00:00
|
|
|
cmake --install . --prefix "''${!outputDev}" --component Development
|
|
|
|
'' + lib.optionalString (stdenv.isDarwin && withQt) ''
|
2019-04-08 19:46:15 +00:00
|
|
|
mkdir -p $out/Applications
|
|
|
|
mv $out/bin/Wireshark.app $out/Applications/Wireshark.app
|
|
|
|
|
2019-04-08 20:50:42 +00:00
|
|
|
for f in $(find $out/Applications/Wireshark.app/Contents/PlugIns -name "*.so"); do
|
|
|
|
for dylib in $(otool -L $f | awk '/^\t*lib/ {print $1}'); do
|
|
|
|
install_name_tool -change "$dylib" "$out/lib/$dylib" "$f"
|
|
|
|
done
|
2019-04-08 19:46:15 +00:00
|
|
|
done
|
2023-11-16 16:48:46 +00:00
|
|
|
'';
|
2013-05-21 20:48:50 +00:00
|
|
|
|
2022-03-23 11:34:12 +00:00
|
|
|
preFixup = ''
|
|
|
|
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2014-09-19 19:12:14 +00:00
|
|
|
description = "Powerful network protocol analyzer";
|
2011-11-14 15:11:23 +00:00
|
|
|
longDescription = ''
|
2013-05-21 20:48:50 +00:00
|
|
|
Wireshark (formerly known as "Ethereal") is a powerful network
|
2011-11-14 15:11:23 +00:00
|
|
|
protocol analyzer developed by an international team of networking
|
2017-08-06 22:05:18 +00:00
|
|
|
experts. It runs on UNIX, macOS and Windows.
|
2011-11-14 15:11:23 +00:00
|
|
|
'';
|
2023-10-05 08:51:44 +00:00
|
|
|
homepage = "https://www.wireshark.org";
|
|
|
|
changelog = "https://www.wireshark.org/docs/relnotes/wireshark-${version}.html";
|
|
|
|
license = licenses.gpl2Plus;
|
2018-03-01 12:50:20 +00:00
|
|
|
platforms = platforms.linux ++ platforms.darwin;
|
2024-01-13 16:02:09 +00:00
|
|
|
maintainers = with maintainers; [ bjornfor fpletz ];
|
2021-05-23 12:54:17 +00:00
|
|
|
mainProgram = if withQt then "wireshark" else "tshark";
|
2007-05-13 23:24:34 +00:00
|
|
|
};
|
|
|
|
}
|