aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Mk/Uses/lua.mk11
-rw-r--r--lang/Makefile1
-rw-r--r--lang/lua53/Makefile80
-rw-r--r--lang/lua53/distinfo2
-rw-r--r--lang/lua53/files/lua-5.3.pc.in10
-rw-r--r--lang/lua53/files/patch-src__Makefile57
-rw-r--r--lang/lua53/files/patch-src__liolib.c10
-rw-r--r--lang/lua53/pkg-descr21
-rw-r--r--lang/lua53/pkg-plist14
9 files changed, 202 insertions, 4 deletions
diff --git a/Mk/Uses/lua.mk b/Mk/Uses/lua.mk
index b87d90128415..579570e540c6 100644
--- a/Mk/Uses/lua.mk
+++ b/Mk/Uses/lua.mk
@@ -3,11 +3,14 @@
# Provide support for lua
#
# MAINTAINER: lua@FreeBSD.org
-
+# Usage:
+#
+# USES+= lua:[version]
+#
.if !defined(_INCLUDE_USES_LUA_MK)
_INCLUDE_USES_LUA_MK= yes
-_LUA_VALID_VERSIONS= 52 51
+_LUA_VALID_VERSIONS= 53 52 51
.include "${PORTSDIR}/Mk/bsd.default-versions.mk"
_LUA_DEFAULT_VERSION= ${LUA_DEFAULT:S/.//}
@@ -26,8 +29,8 @@ _LUA_WANTED_VERSION:= ${_LUA_DEFAULT_VERSION}
#
# Parse one or more ver arguments
#
-.if ${lua_ARGS:M5[1-2]}
-_LUA_WANTED_VERSIONS:= ${lua_ARGS:M5[1-2]}
+.if ${lua_ARGS:M5[1-3]}
+_LUA_WANTED_VERSIONS:= ${lua_ARGS:M5[1-3]}
.endif
#
diff --git a/lang/Makefile b/lang/Makefile
index d823f3f934e1..f0b4eaae25dd 100644
--- a/lang/Makefile
+++ b/lang/Makefile
@@ -137,6 +137,7 @@
SUBDIR += lua-mode.el
SUBDIR += lua51
SUBDIR += lua52
+ SUBDIR += lua53
SUBDIR += luajit
SUBDIR += malbolge
SUBDIR += maude
diff --git a/lang/lua53/Makefile b/lang/lua53/Makefile
new file mode 100644
index 000000000000..c27ef88977b4
--- /dev/null
+++ b/lang/lua53/Makefile
@@ -0,0 +1,80 @@
+# Created by: GreenDog <fiziologus@gmail.com>
+# $FreeBSD$
+
+PORTNAME= lua
+PORTVERSION= 5.3.0
+CATEGORIES= lang
+MASTER_SITES= http://www.lua.org/ftp/
+PKGNAMESUFFIX= 53
+
+MAINTAINER= lua@FreeBSD.org
+COMMENT= Small, compilable scripting language providing easy access to C code
+
+LICENSE= MIT
+
+LUA_VER= 5.3
+LIB_DEPENDS= libedit.so.0:${PORTSDIR}/devel/libedit
+USE_LDCONFIG= yes
+
+# Overriding __MAKE_CONF makes sure that we don't re-parse
+# /etc/make.conf during do-build, which would jeopardize the build
+# if, for instance, the user set CFLAGS=mumble
+# NOTE: /etc/make.conf is read BEFORE Makefile, so we already
+# have its settings when we get here.
+# See http://wiki.freebsd.org/MatthiasAndree/LuaLessonsLearnt
+MAKE_ARGS= __MAKE_CONF=${NONEXISTENT}
+# liblua.so requires libm, so make sure it has an explicit dependency
+# so that applications need not second-guess lua's dependencies.
+CPPFLAGS+= -I${LOCALBASE}/include
+LDFLAGS+= -lm -pthread
+BUILD_WRKSRC= ${WRKSRC}/src
+MAKE_ARGS+= MYCFLAGS="${CFLAGS} ${CPPFLAGS} -DLUA_USE_LINUX" \
+ MYLDFLAGS="${LDFLAGS}" \
+ MYLIBS="-Wl,-E -L${LOCALBASE}/lib -ledit" \
+ CC="${CC}" \
+ LUA_T=lua53 \
+ LUAC_T=luac53 \
+ LUA_A=liblua-${LUA_VER}.a \
+ LUA_SO=liblua-${LUA_VER}.so \
+ LUA_SONAME=liblua-${LUA_VER}.so \
+ TO_BIN="lua53 luac53" \
+ TO_LIB="liblua-${LUA_VER}.a liblua-${LUA_VER}.so" \
+ INSTALL_TOP=${STAGEDIR}${PREFIX} \
+ INSTALL_INC=${STAGEDIR}${PREFIX}/include/lua53 \
+ INSTALL_EXEC="${INSTALL_PROGRAM}"
+
+# Cope with the lack of support for Lua 5.2 in bsd.lua.mk. These
+# overrides, which are required below, should be removed once bsd.lua.mk
+# understands this lua version.
+LUA_PREFIX?= ${PREFIX}
+LUA_SUBDIR?= lua${PKGNAMESUFFIX}
+LUA_INCDIR?= ${LUA_PREFIX}/include/${LUA_SUBDIR}
+LUA_LIBDIR?= ${LUA_PREFIX}/lib
+
+SUB_FILES= lua-${LUA_VER}.pc
+SUB_LIST= version=${PORTVERSION} \
+ includedir=${LUA_INCDIR} \
+ libdir=${LUA_LIBDIR} \
+ soname=lua-${LUA_VER}
+
+CFLAGS_amd64= -fPIC
+CFLAGS_powerpc= -fPIC
+
+post-patch:
+ @${REINPLACE_CMD} -e 's,rand *(,random(,g' \
+ ${WRKSRC}/src/lmathlib.c
+ @${REINPLACE_CMD} -e "/LUA_ROOT/s|/usr/local|${LUA_PREFIX}| ; \
+ s,readline/,editline/,g ; \
+ /history\.h/d" \
+ ${WRKSRC}/src/luaconf.h
+
+post-install:
+ @${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/liblua-${LUA_VER}.so
+ @${MV} ${STAGEDIR}${PREFIX}/man/man1/lua.1 \
+ ${STAGEDIR}${PREFIX}/man/man1/lua53.1
+ @${MV} ${STAGEDIR}${PREFIX}/man/man1/luac.1 \
+ ${STAGEDIR}${PREFIX}/man/man1/luac53.1
+ ${INSTALL_DATA} ${WRKDIR}/lua-${LUA_VER}.pc \
+ ${STAGEDIR}${PREFIX}/libdata/pkgconfig
+
+.include <bsd.port.mk>
diff --git a/lang/lua53/distinfo b/lang/lua53/distinfo
new file mode 100644
index 000000000000..cd30b9ec6ee6
--- /dev/null
+++ b/lang/lua53/distinfo
@@ -0,0 +1,2 @@
+SHA256 (lua-5.3.0.tar.gz) = ae4a5eb2d660515eb191bfe3e061f2b8ffe94dce73d32cfd0de090ddcc0ddb01
+SIZE (lua-5.3.0.tar.gz) = 278045
diff --git a/lang/lua53/files/lua-5.3.pc.in b/lang/lua53/files/lua-5.3.pc.in
new file mode 100644
index 000000000000..a9c4633ad112
--- /dev/null
+++ b/lang/lua53/files/lua-5.3.pc.in
@@ -0,0 +1,10 @@
+version=%%version%%
+libdir=%%libdir%%
+includedir=%%includedir%%
+soname=%%soname%%
+
+Name: Lua
+Description: An Extensible Extension Language
+Version: ${version}
+Libs: -L${libdir} -l${soname} -lm
+Cflags: -I${includedir}
diff --git a/lang/lua53/files/patch-src__Makefile b/lang/lua53/files/patch-src__Makefile
new file mode 100644
index 000000000000..407ab24c7ece
--- /dev/null
+++ b/lang/lua53/files/patch-src__Makefile
@@ -0,0 +1,57 @@
+--- src/Makefile.orig 2015-01-05 16:04:52 UTC
++++ src/Makefile
+@@ -6,12 +6,12 @@
+ # Your platform. See PLATS for possible values.
+ PLAT= none
+
+-CC= gcc -std=gnu99
+-CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)
++CC?= gcc -std=gnu99
++CFLAGS?= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)
+ LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
+ LIBS= -lm $(SYSLIBS) $(MYLIBS)
+
+-AR= ar rcu
++AR= ar
+ RANLIB= ranlib
+ RM= rm -f
+
+@@ -19,8 +19,8 @@ SYSCFLAGS=
+ SYSLDFLAGS=
+ SYSLIBS=
+
+-MYCFLAGS=
+-MYLDFLAGS=
++MYCFLAGS?=
++MYLDFLAGS?=
+ MYLIBS=
+ MYOBJS=
+
+@@ -38,12 +38,13 @@ BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
+
+ 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.
+@@ -55,8 +56,11 @@ o: $(ALL_O)
+
+ a: $(ALL_A)
+
++$(LUA_SO): $(CORE_O) $(LIB_O)
++ $(CC) -o $@ $(CFLAGS) $(LDFLAGS) $(MYLDFLAGS) -shared -Wl,-soname=$(LUA_SONAME) $?
++
+ $(LUA_A): $(BASE_O)
+- $(AR) $@ $(BASE_O)
++ $(AR) $(ARFLAGS) $@ $(BASE_O)
+ $(RANLIB) $@
+
+ $(LUA_T): $(LUA_O) $(LUA_A)
diff --git a/lang/lua53/files/patch-src__liolib.c b/lang/lua53/files/patch-src__liolib.c
new file mode 100644
index 000000000000..35a3db195d14
--- /dev/null
+++ b/lang/lua53/files/patch-src__liolib.c
@@ -0,0 +1,10 @@
+--- ./src/liolib.c.orig 2013-01-05 22:46:54.000000000 +0100
++++ ./src/liolib.c 2013-01-05 22:47:32.000000000 +0100
+@@ -19,6 +19,7 @@
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
++#include <unistd.h>
+
+ #define liolib_c
+ #define LUA_LIB
diff --git a/lang/lua53/pkg-descr b/lang/lua53/pkg-descr
new file mode 100644
index 000000000000..d0ed8afbd09c
--- /dev/null
+++ b/lang/lua53/pkg-descr
@@ -0,0 +1,21 @@
+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: http://www.lua.org/
diff --git a/lang/lua53/pkg-plist b/lang/lua53/pkg-plist
new file mode 100644
index 000000000000..e033913eef47
--- /dev/null
+++ b/lang/lua53/pkg-plist
@@ -0,0 +1,14 @@
+bin/lua53
+bin/luac53
+include/lua53/lauxlib.h
+include/lua53/lua.h
+include/lua53/lua.hpp
+include/lua53/luaconf.h
+include/lua53/lualib.h
+lib/liblua-5.3.a
+lib/liblua-5.3.so
+libdata/pkgconfig/lua-5.3.pc
+man/man1/lua53.1.gz
+man/man1/luac53.1.gz
+@dir lib/lua/5.3
+@dir %%DATADIR%%/5.3