]> git.99rst.org Git - openwrt-packages.git/commit
lua: look for lua5.4 modules under /usr instead of /usr/local
authorAlexandru Ardelean <redacted>
Wed, 22 Jul 2026 11:52:14 +0000 (14:52 +0300)
committerAlexandru Ardelean <redacted>
Fri, 31 Jul 2026 06:46:08 +0000 (09:46 +0300)
commit3fe92e63f5585b35875543c64f7612935b897373
tree7cef9e6285510d8bbdb22c6a4d90e18be1f2bed5
parent664df2843a188185f12db1bd82373cb7f25acab6
lua: look for lua5.4 modules under /usr instead of /usr/local

luaconf.h hardcodes LUA_ROOT to "/usr/local/", and nothing in this
package overrides it for the target build, so the interpreter only ever
searches /usr/local/{share,lib}/lua/5.4. Nothing installs there on
OpenWrt, which leaves every Lua 5.4 module package unreachable:

  # lua5.4 -e 'require "lfs"'
  lua5.4: module 'lfs' not found:
          no file '/usr/local/share/lua/5.4/lfs.lua'
          no file '/usr/local/lib/lua/5.4/lfs.so'
          [...]
  # find / -name lfs.so
  /usr/lib/lua/5.4/lfs.so

Point LUA_ROOT at /usr. LUA_LDIR and LUA_CDIR are derived from it and
keep the version suffix, so the search paths become /usr/share/lua/5.4
and /usr/lib/lua/5.4 - exactly where the Lua 5.4 module packages
install. The core lua (5.1) package carries an equivalent patch.

Signed-off-by: Alexandru Ardelean <redacted>
lang/lua/lua5.4/Makefile
lang/lua/lua5.4/patches/200-lua-path.patch [new file with mode: 0644]
git clone https://git.99rst.org/PROJECT