Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157246066
D57001.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
10 KB
Referenced Files
None
Subscribers
None
D57001.diff
View Options
diff --git a/Mk/Uses/lua.mk b/Mk/Uses/lua.mk
--- a/Mk/Uses/lua.mk
+++ b/Mk/Uses/lua.mk
@@ -55,7 +55,7 @@
# 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
--- a/Mk/bsd.default-versions.mk
+++ b/Mk/bsd.default-versions.mk
@@ -101,7 +101,7 @@
. 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
--- a/lang/Makefile
+++ b/lang/Makefile
@@ -185,6 +185,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
new file mode 100644
--- /dev/null
+++ b/lang/lua55/Makefile
@@ -0,0 +1,145 @@
+PORTNAME= lua
+DISTVERSION= 5.5.0
+CATEGORIES= lang
+MASTER_SITES= https://www.lua.org/ftp/
+PKGNAMESUFFIX= ${LUA_VER_STR}
+
+MAINTAINER= tagattie@FreeBSD.org
+COMMENT= Powerful, efficient, lightweight, embeddable scripting language
+WWW= https://www.lua.org/
+
+LICENSE= MIT
+
+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
+
+LUA_LIB_STATIC= liblua-${LUA_VER}.a
+LUA_LIB_SHARED= liblua-${LUA_VER}.so
+LUA_PC_FILE= lua-${LUA_VER}.pc
+
+CFLAGS+= -fPIC
+# 2019-01-25: -pthread in LIBS is a work around for the following bug:
+# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=235211
+LIBS+= -pthread
+
+WITHOUT_NO_STRICT_ALIASING= yes
+
+MAKE_ARGS+= CC="${CC}" \
+ CMCFLAGS="" \
+ MYCFLAGS="${CPPFLAGS} ${CFLAGS}" \
+ MYLDFLAGS="${LDFLAGS}" \
+ MYLIBS="${LIBS}" \
+ LUA_T=${LUA_CMD} \
+ LUAC_T=${LUAC_CMD} \
+ LUA_A=${LUA_LIB_STATIC} \
+ LUA_SO=${LUA_LIB_SHARED} \
+ LUA_SONAME=${LUA_LIB_SHARED} \
+ TO_BIN="${LUA_CMD} ${LUAC_CMD}" \
+ TO_LIB="${LUA_LIB_SHARED} ${LUA_LIB_STATIC}" \
+ INSTALL_TOP=${STAGEDIR}${PREFIX} \
+ INSTALL_INC=${STAGEDIR}${LUA_INCDIR} \
+ INSTALL_EXEC="${INSTALL_PROGRAM}"
+
+# Source, destination, and filenames to copy for the DOCS option
+# (automatically added to pkg-plist if DOCS is set)
+# We override DOCSDIR to get a per-version subdir.
+# We put the docs for Lua proper in a lua/ subdir of the version subdir
+# so that ports for Lua modules can use the version subdir too without
+# making a mess.
+DOCSDIR= ${LUA_DOCSDIR}
+BUILD_WRKDOC= ${WRKSRC}/doc
+
+SUB_FILES= ${LUA_PC_FILE}
+SUB_LIST= version=${PORTVERSION} \
+ includedir=${LUA_INCDIR} \
+ libdir=${LUA_LIBDIR} \
+ soname=lua-${LUA_VER}
+
+BUILD_WRKSRC= ${WRKSRC}/src
+
+PORTDOCS= *
+
+# Options
+
+OPTIONS_DEFAULT= LIBEDIT_DL
+
+OPTIONS_GROUP= DOCSGRP DEBUGGRP
+OPTIONS_GROUP_DEBUGGRP= ASSERT APICHECK
+OPTIONS_GROUP_DOCSGRP= DOCS
+
+OPTIONS_SINGLE= EDITGRP
+OPTIONS_SINGLE_EDITGRP= EDITNONE LIBEDIT LIBEDIT_DL READLINE READLINE_DL
+
+# Option descriptions
+
+APICHECK_DESC= Enable API checks
+ASSERT_DESC= Enable interpreter assertions
+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)
+READLINE_DL_DESC= Use dynamically loaded GNU readline
+
+# Option implementations
+
+APICHECK_CPPFLAGS= -DLUA_USE_APICHECK
+ASSERT_CPPFLAGS= -DLUAI_ASSERT
+
+# EDITNONE currently requires no settings
+
+LIBEDIT_USES= libedit
+LIBEDIT_CPPFLAGS= -DLUA_USE_READLINE
+LIBEDIT_LIBS= -ledit
+
+LIBEDIT_DL_USES= libedit
+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:
+ @${REINPLACE_CMD} -e "/LUA_ROOT/s,/usr/local,${LUA_PREFIX}," \
+ ${WRKSRC}/src/luaconf.h
+ @${REINPLACE_CMD} -e "s|man/man|share/man/man|g" \
+ ${WRKSRC}/Makefile
+
+post-patch-LIBEDIT-on:
+ @${REINPLACE_CMD} -e "s,readline/,editline/,g ; \
+ /history\.h/d" ${WRKSRC}/src/lua.c
+
+post-install:
+ ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/${LUA_LIB_SHARED}
+ ${MV} ${STAGEDIR}${PREFIX}/share/man/man1/lua.1 \
+ ${STAGEDIR}${PREFIX}/share/man/man1/${LUA_CMD}.1
+ ${MV} ${STAGEDIR}${PREFIX}/share/man/man1/luac.1 \
+ ${STAGEDIR}${PREFIX}/share/man/man1/${LUAC_CMD}.1
+ ${INSTALL_DATA} ${WRKDIR}/${LUA_PC_FILE} \
+ ${STAGEDIR}${PREFIX}/libdata/pkgconfig
+
+post-install-DOCS-on:
+ ${MKDIR} ${STAGEDIR}${DOCSDIR}
+ (cd ${BUILD_WRKDOC} && \
+ ${COPYTREE_SHARE} . ${STAGEDIR}${DOCSDIR} '-not -name *\.1')
+
+.include <bsd.port.mk>
diff --git a/lang/lua55/distinfo b/lang/lua55/distinfo
new file mode 100644
--- /dev/null
+++ b/lang/lua55/distinfo
@@ -0,0 +1,3 @@
+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
--- /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/lua-5.5.pc.in b/lang/lua55/files/lua-5.5.pc.in
new file mode 100644
--- /dev/null
+++ b/lang/lua55/files/lua-5.5.pc.in
@@ -0,0 +1,10 @@
+version=%%version%%
+libdir=%%libdir%%
+includedir=%%includedir%%
+soname=%%soname%%
+
+Name: Lua
+Description: Powerful, efficient, lightweight, embeddable scripting language.
+Version: ${version}
+Libs: -L${libdir} -l${soname} -lm
+Cflags: -I${includedir}
diff --git a/lang/lua55/files/patch-src_Makefile b/lang/lua55/files/patch-src_Makefile
new file mode 100644
--- /dev/null
+++ b/lang/lua55/files/patch-src_Makefile
@@ -0,0 +1,45 @@
+--- src/Makefile.orig 2025-07-07 00:19:14 UTC
++++ src/Makefile
+@@ -7,11 +7,12 @@ CC= gcc -std=gnu99
+ PLAT= guess
+
+ CC= gcc -std=gnu99
+-CFLAGS= -O2 -Wall -Wextra $(SYSCFLAGS) $(MYCFLAGS)
++CFLAGS= -Wall -Wextra $(SYSCFLAGS) $(MYCFLAGS)
+ LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
+ LIBS= -lm $(SYSLIBS) $(MYLIBS)
++SOLIBS= -lm
+
+-AR= ar rcu
++AR= ar
+ RANLIB= ranlib
+ RM= rm -f
+ UNAME= uname
+@@ -39,12 +40,13 @@ LUA_O= lua.o
+
+ LUA_T= lua
+ LUA_O= lua.o
++LUA_SO= liblua.so
+
+ LUAC_T= luac
+ LUAC_O= luac.o
+
+ ALL_O= $(BASE_O) $(LUA_O) $(LUAC_O)
+-ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T)
++ALL_T= $(LUA_A) $(LUA_T) $(LUAC_T) $(LUA_SO)
+ ALL_A= $(LUA_A)
+
+ # Targets start here.
+@@ -56,8 +58,11 @@ a: $(ALL_A)
+
+ a: $(ALL_A)
+
++$(LUA_SO): $(CORE_O) $(LIB_O)
++ $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(MYLDFLAGS) -shared -Wl,-soname=$(LUA_SONAME) $? $(SOLIBS)
++
+ $(LUA_A): $(BASE_O)
+- $(AR) $@ $(BASE_O)
++ $(AR) $(ARFLAGS) $@ $(BASE_O)
+ $(RANLIB) $@
+
+ $(LUA_T): $(LUA_O) $(LUA_A)
diff --git a/lang/lua55/pkg-descr b/lang/lua55/pkg-descr
new file mode 100644
--- /dev/null
+++ b/lang/lua55/pkg-descr
@@ -0,0 +1,19 @@
+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.
diff --git a/lang/lua55/pkg-plist b/lang/lua55/pkg-plist
new file mode 100644
--- /dev/null
+++ b/lang/lua55/pkg-plist
@@ -0,0 +1,14 @@
+bin/lua%%LUA_VER_STR%%
+bin/luac%%LUA_VER_STR%%
+%%LUA_INCDIR%%/lauxlib.h
+%%LUA_INCDIR%%/lua.h
+%%LUA_INCDIR%%/lua.hpp
+%%LUA_INCDIR%%/luaconf.h
+%%LUA_INCDIR%%/lualib.h
+lib/liblua-%%LUA_VER%%.a
+lib/liblua-%%LUA_VER%%.so
+libdata/pkgconfig/lua-%%LUA_VER%%.pc
+share/man/man1/lua%%LUA_VER_STR%%.1.gz
+share/man/man1/luac%%LUA_VER_STR%%.1.gz
+@dir %%LUA_MODLIBDIR%%
+@dir %%LUA_MODSHAREDIR%%
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, May 20, 4:23 PM (12 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33351457
Default Alt Text
D57001.diff (10 KB)
Attached To
Mode
D57001: [NEW PORT] lang/lua55: Powerful, efficient, lightweight, embeddable scripting language (version 5.5)
Attached
Detach File
Event Timeline
Log In to Comment