aports/main/luajit/module-paths.patch
Jakub Jirutka c12fb28e6d main/luajit: switch to OpenResty's maintained branch
The MoonJIT fork is unmaintained since September 2020 [1]:

> This code base does not have an active maintainer anymore, please
> read this [Twitter thread][2] to know more. If you are an existing
> contributor (or otherwise have an interest in maintaining this
> project actively) then please email me using the email address in
> my Twitter profile.

Moreover, the transition from original LuaJIT to MoonJIT caused multiple
compatibility and stability issues, mainly with Lua NGINX module
(#12410, #10478), but also with some Lua packages written in C (segfaults).

I wanted to switch back to the original (Mike's) LuaJIT, the latest revision
from the v2.1 branch. The problem is that it doesn't support ppc64le and
s390x. The existing patches don't apply anymore and I really don't have
enough knowledge and insanity in blood to update them. Dropping these
architectures would require updating many dependent aports which is not
a good idea at this moment (v3.14 will be released very soon).

OpenResty's "fork" seems to be the only active LuaJIT fork that regularly
synchronize changes from the upstream LuaJIT project and provides support
for all architectures we need.

> This is the official OpenResty branch of LuaJIT. It is not to be
> considered a fork, since we still regularly synchronize changes from the
> upstream LuaJIT project

Patches CVE-2020-15890 and 20-src-lib_string are already included in the
OpenResty's branch.

[1]: a2a39ea718:
[2]: https://twitter.com/siddhesh_p/status/1308594269502885889

Resolves #12410 #10478
2021-06-13 03:13:33 +02:00

25 lines
931 B
Diff

Add /usr/share/lua/common to LUA_PATH. We use this directory for Lua modules
that are compatible with Lua 5.1 and newer.
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -42,8 +42,10 @@
#ifdef LUA_ROOT
#define LUA_JROOT LUA_ROOT
#define LUA_RLDIR LUA_ROOT "/share" LUA_LUADIR
+#define LUA_RLDIR2 LUA_ROOT "/share/lua/common/"
#define LUA_RCDIR LUA_ROOT "/" LUA_MULTILIB LUA_LUADIR
#define LUA_RLPATH ";" LUA_RLDIR "?.lua;" LUA_RLDIR "?/init.lua"
+#define LUA_RLPATH2 ";" LUA_RLDIR2 "?.lua;" LUA_RLDIR2 "?/init.lua"
#define LUA_RCPATH ";" LUA_RCDIR "?.so"
#else
#define LUA_JROOT LUA_LROOT
@@ -58,7 +60,7 @@
#define LUA_LCPATH1 ";" LUA_LCDIR "?.so"
#define LUA_LCPATH2 ";" LUA_LCDIR "loadall.so"
-#define LUA_PATH_DEFAULT "./?.lua" LUA_JPATH LUA_LLPATH LUA_RLPATH
+#define LUA_PATH_DEFAULT "./?.lua" LUA_JPATH LUA_LLPATH LUA_RLPATH LUA_RLPATH2
#define LUA_CPATH_DEFAULT "./?.so" LUA_LCPATH1 LUA_RCPATH LUA_LCPATH2
#endif