Hi ports@
[cc edd@ as maintainer]
proposal of a patch for devel/stylua (code formatter for Lua, written in Rust)
to support all Lua syntax variants: Lua 5.2, 5.3, 5.4, LuaJIT and Luau ; by
default, only Lua 5.1 variant is supported.
Build and tests OK on current/amd64 with Rust 1.92.0.
Lua code checked with "LuaJIT" variant with this version of stylua.
Tests welcome and please commit if OK.
Laurent
Index: Makefile
===================================================================
RCS file: /cvs/ports/devel/stylua/Makefile,v
diff -u -p -r1.4 Makefile
--- Makefile 12 Jan 2026 21:16:30 -0000 1.4
+++ Makefile 9 Feb 2026 17:09:10 -0000
@@ -4,6 +4,8 @@ V = 2.3.1
DIST_TUPLE += github JohnnyMorganz StyLua v${V} .
DISTNAME = stylua-${V}
+REVISION = 0
+
CATEGORIES = devel textproc
MAINTAINER = Edd Barrett <[email protected]>
@@ -14,6 +16,9 @@ WANTLIB += ${MODCARGO_WANTLIB}
MODULES = devel/cargo
CONFIGURE_STYLE = cargo
+
+MODCARGO_FEATURES = lua52 lua53 lua54 luajit luau
+
SEPARATE_BUILD = Yes
WRKSRC = ${WRKDIR}/StyLua-${V}