push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
{
lib,
stdenv,
fetchFromGitHub,
qtbase,
qmake,
qtwayland,
wrapQtAppsHook,
wireshark-cli,
}:
stdenv.mkDerivation {
pname = "qtwirediff";
version = "unstable-2023-03-07";
src = fetchFromGitHub {
owner = "aaptel";
repo = "qtwirediff";
rev = "e0a38180cdf9d94b7535c441487dcefb3a8ec72e";
hash = "sha256-QS4PslSHe2qhxayF7IHvtFASgd4A7vVtSY8tFQ6dqXM=";
};
nativeBuildInputs = [
qmake
wrapQtAppsHook
];
buildInputs = [
qtbase
]
++ lib.optionals stdenv.hostPlatform.isLinux [
qtwayland
];
installPhase = ''
runHook preInstall
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
mkdir -p $out/Applications
cp -r qtwirediff.app $out/Applications
makeWrapper $out/{Applications/qtwirediff.app/Contents/MacOS,bin}/qtwirediff
''
+ lib.optionalString stdenv.hostPlatform.isLinux ''
install -Dm755 -T qtwirediff $out/bin/qtwirediff
wrapProgram $out/bin/qtwirediff \
--prefix PATH : "${lib.makeBinPath [ wireshark-cli ]}"
''
+ ''
runHook postInstall
'';
meta = {
description = "Debugging tool to diff network traffic leveraging Wireshark";
mainProgram = "qtwirediff";
homepage = "https://github.com/aaptel/qtwirediff";
license = lib.licenses.gpl3Plus;
maintainers = [ ];
# error: assignment of member 'trivial' in read-only object
broken = true;
};
}

View File

@@ -0,0 +1,231 @@
{
lib,
stdenv,
fetchFromGitLab,
asciidoctor,
bcg729,
bison,
buildPackages,
c-ares,
cmake,
fixDarwinDylibNames,
flex,
gettext,
glib,
gmp,
gnutls,
libcap,
libgcrypt,
libgpg-error,
libkrb5,
libmaxminddb,
libnl,
libopus,
libpcap,
libsmi,
libssh,
lua5_4,
lz4,
makeWrapper,
minizip,
nghttp2,
nghttp3,
ninja,
opencore-amr,
openssl,
pcre2,
perl,
pkg-config,
python3,
sbc,
snappy,
spandsp3,
speexdsp,
wrapGAppsHook3,
zlib-ng,
zstd,
withQt ? true,
qt6 ? null,
}:
let
isAppBundle = withQt && stdenv.hostPlatform.isDarwin;
in
assert withQt -> qt6 != null;
stdenv.mkDerivation rec {
pname = "wireshark-${if withQt then "qt" else "cli"}";
version = "4.4.9";
outputs = [
"out"
"dev"
];
src = fetchFromGitLab {
repo = "wireshark";
owner = "wireshark";
rev = "v${version}";
hash = "sha256-0+uPXSNabsYNGn+4753WNoUBe9lJ2EH3i3J36lqI4Ak=";
};
patches = [
./patches/lookup-dumpcap-in-path.patch
];
depsBuildBuild = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
buildPackages.stdenv.cc
];
nativeBuildInputs = [
asciidoctor
bison
cmake
flex
makeWrapper
ninja
perl
pkg-config
python3
]
++ lib.optionals withQt [
qt6.wrapQtAppsHook
wrapGAppsHook3
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
fixDarwinDylibNames
];
buildInputs = [
bcg729
c-ares
gettext
glib
gnutls
libgcrypt
libgpg-error
libkrb5
libmaxminddb
libopus
libpcap
libsmi
libssh
lua5_4
lz4
minizip
nghttp2
nghttp3
opencore-amr
openssl
pcre2
snappy
spandsp3
speexdsp
zlib-ng
zstd
]
++ lib.optionals withQt (
with qt6;
[
qt5compat
qtbase
qtmultimedia
qtsvg
qttools
]
)
++ lib.optionals (withQt && stdenv.hostPlatform.isLinux) [
qt6.qtwayland
]
++ lib.optionals stdenv.hostPlatform.isLinux [
libcap
libnl
sbc
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
gmp
];
strictDeps = true;
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"
"-DENABLE_APPLICATION_BUNDLE=${if isAppBundle then "ON" else "OFF"}"
"-DLEMON_C_COMPILER=cc"
]
++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"-DHAVE_C99_VSNPRINTF_EXITCODE__TRYRUN_OUTPUT="
"-DHAVE_C99_VSNPRINTF_EXITCODE=0"
];
# Avoid referencing -dev paths because of debug assertions.
env.NIX_CFLAGS_COMPILE = toString [ "-DQT_NO_DEBUG" ];
dontWrapGApps = true;
shellHook = ''
# to be able to run the resulting binary
export WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1
'';
postPatch = ''
sed -i -e '1i cmake_policy(SET CMP0025 NEW)' CMakeLists.txt
'';
postInstall = ''
cmake --install . --prefix "''${!outputDev}" --component Development
''
+ lib.optionalString isAppBundle ''
mkdir -p $out/Applications
mv $out/bin/Wireshark.app $out/Applications/Wireshark.app
ln -s $out/Applications/Wireshark.app/Contents/MacOS/Wireshark $out/bin/wireshark
''
+ lib.optionalString stdenv.hostPlatform.isDarwin ''
local flags=()
for file in $out/lib/*.dylib; do
flags+=(-change @rpath/"$(basename "$file")" "$file")
done
for file in $out/lib/wireshark/extcap/*; do
if [ -L "$file" ]; then continue; fi
echo "$file: fixing dylib references"
# note that -id does nothing on binaries
install_name_tool -id "$file" "''${flags[@]}" "$file"
done
'';
preFixup = ''
qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
'';
# This is done to remove some binary wrappers that wrapQtApps adds in *.app directories.
# Copying because unfortunately pointing Wireshark (when built as an appbundle) at $out/lib instead is nontrivial.
postFixup = lib.optionalString isAppBundle ''
rm -rf $out/Applications/Wireshark.app/Contents/MacOS/extcap $out/Applications/Wireshark.app/Contents/PlugIns
mkdir -p $out/Applications/Wireshark.app/Contents/PlugIns
cp -r $out/lib/wireshark/plugins $out/Applications/Wireshark.app/Contents/PlugIns/wireshark
cp -r $out/lib/wireshark/extcap $out/Applications/Wireshark.app/Contents/MacOS/extcap
'';
meta = {
description = "Powerful network protocol analyzer";
longDescription = ''
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 = lib.licenses.gpl2Plus;
platforms = lib.platforms.linux ++ lib.platforms.darwin;
maintainers = with lib.maintainers; [
bjornfor
fpletz
];
mainProgram = if withQt then "wireshark" else "tshark";
};
}

View File

@@ -0,0 +1,59 @@
From 2f0cbc740a0fe050f4de082620296c5eea18eba3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com>
Date: Thu, 27 Oct 2022 20:56:07 +0200
Subject: [PATCH] Lookup dumpcap in PATH
NixOS patch: Look for dumpcap in PATH first, because there may be a
dumpcap wrapper that we want to use instead of the default
non-setuid dumpcap binary.
Also change execv() to execvp() because we've set argv[0] to "dumpcap"
and have to enable PATH lookup. Wireshark is not a setuid program, so
looking in PATH is not a security issue.
ORIGINALLY by Björn Forsman
EDITED by teto for wireshark 3.6
EDITED by esclear for wireshark 4.0
EDITED by paveloom for wireshark 4.2
EDITED by pabloaul for wireshark 4.4
Signed-off-by: Franz Pletz <fpletz@fnordicwalking.de>
---
capture/capture_sync.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/capture/capture_sync.c b/capture/capture_sync.c
index 946dc810db..ef0b6e12cd 100644
--- a/capture/capture_sync.c
+++ b/capture/capture_sync.c
@@ -243,8 +243,15 @@ init_pipe_args(int *argc) {
char *exename;
char **argv;
- /* Find the absolute path of the dumpcap executable. */
- exename = get_executable_path("dumpcap");
+ /* NixOS patch: Look for dumpcap in PATH first, because there may be a
+ * dumpcap wrapper that we want to use instead of the default
+ * non-setuid dumpcap binary. */
+ if (system("command -v dumpcap >/dev/null") == 0) {
+ exename = ws_strdup_printf("dumpcap");
+ } else {
+ /* Use dumpcap from the package. */
+ exename = get_executable_path("dumpcap");
+ }
if (exename == NULL) {
return NULL;
}
@@ -596,7 +603,7 @@ sync_pipe_open_command(char **argv, int *data_read_fd,
snprintf(sync_id, ARGV_NUMBER_LEN, "%d", sync_pipe[PIPE_WRITE]);
argv = sync_pipe_add_arg(argv, &argc, sync_id);
#endif
- execv(argv[0], argv);
+ execvp(argv[0], argv);
sync_pipe_write_int_msg(sync_pipe[PIPE_WRITE], SP_EXEC_FAILED, errno);
/* Exit with "_exit()", so that we don't close the connection