Skip to content

feat: add lua 5.4.7 (C library)#4

Merged
Sunrisepeak merged 2 commits intomainfrom
feat/add-lua-5.4
May 9, 2026
Merged

feat: add lua 5.4.7 (C library)#4
Sunrisepeak merged 2 commits intomainfrom
feat/add-lua-5.4

Conversation

@Sunrisepeak
Copy link
Copy Markdown
Member

Summary

Adds an lua package descriptor (Form B) covering Lua 5.4.7 — the upstream tarball at https://www.lua.org/ftp/lua-5.4.7.tar.gz.

The 32 library translation units (CORE_O + LIB_O from upstream's src/Makefile) build into a single liblua.a. The two binary entry points (src/lua.c interpreter, src/luac.c bytecode compiler) are intentionally excluded — both define int main() and aren't part of the embeddable library; consumers #include <lua.h> + link against liblua.a instead.

Pure-C; relies on mcpp's C compile rule (since 0.0.2). c_standard = "c99" matches upstream's reference build.

Test plan

  • Local mcpp build of a small consumer that calls luaL_newstate / luaL_openlibs / luaL_dostring("return 1+2") links cleanly and outputs 3 at runtime
  • CI lint / validate (if any)

Pure-C scripting library; relies on mcpp's C compile rule. Form B
descriptor enumerates the 32 library translation units (CORE_O +
LIB_O from upstream's src/Makefile) into a single `liblua.a`
static archive. The two binary entry points (src/lua.c interpreter,
src/luac.c bytecode compiler) are intentionally excluded — both
define `int main()` and aren't part of the embeddable library.

Tarball: https://www.lua.org/ftp/lua-5.4.7.tar.gz
SHA256:  9fbf5e28ef86c69858f6d3d34eccc32e911c1a28b4120ff3e84aaa70cfbf1e30

Verified end-to-end with a small consumer that calls lua_State /
luaL_openlibs / luaL_dostring("return 1+2") — outputs "3", links
clean against liblua.a, no main() collision.
The previous check insisted on `schema = "0.1"` and an inline
`mcpp = { ... }` segment. Both are wrong for the actual xpkg V1
schema we use:
- xpkg V1 names the version field `spec`, not `schema`. (None of the
  existing descriptors in this repo carry `schema = "0.1"`, so this
  check would have flagged every file the moment any pkgs/ change
  triggered the workflow.)
- The inline `mcpp = {}` segment is Form B only; Form A descriptors
  (mcpplibs.tinyhttps, mcpplibs.llmapi after their upstream started
  shipping mcpp.toml) intentionally omit it.

Replace both with the actual xpkg V1 baseline:
- `package = { ... }` assignment present (via syntax-only `loadfile`
  parse — catches typos without executing user code)
- required fields: `spec`, `name`, `xpm`
- still flag the forbidden `function install(...)` hook

Adds a `lua5.4` install step so the syntax check has an interpreter.
@Sunrisepeak Sunrisepeak merged commit 25f1425 into main May 9, 2026
1 check passed
@Sunrisepeak Sunrisepeak deleted the feat/add-lua-5.4 branch May 9, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant