From 61afa3e16b1e7c0cafe9dbce8cbc7b919f1a1a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Wed, 23 Mar 2022 12:34:12 +0100 Subject: [PATCH] wireshark: add wrapGAppsHook This fixes using the file chooser on non-NixOS: (wireshark:28052): GLib-GIO-ERROR **: 12:10:03.798: Settings schema 'org.gtk.Settings.FileChooser' does not contain a key named 'show-type-column' --- .../networking/sniffers/wireshark/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/sniffers/wireshark/default.nix b/pkgs/applications/networking/sniffers/wireshark/default.nix index 931606f32489..468a06af2091 100644 --- a/pkgs/applications/networking/sniffers/wireshark/default.nix +++ b/pkgs/applications/networking/sniffers/wireshark/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, fetchurl, pkg-config, pcre, perl, flex, bison, gettext, libpcap, libnl, c-ares , gnutls, libgcrypt, libgpg-error, geoip, openssl, lua5, python3, libcap, glib -, libssh, nghttp2, zlib, cmake, makeWrapper +, libssh, nghttp2, zlib, cmake, makeWrapper, wrapGAppsHook , withQt ? true, qt5 ? null , ApplicationServices, SystemConfiguration, gmp , asciidoctor @@ -34,7 +34,8 @@ in stdenv.mkDerivation { # Avoid referencing -dev paths because of debug assertions. NIX_CFLAGS_COMPILE = [ "-DQT_NO_DEBUG" ]; - nativeBuildInputs = [ asciidoctor bison cmake flex makeWrapper pkg-config ] ++ optional withQt qt5.wrapQtAppsHook; + nativeBuildInputs = [ asciidoctor bison cmake flex makeWrapper pkg-config ] + ++ optionals withQt [ qt5.wrapQtAppsHook wrapGAppsHook ]; buildInputs = [ gettext pcre perl libpcap lua5 libssh nghttp2 openssl libgcrypt @@ -85,6 +86,12 @@ in stdenv.mkDerivation { dontFixCmake = true; + # Prevent double-wrapping, inject wrapper args manually instead. + dontWrapGApps = true; + preFixup = '' + qtWrapperArgs+=("''${gappsWrapperArgs[@]}") + ''; + shellHook = '' # to be able to run the resulting binary export WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1