diff --git a/Assets/Lua/mime/core.dll b/Assets/Lua/mime/core.dll new file mode 100644 index 0000000000..10e1a4f0b3 Binary files /dev/null and b/Assets/Lua/mime/core.dll differ diff --git a/Assets/Lua/socket/core.dll b/Assets/Lua/socket/core.dll new file mode 100644 index 0000000000..4880d7c579 Binary files /dev/null and b/Assets/Lua/socket/core.dll differ diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaLibraries.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaLibraries.cs index 440b7cfbe1..2eb27c78ea 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaLibraries.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaLibraries.cs @@ -103,13 +103,24 @@ namespace BizHawk.Client.EmuHawk } _lua.RegisterFunction("print", this, typeof(LuaLibraries).GetMethod(nameof(Print))); + + var packageTable = (LuaTable) _lua["package"]; + var luaPath = PathEntries.LuaAbsolutePath(); if (OSTailoredCode.IsUnixHost) { // add %exe%/Lua to library resolution pathset (LUA_PATH) // this is done already on windows, but not on linux it seems? - var packageTable = (LuaTable) _lua["package"]; - var luaPath = PathEntries.LuaAbsolutePath(); packageTable["path"] = $"{luaPath}/?.lua;{luaPath}?/init.lua;{packageTable["path"]}"; + // we need to modifiy the cpath so it looks at our lua dir too, and remove the relative pathing + // we do this on Windows too, but keep in mind Linux uses .so and Windows use .dll + // TODO: Does the relative pathing issue Windows has also affect Linux? I'd assume so... + packageTable["cpath"] = $"{luaPath}/?.so;{luaPath}/loadall.so;{packageTable["cpath"]}"; + packageTable["cpath"] = ((string)packageTable["cpath"]).Replace(";./?.so", ""); + } + else + { + packageTable["cpath"] = $"{luaPath}\\?.dll;{luaPath}\\loadall.dll;{packageTable["cpath"]}"; + packageTable["cpath"] = ((string)packageTable["cpath"]).Replace(";.\\?.dll", ""); } EmulationLuaLibrary.FrameAdvanceCallback = FrameAdvance;