@@ -1,6 +1,6 @@
11{ lib, stdenv, fetchurl, pkg-config, pcre, perl, flex, bison, gettext, libpcap, libnl, c-ares
22, gnutls, libgcrypt, libgpg-error, geoip, openssl, lua5, python3, libcap, glib
3−, libssh, nghttp2, zlib, cmake, makeWrapper
3+, libssh, nghttp2, zlib, cmake, makeWrapper, wrapGAppsHook
44, withQt ? true, qt5 ? null
55, ApplicationServices, SystemConfiguration, gmp
66, asciidoctor
@@ -34,7 +34,8 @@ in stdenv.mkDerivation {
3434 # Avoid referencing -dev paths because of debug assertions.
3535 NIX_CFLAGS_COMPILE = [ "-DQT_NO_DEBUG" ];
3636
37− nativeBuildInputs = [ asciidoctor bison cmake flex makeWrapper pkg-config ] ++ optional withQt qt5.wrapQtAppsHook;
37+ nativeBuildInputs = [ asciidoctor bison cmake flex makeWrapper pkg-config ]
38+ ++ optionals withQt [ qt5.wrapQtAppsHook wrapGAppsHook ];
3839
3940 buildInputs = [
4041 gettext pcre perl libpcap lua5 libssh nghttp2 openssl libgcrypt
@@ -85,6 +86,12 @@ in stdenv.mkDerivation {
8586
8687 dontFixCmake = true;
8788
89+ # Prevent double-wrapping, inject wrapper args manually instead.
90+ dontWrapGApps = true;
91+ preFixup = ''
92+ qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
93+ '';
94+
8895 shellHook = ''
8996 # to be able to run the resulting binary
9097 export WIRESHARK_RUN_FROM_BUILD_DIRECTORY=1