GH-1069 env hack/passthhrough for LD_PRELOAD and LD_LIBRARY_PATH

This commit is contained in:
Petr Mrázek 2015-06-12 09:40:41 +02:00
parent b427a652ad
commit f723721bd0
2 changed files with 19 additions and 3 deletions

View File

@ -17,8 +17,11 @@ fi
MMC_DIR="$(dirname "$(readlink -f "$0")")" MMC_DIR="$(dirname "$(readlink -f "$0")")"
echo "MultiMC Dir: ${MMC_DIR}" echo "MultiMC Dir: ${MMC_DIR}"
# Set up env # Set up env - filter out input LD_ variables but pass them in under different names
export LD_LIBRARY_PATH="${MMC_DIR}/bin":$LD_LIBRARY_PATH export GAME_LIBRARY_PATH=$LD_LIBRARY_PATH
export GAME_PRELOAD=$LD_PRELOAD
export LD_LIBRARY_PATH="${MMC_DIR}/bin":$MMC_LIBRARY_PATH
export LD_PRELOAD=$MMC_PRELOAD
export QT_PLUGIN_PATH="${MMC_DIR}/plugins" export QT_PLUGIN_PATH="${MMC_DIR}/plugins"
export QT_FONTPATH="${MMC_DIR}/fonts" export QT_FONTPATH="${MMC_DIR}/fonts"

View File

@ -100,12 +100,25 @@ void BaseProcess::init()
qDebug() << "Env: stripped" << IBUS << "from" << save << ":" << value; qDebug() << "Env: stripped" << IBUS << "from" << save << ":" << value;
} }
#endif #endif
if(key == "GAME_PRELOAD")
{
env.insert("LD_PRELOAD", value);
continue;
}
if(key == "GAME_LIBRARY_PATH")
{
env.insert("LD_LIBRARY_PATH", value);
continue;
}
qDebug() << "Env: " << key << value; qDebug() << "Env: " << key << value;
env.insert(key, value); env.insert(key, value);
} }
#ifdef Q_OS_LINUX #ifdef Q_OS_LINUX
// HACK: Workaround for QTBUG-42500 // HACK: Workaround for QTBUG-42500
if(!env.contains("LD_LIBRARY_PATH"))
{
env.insert("LD_LIBRARY_PATH", ""); env.insert("LD_LIBRARY_PATH", "");
}
#endif #endif
// export some infos // export some infos