From 9c7e6a39c8a7f4843de7c19b3b151f071a222820 Mon Sep 17 00:00:00 2001 From: daurnimator Date: Sat, 17 Feb 2018 11:56:05 +1100 Subject: src/defs.js: Look in both /usr and /usr/local Takes similar approach as patch carried by debian. https://anonscm.debian.org/cgit/pkg-lua/lua5.3.git/tree/debian/patches/0002-lua-modules-paths.patch?id=8dc227b2a85a160d2f1e92f9a21abd9e2e267735 --- src/defs.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/defs.js b/src/defs.js index dc9e914..8bdd23e 100644 --- a/src/defs.js +++ b/src/defs.js @@ -406,22 +406,29 @@ if (typeof process === "undefined") { const LUA_ROOT = "/usr/local/"; module.exports.LUA_ROOT = LUA_ROOT; + const LUA_ROOT2 = "/usr/"; const LUA_LDIR = LUA_ROOT + "share/lua/" + LUA_VDIR + "/"; + const LUA_LDIR2 = LUA_ROOT2 + "share/lua/" + LUA_VDIR + "/"; module.exports.LUA_LDIR = LUA_LDIR; const LUA_JSDIR = LUA_ROOT + "share/lua/" + LUA_VDIR + "/"; module.exports.LUA_JSDIR = LUA_JSDIR; + const LUA_JSDIR2 = LUA_ROOT2 + "share/lua/" + LUA_VDIR + "/"; const LUA_PATH_DEFAULT = to_luastring( LUA_LDIR + "?.lua;" + LUA_LDIR + "?/init.lua;" + + LUA_LDIR2 + "?.lua;" + LUA_LDIR2 + "?/init.lua;" + LUA_JSDIR + "?.lua;" + LUA_JSDIR + "?/init.lua;" + + LUA_JSDIR2 + "?.lua;" + LUA_JSDIR2 + "?/init.lua;" + "./?.lua;./?/init.lua" ); module.exports.LUA_PATH_DEFAULT = LUA_PATH_DEFAULT; const LUA_JSPATH_DEFAULT = to_luastring( - LUA_JSDIR + "?.js;" + LUA_JSDIR + "loadall.js;./?.js" + LUA_JSDIR + "?.js;" + LUA_JSDIR + "loadall.js;" + + LUA_JSDIR2 + "?.js;" + LUA_JSDIR2 + "loadall.js;" + + "./?.js" ); module.exports.LUA_JSPATH_DEFAULT = LUA_JSPATH_DEFAULT; } -- cgit v1.2.3-70-g09d2