From 76834c2bad2639fd96bb58442396e57b737b635a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gy=C3=B6rgy=20Kurucz?= Date: Thu, 19 Dec 2024 22:15:08 +0100 Subject: [PATCH] apitrace: add enableGui option The motivation for this change is to be able to cross-compile apitrace, at least without the GUI. Fixing GUI cross-compilation is blocked by Note that we also move `python3` into `nativeBuildInputs`, which is also required to make cross-compilation work. --- pkgs/applications/graphics/apitrace/default.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/graphics/apitrace/default.nix b/pkgs/applications/graphics/apitrace/default.nix index 0aa3f79b001d..604f4a2393a5 100644 --- a/pkgs/applications/graphics/apitrace/default.nix +++ b/pkgs/applications/graphics/apitrace/default.nix @@ -13,6 +13,7 @@ libglvnd, gtest, brotli, + enableGui ? true, }: stdenv.mkDerivation rec { @@ -32,19 +33,25 @@ stdenv.mkDerivation rec { buildInputs = [ libX11 procps - python3 libdwarf - qtbase gtest brotli + ] ++ lib.optionals enableGui [ + qtbase ]; nativeBuildInputs = [ cmake pkg-config + python3 + ] ++ lib.optionals enableGui [ wrapQtAppsHook ]; + cmakeFlags = [ + (lib.cmakeBool "ENABLE_GUI" enableGui) + ]; + # Don't automatically wrap all binaries, I prefer to explicitly only wrap # `qapitrace`. dontWrapQtApps = true; @@ -83,6 +90,7 @@ stdenv.mkDerivation rec { patchelf --set-rpath "${lib.makeLibraryPath [ libglvnd ]}:$(patchelf --print-rpath $i)" $i done + '' + lib.optionalString enableGui '' wrapQtApp $out/bin/qapitrace '';