Import ports/lang/lua/5.3. ok jasper@

Lua is a powerful, light-weight programming language designed for
extending applications.  Lua is also frequently used as a
general-purpose, stand-alone language.
This commit is contained in:
jturner 2015-01-14 20:06:36 +00:00
parent bce509b386
commit b4ab9e20b9
9 changed files with 188 additions and 0 deletions

19
lang/lua/5.3/Makefile Normal file
View File

@ -0,0 +1,19 @@
# $OpenBSD: Makefile,v 1.1.1.1 2015/01/14 20:06:36 jturner Exp $
VERSION= 5.3.0
PKGSPEC= lua->=5.3,<5.4
SHARED_LIBS= lua5.3 ${VERSION:R}
WANTLIB= c m edit curses
SUBST_VARS+= VERSION
MAKE_FLAGS+= LIBlua5.3_VERSION="${LIBlua5.3_VERSION}"
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/lib/pkgconfig
${SUBST_DATA} -c ${FILESDIR}/lua53.pc \
${PREFIX}/lib/pkgconfig/lua53.pc
.include <bsd.port.mk>

2
lang/lua/5.3/distinfo Normal file
View File

@ -0,0 +1,2 @@
SHA256 (lua-5.3.0.tar.gz) = rkpestZgUV6xkb/j4GHyuP/pTc5z0yz9DeCQ3cwN2wE=
SIZE (lua-5.3.0.tar.gz) = 278045

View File

@ -0,0 +1,11 @@
version=${VERSION}
prefix=${TRUEPREFIX}
libdir=${TRUEPREFIX}/lib
includedir=${TRUEPREFIX}/include/lua-5.3
Name: Lua
Description: An Extensible Extension Language
Version: ${VERSION}
Requires:
Libs: -L${libdir} -llua5.3 -lm
Cflags: -I${includedir}

View File

@ -0,0 +1,44 @@
$OpenBSD: patch-Makefile,v 1.1.1.1 2015/01/14 20:06:36 jturner Exp $
--- Makefile.orig Wed Oct 29 19:14:41 2014
+++ Makefile Mon Jan 12 14:15:22 2015
@@ -4,15 +4,15 @@
# == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT =======================
# Your platform. See PLATS for possible values.
-PLAT= none
+PLAT= bsd
# Where to install. The installation starts in the src and doc directories,
# so take care if INSTALL_TOP is not an absolute path. See the local target.
# You may want to make INSTALL_LMOD and INSTALL_CMOD consistent with
# LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h.
-INSTALL_TOP= /usr/local
+INSTALL_TOP= $(PREFIX)
INSTALL_BIN= $(INSTALL_TOP)/bin
-INSTALL_INC= $(INSTALL_TOP)/include
+INSTALL_INC= $(INSTALL_TOP)/include/lua-5.3
INSTALL_LIB= $(INSTALL_TOP)/lib
INSTALL_MAN= $(INSTALL_TOP)/man/man1
INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
@@ -39,9 +39,9 @@ RM= rm -f
PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
# What to install.
-TO_BIN= lua luac
+TO_BIN= lua53 luac53
TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
-TO_LIB= liblua.a
+TO_LIB= liblua5.3.a liblua5.3.so.${LIBlua5.3_VERSION}
TO_MAN= lua.1 luac.1
# Lua version and release.
@@ -62,7 +62,8 @@ install: dummy
cd src && $(INSTALL_EXEC) $(TO_BIN) $(INSTALL_BIN)
cd src && $(INSTALL_DATA) $(TO_INC) $(INSTALL_INC)
cd src && $(INSTALL_DATA) $(TO_LIB) $(INSTALL_LIB)
- cd doc && $(INSTALL_DATA) $(TO_MAN) $(INSTALL_MAN)
+ cd doc && $(INSTALL_DATA) lua.1 $(INSTALL_MAN)/lua53.1
+ cd doc && $(INSTALL_DATA) luac.1 $(INSTALL_MAN)/luac53.1
uninstall:
cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN)

View File

@ -0,0 +1,60 @@
$OpenBSD: patch-src_Makefile,v 1.1.1.1 2015/01/14 20:06:36 jturner Exp $
--- src/Makefile.orig Mon Jan 12 14:06:41 2015
+++ src/Makefile Mon Jan 12 14:08:28 2015
@@ -6,8 +6,7 @@
# Your platform. See PLATS for possible values.
PLAT= none
-CC= gcc -std=gnu99
-CFLAGS= -O2 -Wall -Wextra -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)
+CFLAGS+= $(MYCFLAGS) -std=gnu99 -fPIC -DLUA_COMPAT_5_2 $(SYSCFLAGS)
LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
LIBS= -lm $(SYSLIBS) $(MYLIBS)
@@ -28,7 +27,7 @@ MYOBJS=
PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
-LUA_A= liblua.a
+LUA_A= liblua5.3.a
CORE_O= lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o \
lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o \
ltm.o lundump.o lvm.o lzio.o
@@ -36,14 +35,15 @@ LIB_O= lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldbli
lmathlib.o loslib.o lstrlib.o ltablib.o lutf8lib.o loadlib.o linit.o
BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
-LUA_T= lua
+LUA_T= lua53
LUA_O= lua.o
+LUA_SO= liblua5.3.so.${LIBlua5.3_VERSION}
-LUAC_T= luac
+LUAC_T= luac53
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.
@@ -62,6 +62,9 @@ $(LUA_A): $(BASE_O)
$(LUA_T): $(LUA_O) $(LUA_A)
$(CC) -o $@ $(LDFLAGS) $(LUA_O) $(LUA_A) $(LIBS)
+$(LUA_SO): $(CORE_O) $(LIB_O)
+ $(CC) -o $@ -shared -fPIC $(MYLDFLAGS) $(CORE_O) $(LIB_O)
+
$(LUAC_T): $(LUAC_O) $(LUA_A)
$(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
@@ -92,7 +95,7 @@ aix:
$(MAKE) $(ALL) CC="xlc" CFLAGS="-O2 -DLUA_USE_POSIX -DLUA_USE_DLOPEN" SYSLIBS="-ldl" SYSLDFLAGS="-brtl -bexpall"
bsd:
- $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" SYSLIBS="-Wl,-E"
+ $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_BSD" SYSLIBS="-Wl,-E -ledit -lcurses"
c89:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_C89" CC="gcc -std=c89"

View File

@ -0,0 +1,17 @@
$OpenBSD: patch-src_lmathlib_c,v 1.1.1.1 2015/01/14 20:06:36 jturner Exp $
--- src/lmathlib.c.orig Mon Jan 12 14:06:55 2015
+++ src/lmathlib.c Mon Jan 12 14:07:08 2015
@@ -26,11 +26,11 @@
#if !defined(l_rand) /* { */
#if defined(LUA_USE_POSIX)
#define l_rand() random()
-#define l_srand(x) srandom(x)
+#define l_srand(x) srandom_deterministic(x)
#define L_RANDMAX 2147483647 /* (2^31 - 1), following POSIX */
#else
#define l_rand() rand()
-#define l_srand(x) srand(x)
+#define l_srand(x) srand_deterministic(x)
#define L_RANDMAX RAND_MAX
#endif
#endif /* } */

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_luaconf_h,v 1.1.1.1 2015/01/14 20:06:36 jturner Exp $
--- src/luaconf.h.orig Mon Jan 12 14:06:50 2015
+++ src/luaconf.h Mon Jan 12 14:07:04 2015
@@ -58,7 +58,7 @@
#endif
-#if defined(LUA_USE_LINUX)
+#if defined(LUA_USE_BSD) || defined(LUA_USE_LINUX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
#define LUA_USE_READLINE /* needs some extra libraries */

3
lang/lua/5.3/pkg/DESCR Normal file
View File

@ -0,0 +1,3 @@
Lua is a powerful, light-weight programming language designed for
extending applications. Lua is also frequently used as a
general-purpose, stand-alone language.

20
lang/lua/5.3/pkg/PLIST Normal file
View File

@ -0,0 +1,20 @@
@comment $OpenBSD: PLIST,v 1.1.1.1 2015/01/14 20:06:36 jturner Exp $
@option no-default-conflict
@conflict lua->=5.3,<5.4
@bin bin/lua53
@bin bin/luac53
include/lua-5.3/
include/lua-5.3/lauxlib.h
include/lua-5.3/lua.h
include/lua-5.3/lua.hpp
include/lua-5.3/luaconf.h
include/lua-5.3/lualib.h
lib/liblua5.3.a
@lib lib/liblua5.3.so.${LIBlua5.3_VERSION}
lib/lua/
lib/lua/5.3/
lib/pkgconfig/lua53.pc
@man man/man1/lua53.1
@man man/man1/luac53.1
share/lua/
share/lua/5.3/