check some system lib deps on Linux and force user to provide their own liblua54 from package managers

This commit is contained in:
CasualPokePlayer 2022-12-16 15:03:39 -08:00
parent 2187602dc1
commit ab355d4693
2 changed files with 24 additions and 1 deletions

Binary file not shown.

View File

@ -36,7 +36,30 @@ namespace BizHawk.Client.EmuHawk
if (OSTC.IsUnixHost)
{
// for Unix, skip everything else and just wire up the event handler
// for Unix, we'll check a few system libraries and wire up the event handler
foreach (var soToLoad in new[]
{
"libspeexdsp.so.1", // for old BSNES and melonDS (TODO: should we remove this dependency? old BSNES will be axed soon enough, BlipBuffer could probably work well enough for melonDS?)
"liblua54.so", // lua console (TODO: should we rather just disable lua console if this cannot be found?)
// there are some other dependencies, but mono will provide them anyways
})
{
var p = OSTC.LinkedLibManager.LoadOrZero(soToLoad);
if (p != IntPtr.Zero)
{
OSTC.LinkedLibManager.FreeByPtr(p);
continue;
}
// else it's missing or corrupted
using (ExceptionBox box = new($"EmuHawk needs {soToLoad} in order to run! You will need to install it via your distro's package manager. (EmuHawk will now close.) Internal error message: {OSTC.LinkedLibManager.GetErrorMessage()}"))
{
box.ShowDialog();
}
Process.GetCurrentProcess().Kill();
return;
}
AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
return;
}