Merge pull request #230307 from lorenz/wireshark-qt6

wireshark: build with QT 6
This commit is contained in:
Weijia Wang 2023-05-06 21:06:34 +03:00 committed by GitHub
commit 328d7a0df7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,14 +39,14 @@
, makeWrapper
, wrapGAppsHook
, withQt ? true
, qt5 ? null
, qt6 ? null
, ApplicationServices
, SystemConfiguration
, gmp
, asciidoctor
}:
assert withQt -> qt5 != null;
assert withQt -> qt6 != null;
let
version = "4.0.5";
@ -70,6 +70,7 @@ stdenv.mkDerivation {
# Fix `extcap` and `plugins` paths. See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=16444
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DLEMON_C_COMPILER=cc"
"-DUSE_qt6=ON"
] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
"-DHAVE_C99_VSNPRINTF_EXITCODE=0"
"-DHAVE_C99_VSNPRINTF_EXITCODE__TRYRUN_OUTPUT="
@ -79,7 +80,7 @@ stdenv.mkDerivation {
env.NIX_CFLAGS_COMPILE = toString [ "-DQT_NO_DEBUG" ];
nativeBuildInputs = [ asciidoctor bison cmake ninja flex makeWrapper pkg-config python3 perl ]
++ lib.optionals withQt [ qt5.wrapQtAppsHook wrapGAppsHook ];
++ lib.optionals withQt [ qt6.wrapQtAppsHook wrapGAppsHook ];
depsBuildBuild = [ buildPackages.stdenv.cc ];
@ -108,11 +109,10 @@ stdenv.mkDerivation {
c-ares
glib
zlib
] ++ lib.optionals withQt (with qt5; [ qtbase qtmultimedia qtsvg qttools ])
++ lib.optionals (withQt && stdenv.isLinux) [ qt5.qtwayland ]
] ++ lib.optionals withQt (with qt6; [ qtbase qtmultimedia qtsvg qttools qt5compat ])
++ lib.optionals (withQt && stdenv.isLinux) [ qt6.qtwayland ]
++ lib.optionals stdenv.isLinux [ libcap libnl sbc ]
++ lib.optionals stdenv.isDarwin [ SystemConfiguration ApplicationServices gmp ]
++ lib.optionals (withQt && stdenv.isDarwin) (with qt5; [ qtmacextras ]);
++ lib.optionals stdenv.isDarwin [ SystemConfiguration ApplicationServices gmp ];
strictDeps = true;