mangohud: fix RPATH

Put the path to libXNVCtrl on the RPATH of the MangoHUD binary.
This commit is contained in:
Aidan Gauland 2024-06-03 18:02:28 +12:00
parent 19960c426d
commit 9bf6db2e67
No known key found for this signature in database
GPG Key ID: 16E68DD2D0E77C91

View File

@ -231,8 +231,9 @@ stdenv.mkDerivation (finalAttrs: {
substituteInPlace $out/share/vulkan/implicit_layer.d/MangoHud.${layerPlatform}.json \
--replace "VK_LAYER_MANGOHUD_overlay" "VK_LAYER_MANGOHUD_overlay_${toString stdenv.hostPlatform.parsed.cpu.bits}"
'' + ''
# Add OpenGL driver path to RUNPATH to support NVIDIA cards
# Add OpenGL driver and libXNVCtrl paths to RUNPATH to support NVIDIA cards
addOpenGLRunpath "$out/lib/mangohud/libMangoHud.so"
patchelf --add-rpath ${libXNVCtrl}/lib "$out/lib/mangohud/libMangoHud.so"
'' + lib.optionalString gamescopeSupport ''
addOpenGLRunpath "$out/bin/mangoapp"
'' + lib.optionalString finalAttrs.finalPackage.doCheck ''