summaryrefslogtreecommitdiff
path: root/src/defs.js
diff options
context:
space:
mode:
authordaurnimator <quae@daurnimator.com>2018-02-17 11:56:05 +1100
committerdaurnimator <quae@daurnimator.com>2018-02-17 12:00:30 +1100
commit9c7e6a39c8a7f4843de7c19b3b151f071a222820 (patch)
tree10be1d9373bd06badac6e4fddce962ee4789a8cc /src/defs.js
parentf3687e76381bfd269748b0064b601b647cdb9cb7 (diff)
downloadfengari-9c7e6a39c8a7f4843de7c19b3b151f071a222820.tar.gz
fengari-9c7e6a39c8a7f4843de7c19b3b151f071a222820.tar.bz2
fengari-9c7e6a39c8a7f4843de7c19b3b151f071a222820.zip
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
Diffstat (limited to 'src/defs.js')
-rw-r--r--src/defs.js9
1 files changed, 8 insertions, 1 deletions
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;
}