Lua stopped shipping a pkg-config file after 5.1; the 5.2, 5.3 and 5.4
release tarballs contain none. Distributions add one to their Lua
packages instead: Debian's liblua5.4-dev ships lua5.4.pc, lua-5.4.pc
and lua54.pc, Alpine's lua5.4-dev ships lua5.4.pc and lua-5.4.pc. Build
systems of Lua consumers look Lua 5.4 up under these names. The package
stages no pkg-config file so far, so such builds cannot find
liblua5.4; the only Lua pkg-config file in the staging directory is
lua.pc of the lua package (5.1.5).
Stage lua5.4.pc, generated from a template with the package version,
and lua-5.4.pc and lua54.pc as links to it. It points to the headers in
/usr/include/lua5.4 and to liblua5.4, and lists libm and libdl as
private libraries for static linking, as the upstream Makefile links
them on Linux.
Of the packages that look up one of these names through pkg-config,
libinput disables its Lua plugin support explicitly in the previous
commit. tio looks up lua-5.4 before lua but depends on lua (5.1), so it
links liblua5.4 without depending on it until the next commit moves it
to Lua 5.4. The others select their Lua version explicitly, look up lua
(5.1) first, build without the feature using Lua, or depend on lua5.4
already.
Assisted-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Mirko Vogt <mirko-openwrt@nanl.de>
luaconf.h builds the module search paths out of LUA_ROOT, which upstream
hardcodes to /usr/local, where nothing installs on OpenWrt. LUA_ROOT is
defined unconditionally, but the two macros it feeds, LUA_PATH_DEFAULT
and LUA_CPATH_DEFAULT, are both guarded with #if !defined and are the
only users of it, so set them in TARGET_CFLAGS and drop the patch.
The resulting paths are the ones the patch produced, so the interpreter
behaves exactly as before.
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
The three Lua variants of each package install the same files, differing
only in the destination directory, so define LUA_INSTALL_DIR next to the
other per-variant settings and share a single install recipe. Same idiom
as luafilesystem, luasec and luaexpat. No packaged path changes.
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
Commit 3fe92e63f5 moved the default Lua 5.4 module search paths
from /usr/local to /usr. luaossl still staged and packaged its Lua 5.4
modules under /usr/local/lib/lua/5.4, outside the default search paths.
Set lua54path and lua54cpath to /usr/lib/lua/5.4 and update the package
install rules to match. Bump PKG_RELEASE to 3 so the corrected package
is offered as an upgrade. Keep Lua 5.1 and Lua 5.3 paths unchanged.
Fixes: 3fe92e63f5 ("lua: look for lua5.4 modules under /usr instead of /usr/local")
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
Commit 3fe92e63f5 moved the default Lua 5.4 module search paths
from /usr/local to /usr. cqueues still staged and packaged its Lua 5.4
modules under /usr/local/lib/lua/5.4, outside the default search paths.
Set lua54path and lua54cpath to /usr/lib/lua/5.4 and update the package
install rules to match. Bump PKG_RELEASE to 3 so the corrected package
is offered as an upgrade. Keep Lua 5.1 and Lua 5.3 paths unchanged.
Fixes: 3fe92e63f5 ("lua: look for lua5.4 modules under /usr instead of /usr/local")
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
Commit 3fe92e63f5 ("lua: look for lua5.4 modules under /usr instead of
/usr/local") changed LUA_ROOT to /usr/, moving the default Lua 5.4
module search paths out of /usr/local. The Lua 5.4 variant of lua-ffi
still installed ffi.so under /usr/local/lib/lua/5.4, so require("ffi")
could no longer find it with the default search paths.
Install ffi.so under /usr/lib/lua/5.4 to match the new default search
path. Bump PKG_RELEASE to 2 so the corrected package is offered as an
upgrade. Keep the Lua 5.1 and Lua 5.3 installation paths unchanged.
Fixes: 3fe92e63f5 ("lua: look for lua5.4 modules under /usr instead of /usr/local")
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
Commit 3fe92e63f5 ("lua: look for lua5.4 modules under /usr instead of
/usr/local") changed LUA_ROOT to /usr/, moving the default Lua 5.4
module search paths out of /usr/local. The Lua 5.4 variant of lua-cjson
still installed cjson.so under /usr/local/lib/lua/5.4, so require("cjson")
could no longer find it with the default search paths.
Install cjson.so under /usr/lib/lua/5.4 to match the new default search
path. Bump PKG_RELEASE to 6 so the corrected package is offered as an
upgrade. Keep the Lua 5.1 and Lua 5.3 installation paths unchanged.
Fixes: 3fe92e63f5 ("lua: look for lua5.4 modules under /usr instead of /usr/local")
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
Commit 3fe92e63f5 ("lua: look for lua5.4 modules under /usr instead of
/usr/local") changed LUA_ROOT to /usr/, moving the default Lua 5.4
module search paths out of /usr/local. lua-eco still installed its Lua
and native modules under /usr/local/lib/lua/5.4, so require() could no
longer find them with the default search paths.
Install modules from the main package and all subpackages under
/usr/lib/lua/5.4, which is searched for both .lua and .so files.
Define LUA_INSTALL_DIR once and use it throughout the install rules so
future directory changes only need one update. Bump PKG_RELEASE to 2
so the corrected packages are offered as upgrades.
Fixes: 3fe92e63f5 ("lua: look for lua5.4 modules under /usr instead of /usr/local")
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
Refresh PKG_HASH from the tag tarball. Upstream moved from
keplerproject to lunarmodules and the 2.7.0 tag has no leading v;
point PKG_SOURCE_URL and the homepage URL at lunarmodules.
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
Also refresh 020-riscv64-support.patch from the current state of
openresty/luajit2#236. The previous snapshot defined
asm_tail_prep(ASMState *as), but since openresty/luajit2 commit
68354f44 the callers pass a second TraceNo argument, so the riscv64
build failed with:
lj_asm.c:2559:5: error: too many arguments to function 'asm_tail_prep'
The refreshed patch carries the upstream adaptation and restores the
build. The other four patches apply unchanged.
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
luajit2 currently fails to link for powerpc: lj_vm.o emits PLT calls
that force BSS-PLT, which the inline-PLT relocations emitted by GCC 12
and newer do not support. Add the same GOT-based fix that
lang/lua/luajit has carried as 060-ppc-musl.patch since 2019.
With that in place the package builds, but ipairs() and pairs() turn
out to be broken on 32-bit big-endian soft-float targets. Both are
regressions in luajit2's PPC64 patch and do not affect upstream
LuaJIT. To be submitted to openresty/luajit2 as well.
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Add luasocket5.4 next to the existing luasocket (Lua 5.1) and
luasocket5.3 variants, installed via the upstream makefile's
'make install LUAV=5.4'.
That makefile defaults to prefix=/usr/local on linux, which is where
the luasocket5.3 variant still installs, so pass prefix=/usr explicitly
to land in /usr/share/lua/5.4 and /usr/lib/lua/5.4 like the other Lua
5.4 module packages.
Needed for the prosody 13.x upgrade.
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
Add luaexpat5.4, parallel to existing luaexpat (Lua 5.1, default).
Builds against the Lua 5.4 headers under /usr/include/lua5.4 and
installs to /usr/lib/lua/5.4/. Same pattern as the luasocket 5.3
variant already shipped.
Needed for the prosody 13.x upgrade.
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
Lua 5.1 is EOL and many downstream packages need 5.2+. Mirror the
luasocket multi-variant pattern: keep luafilesystem (Lua 5.1, default)
and add luafilesystem5.4 which builds the same source against
liblua5.4 and installs to /usr/lib/lua/5.4/.
Needed for the prosody 13.x upgrade (Lua 5.1 unsupported upstream).
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
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 <alex@shruggie.ro>
LUA_ECO_CRASH_BACKTRACE declared "depends on PACKAGE_lua-eco" while
lua-eco's DEPENDS carries "+LUA_ECO_CRASH_BACKTRACE:libunwind", which the
generator turns into "select libunwind if LUA_ECO_CRASH_BACKTRACE". kconfig
then sees lua-eco and the symbol depending on each other:
error: recursive dependency detected!
symbol LUA_ECO_CRASH_BACKTRACE depends on PACKAGE_lua-eco
symbol PACKAGE_lua-eco depends on LUA_ECO_CRASH_BACKTRACE
Drop the redundant guard; the option only affects lua-eco's own build, so
nothing is pulled in when lua-eco itself is not selected.
Fixes: https://github.com/openwrt/packages/pull/30098#issuecomment-5113528752
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
Add the new cli module as a separate subpackage.
Expose the optional C crash backtrace diagnostics through
CONFIG_LUA_ECO_CRASH_BACKTRACE. Depend on libunwind when enabled.
Keep the option unavailable on musl/powerpc, where OpenWrt's
libunwind package is not supported.
changelog: https://github.com/zhaojh329/lua-eco/compare/v4.0.0...v4.1.4
Signed-off-by: Jianhui Zhao <zhaojh329@gmail.com>
old just disabled version test, but as LuaJIt 2.1. part is stable.
So we can use that for test if luajit2 itself able to run.
Fixes: c7ca6d46f7 luajit2: ("add test-version.sh")
Suggested-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
Signed-off-by: Seo Suchan <tjtncks@gmail.com>
FindLuaJIT.cmake uses NO_DEFAULT_PATH and only searches hardcoded
luajit-specific paths, so it never finds regular Lua. However if
LUAJIT_INCLUDE_DIRS and LUAJIT_LIBRARY are pre-set in the CMake
cache, find_path/find_library skip their searches, the module sets
LUAJIT_FOUND=ON and also sets LUA_INCLUDE_DIR/LUA_LIBRARIES from
those values, and the if(NOT LUAJIT_FOUND) guard skips the broken
find_package(Lua REQUIRED) call that fails under CMake 4.3.
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
The CMakeLists.txt first tries FindLuaJIT.cmake which uses
NO_DEFAULT_PATH with hardcoded host paths, so it always fails in
cross-compilation. The fallback find_package(Lua REQUIRED) may also
fail to find a flat sysroot layout where lua.h lives at
/usr/include/lua.h rather than a versioned subdirectory.
Explicitly pass LUA_INCLUDE_DIR and LUA_LIBRARY to CMake to bypass
both finders, and depend on +liblua (the library package) instead of
+lua to ensure Build/InstallDev runs and Lua headers are present in
the staging directory before this package builds.
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
Update Makefile with the version
Remove LuaJIT fix patch - No longer needed
Add "ts-time-cb-signature" patch - Fixes build on various platforms
Signed-off-by: Amnon Paz <pazamnon@gmail.com>
Seems a lot of packages are just getting abandoned by people.
Will pick these up and see them through.
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
This software seems no longer maintained.
The latest upstream commit is 11 years ago,
and upstream repo has been archived.
No package depends on this.
Signed-off-by: Yanase Yuki <dev@zpc.st>
Add pending patch for CMake >= 4.0 support. This seems to come from an
OpenSUSE PR and generally modernize the CMake file also increasing the
minimum version for CMake.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Bump lualanes to version 3.17.2 and backport upstream patch for CMake >=
4.0 support.
Apply minor modification to the backport patch as the project moved to
C++ but the 3.17.2 version is still C based.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
There are roughly 50 Lua packages.
It's about time we consider a proposal for moving all of them
under a lang/lua sub-folder.
Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>