fix: re-add LD_LIBARY_PATH to mangohud

Upstream officially supports the use of $LIB/mangohud/

Signed-off-by: Jan200101 <sentrycraft123@gmail.com>
This commit is contained in:
Jan200101 2022-12-08 23:09:14 +01:00
parent c390e211ee
commit 514e7ae6a0
No known key found for this signature in database
GPG Key ID: 5B71B1D78B882E05

View File

@ -483,8 +483,11 @@ QProcessEnvironment MinecraftInstance::createLaunchEnvironment()
if (settings()->get("EnableMangoHud").toBool() && APPLICATION->capabilities() & Application::SupportsMangoHud) if (settings()->get("EnableMangoHud").toBool() && APPLICATION->capabilities() & Application::SupportsMangoHud)
{ {
auto preload = env.value("LD_PRELOAD", "") + ":libMangoHud_dlsym.so:libMangoHud.so"; auto preload = env.value("LD_PRELOAD", "") + ":libMangoHud_dlsym.so:libMangoHud.so";
// $LIB/mangohud is a supported lib path by upstream, do not remove
auto lib_path = env.value("LD_LIBRARY_PATH", "") + ":/usr/local/$LIB/mangohud/:/usr/$LIB/mangohud/";
env.insert("LD_PRELOAD", preload); env.insert("LD_PRELOAD", preload);
env.insert("LD_LIBRARY_PATH", lib_path);
env.insert("MANGOHUD", "1"); env.insert("MANGOHUD", "1");
} }