Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 31 May 2026 02:36:05 +0000
From:      Hiroki Tagato <tagattie@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 5a2beff06118 - main - lang/lua55: Add port: Powerful, efficient, lightweight, embeddable scripting language (Version 5.5)
Message-ID:  <6a1b9e95.32c8d.5cc744f3@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by tagattie:

URL: https://cgit.FreeBSD.org/ports/commit/?id=5a2beff061181ebcd1a99bf048df11341845bae9

commit 5a2beff061181ebcd1a99bf048df11341845bae9
Author:     Hiroki Tagato <tagattie@FreeBSD.org>
AuthorDate: 2026-05-31 02:33:03 +0000
Commit:     Hiroki Tagato <tagattie@FreeBSD.org>
CommitDate: 2026-05-31 02:35:54 +0000

    lang/lua55: Add port: Powerful, efficient, lightweight, embeddable scripting language (Version 5.5)
    
    Lua is a programming language originally designed for extending applications,
    but also frequently used as a general-purpose, stand-alone language. Lua
    combines simple procedural syntax (similar to Pascal) with powerful data
    description constructs based on associative arrays and extensible semantics.
    Lua is dynamically typed, interpreted from bytecodes, and has automatic memory
    management with garbage collection, making it ideal for configuration,
    scripting, and rapid prototyping.
    
    A fundamental concept in the design of Lua is to provide meta-mechanisms for
    implementing features, instead of providing a host of features directly in
    the language. For example, although Lua is not a pure object-oriented
    language, it does provide meta-mechanisms for implementing classes and
    inheritance. Lua's meta-mechanisms bring an economy of concepts and keep the
    language small, while allowing the semantics to be extended in unconventional
    ways. Extensible semantics is a distinguishing feature of Lua.
    
    Lua is implemented as a small library of C functions, written in ANSI C, and
    compiles unmodified in all known platforms. The implementation goals are
    simplicity, efficiency, portability, and low embedding cost.
    
    WWW: https://www.lua.org/
    
    PR:             295279
    Reviewed by:    vvd
    Approved by:    portmgr (implicit)
    Differential Revision:  https://reviews.freebsd.org/D57001
---
 Mk/Uses/lua.mk                                    |  2 +-
 Mk/bsd.default-versions.mk                        |  2 +-
 lang/Makefile                                     |  1 +
 lang/lua55/Makefile                               | 37 ++++++++-------
 lang/lua55/distinfo                               |  6 +--
 lang/lua55/files/extra-patch-dlopen               | 42 ++++++++++++++++
 lang/lua55/files/extra-patch-libedit-dl           | 58 -----------------------
 lang/lua55/files/{lua-5.4.pc.in => lua-5.5.pc.in} |  0
 lang/lua55/files/patch-src_Makefile               | 12 ++---
 9 files changed, 73 insertions(+), 87 deletions(-)

diff --git a/Mk/Uses/lua.mk b/Mk/Uses/lua.mk
index 7088d5e29720..c8184225920a 100644
--- a/Mk/Uses/lua.mk
+++ b/Mk/Uses/lua.mk
@@ -55,7 +55,7 @@ _INCLUDE_USES_LUA_MK=	yes
 
 # When adding a version, please keep the comment in
 # Mk/bsd.default-versions.mk in sync.
-_LUA_VALID_VERSIONS:=	54 53 52 51
+_LUA_VALID_VERSIONS:=	55 54 53 52 51
 .  if defined(_LUA_EXTRA_VER)
 _LUA_VALID_VERSIONS+= ${_LUA_EXTRA_VER}
 .  endif
diff --git a/Mk/bsd.default-versions.mk b/Mk/bsd.default-versions.mk
index ed5a17e63431..162b056522f7 100644
--- a/Mk/bsd.default-versions.mk
+++ b/Mk/bsd.default-versions.mk
@@ -105,7 +105,7 @@ LINUX_DEFAULT?=		rl9
 .  endif
 # Possible values: 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, -devel (to be used when non-base compiler is required)
 LLVM_DEFAULT?=		19
-# Possible values: 5.1, 5.2, 5.3, 5.4
+# Possible values: 5.1, 5.2, 5.3, 5.4, 5.5
 LUA_DEFAULT?=		5.4
 # Possible values: luajit, luajit-openresty
 .  if ${ARCH:Mpowerpc64*}
diff --git a/lang/Makefile b/lang/Makefile
index 574cef288142..d2fb79408663 100644
--- a/lang/Makefile
+++ b/lang/Makefile
@@ -180,6 +180,7 @@
     SUBDIR += lua52
     SUBDIR += lua53
     SUBDIR += lua54
+    SUBDIR += lua55
     SUBDIR += luajit
     SUBDIR += luajit-openresty
     SUBDIR += malbolge
diff --git a/lang/lua55/Makefile b/lang/lua55/Makefile
index 80142d88b858..271eb1477e3c 100644
--- a/lang/lua55/Makefile
+++ b/lang/lua55/Makefile
@@ -1,23 +1,23 @@
 PORTNAME=	lua
-DISTVERSION=	5.4.8
+DISTVERSION=	5.5.0
 CATEGORIES=	lang
 MASTER_SITES=	https://www.lua.org/ftp/
 PKGNAMESUFFIX=	${LUA_VER_STR}
 
-MAINTAINER=	andrew@tao11.riddles.org.uk
+MAINTAINER=	tagattie@FreeBSD.org
 COMMENT=	Powerful, efficient, lightweight, embeddable scripting language
 WWW=		https://www.lua.org/
 
 LICENSE=	MIT
 
-USES=		cpe lua:core,54
+USES=		cpe lua:core,55
 USE_LDCONFIG=	yes
 
 # using the "bsd" target rather than "freebsd" saves patching out the
 # assumption of using base libedit in order to make it configurable. "bsd"
 # is "generic" plus the POSIX and DLOPEN options, plus -Wl,-E at link time;
 # it doesn't set CC either, which makes it easier for us to control that too.
-ALL_TARGET=bsd
+ALL_TARGET=	bsd
 
 LUA_LIB_STATIC=	liblua-${LUA_VER}.a
 LUA_LIB_SHARED=	liblua-${LUA_VER}.so
@@ -28,7 +28,7 @@ CFLAGS+=	-fPIC
 # https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235211
 LIBS+=		-pthread
 
-WITHOUT_NO_STRICT_ALIASING=yes
+WITHOUT_NO_STRICT_ALIASING=	yes
 
 MAKE_ARGS+=	CC="${CC}" \
 		CMCFLAGS="" \
@@ -74,7 +74,7 @@ OPTIONS_GROUP_DEBUGGRP=	ASSERT APICHECK
 OPTIONS_GROUP_DOCSGRP=	DOCS
 
 OPTIONS_SINGLE=		EDITGRP
-OPTIONS_SINGLE_EDITGRP=	EDITNONE LIBEDIT_DL LIBEDIT READLINE
+OPTIONS_SINGLE_EDITGRP=	EDITNONE LIBEDIT LIBEDIT_DL READLINE READLINE_DL
 
 # Option descriptions
 
@@ -85,11 +85,12 @@ DEBUGGRP_DESC=	Debugging options
 DOCSGRP_DESC=	Documentation options
 DOCS_DESC=	Install language and API reference (HTML, ~400kB)
 
-EDITGRP_DESC=	Interactive command-line editing
-EDITNONE_DESC=	No command-line editing
-LIBEDIT_DESC=	Use libedit (breaks lcurses)
-LIBEDIT_DL_DESC=Use dynamically loaded libedit (recommended)
-READLINE_DESC=	Use GNU Readline (breaks lcurses)
+EDITGRP_DESC=		Interactive command-line editing
+EDITNONE_DESC=		No command-line editing
+LIBEDIT_DESC=		Use libedit (breaks lcurses)
+LIBEDIT_DL_DESC=	Use dynamically loaded libedit (recommended)
+READLINE_DESC=		Use GNU Readline (breaks lcurses)
+READLINE_DL_DESC=	Use dynamically loaded GNU readline
 
 # Option implementations
 
@@ -103,13 +104,18 @@ LIBEDIT_CPPFLAGS=	-DLUA_USE_READLINE
 LIBEDIT_LIBS=		-ledit
 
 LIBEDIT_DL_USES=	libedit
-LIBEDIT_DL_CPPFLAGS=	-DLUA_USE_READLINE_DL
-LIBEDIT_DL_EXTRA_PATCHES=${PATCHDIR}/extra-patch-libedit-dl
+LIBEDIT_DL_CPPFLAGS=	-DLUA_USE_DLOPEN \
+			-DLUA_READLINELIB='\"${LOCALBASE}/lib/libedit.so\"'
+LIBEDIT_DL_EXTRA_PATCHES=${PATCHDIR}/extra-patch-dlopen
 
 READLINE_USES=		readline
 READLINE_CPPFLAGS=	-DLUA_USE_READLINE
 READLINE_LIBS=		-lreadline
 
+READLINE_DL_USES=	readline
+READLINE_DL_CPPFLAGS=	-DLUA_USE_DLOPEN \
+			-DLUA_READLINELIB='\"${LOCALBASE}/lib/libreadline.so\"'
+
 # end of option vars
 
 post-patch:
@@ -122,11 +128,6 @@ post-patch-LIBEDIT-on:
 	@${REINPLACE_CMD} -e "s,readline/,editline/,g ; \
 		/history\.h/d" ${WRKSRC}/src/lua.c
 
-post-patch-LIBEDIT_DL-on:
-	@${REINPLACE_CMD} \
-		-e "/^#def.*LUA_READLINE_LIBPATH/s,/usr/local,${LOCALBASE}," \
-		${WRKSRC}/src/lua.c
-
 post-install:
 	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/${LUA_LIB_SHARED}
 	${MV} ${STAGEDIR}${PREFIX}/share/man/man1/lua.1 \
diff --git a/lang/lua55/distinfo b/lang/lua55/distinfo
index 21fa1f581472..3413a4a73796 100644
--- a/lang/lua55/distinfo
+++ b/lang/lua55/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1751702639
-SHA256 (lua-5.4.8.tar.gz) = 4f18ddae154e793e46eeab727c59ef1c0c0c2b744e7b94219710d76f530629ae
-SIZE (lua-5.4.8.tar.gz) = 374332
+TIMESTAMP = 1778587320
+SHA256 (lua-5.5.0.tar.gz) = 57ccc32bbbd005cab75bcc52444052535af691789dba2b9016d5c50640d68b3d
+SIZE (lua-5.5.0.tar.gz) = 396950
diff --git a/lang/lua55/files/extra-patch-dlopen b/lang/lua55/files/extra-patch-dlopen
new file mode 100644
index 000000000000..edfbfce1e868
--- /dev/null
+++ b/lang/lua55/files/extra-patch-dlopen
@@ -0,0 +1,42 @@
+--- src/lua.c.orig	2025-12-15 10:44:40 UTC
++++ src/lua.c
+@@ -498,18 +498,30 @@ static void lua_initreadline (lua_State *L) {
+ #include <dlfcn.h>
+ 
+ static void lua_initreadline (lua_State *L) {
++  union {
++    void *ptr;
++    l_readlineT rlfunc;
++    l_addhistT ahfunc;
++    char **rlnamevar;
++    int *icompvar;
++  } u;
++
+   void *lib = dlopen(LUA_READLINELIB, RTLD_NOW | RTLD_LOCAL);
+-  if (lib == NULL)
++  if (lib == NULL) {
+     lua_warning(L, "library '" LUA_READLINELIB "' not found", 0);
+-  else {
+-    const char **name = cast(const char**, dlsym(lib, "rl_readline_name"));
+-    if (name != NULL)
+-      *name = "lua";
+-    l_readline = cast(l_readlineT, cast_func(dlsym(lib, "readline")));
+-    l_addhist = cast(l_addhistT, cast_func(dlsym(lib, "add_history")));
+-    if (l_readline == NULL)
+-      lua_warning(L, "unable to load 'readline'", 0);
++    return;
+   }
++
++  u.ptr = dlsym(lib, "readline");
++  l_readline = u.rlfunc;
++  u.ptr = dlsym(lib, "add_history");
++  l_addhist = u.ahfunc;
++  if ((u.ptr = dlsym(lib, "rl_readline_name")))
++    *u.rlnamevar = "lua";
++  if ((u.ptr = dlsym(lib, "rl_inhibit_completion")))
++    *u.icompvar = 1;
++  if (l_readline == NULL)
++    lua_warning(L, "unable to load 'readline' from dynamic library", 0);
+ }
+ 
+ #else		/* }{ */
diff --git a/lang/lua55/files/extra-patch-libedit-dl b/lang/lua55/files/extra-patch-libedit-dl
deleted file mode 100644
index ef0fe4390c9d..000000000000
--- a/lang/lua55/files/extra-patch-libedit-dl
+++ /dev/null
@@ -1,58 +0,0 @@
---- src/lua.c.orig	2018-03-16 14:23:08 UTC
-+++ src/lua.c
-@@ -379,7 +379,54 @@ static int handle_luainit (lua_State *L)
- */
- #if !defined(lua_readline)	/* { */
- 
--#if defined(LUA_USE_READLINE)	/* { */
-+#if defined(LUA_USE_READLINE_DL)/* { */
-+
-+#include <dlfcn.h>
-+
-+#ifndef LUA_READLINE_LIBPATH
-+#define LUA_READLINE_LIBPATH "/usr/local/lib/libedit.so"
-+#endif
-+
-+typedef char *readline_functype(const char *);
-+typedef int add_history_functype(const char *);
-+
-+static readline_functype *lua_readline_p = NULL;
-+static add_history_functype *lua_saveline_p = NULL;
-+
-+static void lua_initreadline(lua_State *L)
-+{
-+  void *editlib = NULL;
-+  union dl_func_hack {
-+    void *ptr;
-+    readline_functype *rlfunc;
-+    add_history_functype *ahfunc;
-+    char **rlnamevar;
-+    int *icompvar;
-+  } u;
-+  (void) L;
-+  if ((editlib = dlopen(LUA_READLINE_LIBPATH, RTLD_LAZY | RTLD_LOCAL))) {
-+    u.ptr = dlsym(editlib, "readline");
-+    lua_readline_p = u.rlfunc;
-+    u.ptr = dlsym(editlib, "add_history");
-+    lua_saveline_p = u.ahfunc;
-+    if ((u.ptr = dlsym(editlib, "rl_readline_name")))
-+      *u.rlnamevar = "lua";
-+    if ((u.ptr = dlsym(editlib, "rl_inhibit_completion")))
-+      *u.icompvar = 1;
-+  }
-+}
-+
-+#define lua_readline(L,b,p) \
-+  ((void)L,							\
-+   (lua_readline_p)						\
-+   ? (((b)=lua_readline_p(p)) != NULL)				\
-+   : (fputs(p, stdout), fflush(stdout), fgets(b, LUA_MAXINPUT, stdin) != NULL))
-+#define lua_saveline(L,line) \
-+  do { (void)L; if (lua_saveline_p) lua_saveline_p(line); } while(0)
-+#define lua_freeline(L,b) \
-+  do { (void)L; if (lua_readline_p) free(b); } while(0)
-+
-+#elif defined(LUA_USE_READLINE)	/* { */
- 
- #include <readline/readline.h>
- #include <readline/history.h>
diff --git a/lang/lua55/files/lua-5.4.pc.in b/lang/lua55/files/lua-5.5.pc.in
similarity index 100%
rename from lang/lua55/files/lua-5.4.pc.in
rename to lang/lua55/files/lua-5.5.pc.in
diff --git a/lang/lua55/files/patch-src_Makefile b/lang/lua55/files/patch-src_Makefile
index 1d52c4a01aa7..35648f909c77 100644
--- a/lang/lua55/files/patch-src_Makefile
+++ b/lang/lua55/files/patch-src_Makefile
@@ -1,11 +1,11 @@
---- src/Makefile.orig	2020-04-15 13:00:29 UTC
+--- src/Makefile.orig	2025-07-07 00:19:14 UTC
 +++ src/Makefile
-@@ -7,11 +7,12 @@
+@@ -7,11 +7,12 @@ CC= gcc -std=gnu99
  PLAT= guess
  
  CC= gcc -std=gnu99
--CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_3 $(SYSCFLAGS) $(MYCFLAGS)
-+CFLAGS= -Wall -Wextra -DLUA_COMPAT_5_3 $(SYSCFLAGS) $(MYCFLAGS)
+-CFLAGS= -O2 -Wall -Wextra $(SYSCFLAGS) $(MYCFLAGS)
++CFLAGS= -Wall -Wextra $(SYSCFLAGS) $(MYCFLAGS)
  LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
  LIBS= -lm $(SYSLIBS) $(MYLIBS)
 +SOLIBS= -lm
@@ -15,7 +15,7 @@
  RANLIB= ranlib
  RM= rm -f
  UNAME= uname
-@@ -39,12 +40,13 @@ BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
+@@ -39,12 +40,13 @@ LUA_O=	lua.o
  
  LUA_T=	lua
  LUA_O=	lua.o
@@ -30,7 +30,7 @@
  ALL_A= $(LUA_A)
  
  # Targets start here.
-@@ -56,8 +58,11 @@ o:	$(ALL_O)
+@@ -56,8 +58,11 @@ a:	$(ALL_A)
  
  a:	$(ALL_A)
  


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a1b9e95.32c8d.5cc744f3>