From 59d06e482608eeaf1eda9281be22bfdaa72a47bc Mon Sep 17 00:00:00 2001 From: squalus Date: Mon, 4 Apr 2022 19:52:26 -0700 Subject: [PATCH] wireshark-cli: support cross compile --- .../networking/sniffers/wireshark/default.nix | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/networking/sniffers/wireshark/default.nix b/pkgs/applications/networking/sniffers/wireshark/default.nix index 468a06af2091..0947686144e5 100644 --- a/pkgs/applications/networking/sniffers/wireshark/default.nix +++ b/pkgs/applications/networking/sniffers/wireshark/default.nix @@ -1,4 +1,4 @@ -{ lib, stdenv, fetchurl, pkg-config, pcre, perl, flex, bison, gettext, libpcap, libnl, c-ares +{ lib, stdenv, buildPackages, 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, wrapGAppsHook , withQt ? true, qt5 ? null @@ -29,22 +29,30 @@ in stdenv.mkDerivation { "-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. NIX_CFLAGS_COMPILE = [ "-DQT_NO_DEBUG" ]; - nativeBuildInputs = [ asciidoctor bison cmake flex makeWrapper pkg-config ] + nativeBuildInputs = [ asciidoctor bison cmake flex makeWrapper pkg-config python3 perl ] ++ optionals withQt [ qt5.wrapQtAppsHook wrapGAppsHook ]; + depsBuildBuild = [ buildPackages.stdenv.cc ]; + buildInputs = [ - gettext pcre perl libpcap lua5 libssh nghttp2 openssl libgcrypt - libgpg-error gnutls geoip c-ares python3 glib zlib + gettext pcre libpcap lua5 libssh nghttp2 openssl libgcrypt + libgpg-error gnutls geoip c-ares glib zlib ] ++ optionals withQt (with qt5; [ qtbase qtmultimedia qtsvg qttools ]) ++ optionals stdenv.isLinux [ libcap libnl ] ++ optionals stdenv.isDarwin [ SystemConfiguration ApplicationServices gmp ] ++ optionals (withQt && stdenv.isDarwin) (with qt5; [ qtmacextras ]); + strictDeps = true; + patches = [ ./wireshark-lookup-dumpcap-in-path.patch ]; postPatch = ''