From a9129be240bc307ad8a4985ad6f6ae13e6bd72c6 Mon Sep 17 00:00:00 2001 From: Grimmauld Date: Thu, 24 Apr 2025 22:41:14 +0200 Subject: [PATCH] mangohud: fix cross build --- pkgs/tools/graphics/mangohud/default.nix | 33 ++++++++++++------------ pkgs/top-level/all-packages.nix | 1 - 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/pkgs/tools/graphics/mangohud/default.nix b/pkgs/tools/graphics/mangohud/default.nix index 379e3cb22a07..cba3c24f70d8 100644 --- a/pkgs/tools/graphics/mangohud/default.nix +++ b/pkgs/tools/graphics/mangohud/default.nix @@ -15,7 +15,7 @@ addDriverRunpath, appstream, glslang, - mako, + python3Packages, meson, ninja, pkg-config, @@ -31,7 +31,7 @@ libXrandr, x11Support ? true, waylandSupport ? true, - nvidiaSupport ? true, + nvidiaSupport ? lib.meta.availableOn stdenv.hostPlatform libXNVCtrl, gamescopeSupport ? true, mangoappSupport ? gamescopeSupport, mangohudctlSupport ? gamescopeSupport, @@ -173,21 +173,17 @@ stdenv.mkDerivation (finalAttrs: { (lib.mesonBool "mangohudctl" mangohudctlSupport) ]; - nativeBuildInputs = - [ - addDriverRunpath - glslang - mako - meson - ninja - pkg-config - unzip - ] - # Only the headers are used from these packages - # The corresponding libraries are loaded at runtime from the app's runpath - ++ lib.optional x11Support libX11 - ++ lib.optional waylandSupport wayland - ++ lib.optional nvidiaSupport libXNVCtrl; + strictDeps = true; + + nativeBuildInputs = [ + addDriverRunpath + glslang + python3Packages.mako + meson + ninja + pkg-config + unzip + ]; buildInputs = [ @@ -195,6 +191,9 @@ stdenv.mkDerivation (finalAttrs: { nlohmann_json spdlog ] + ++ lib.optional waylandSupport wayland + ++ lib.optional x11Support libX11 + ++ lib.optional nvidiaSupport libXNVCtrl ++ lib.optional (x11Support || waylandSupport) libxkbcommon ++ lib.optionals mangoappSupport [ glew diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 54857d8162aa..6bd775b57139 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -4332,7 +4332,6 @@ with pkgs; mangohud = callPackage ../tools/graphics/mangohud { libXNVCtrl = linuxPackages.nvidia_x11.settings.libXNVCtrl; mangohud32 = pkgsi686Linux.mangohud; - inherit (python3Packages) mako; }; marimo = with python3Packages; toPythonApplication marimo;