add lua 5.2

This commit is contained in:
jasper 2012-07-10 15:06:21 +00:00
parent 4d5f9beaf3
commit 511ec1da34
8 changed files with 177 additions and 0 deletions

20
lang/lua/5.2/Makefile Normal file
View File

@ -0,0 +1,20 @@
# $OpenBSD: Makefile,v 1.1 2012/07/10 15:06:21 jasper Exp $
VERSION= 5.2.0
PKGSPEC= lua->=5.2,<5.3
SHARED_LIBS= lua5.2 ${VERSION:R}
WANTLIB= c m edit curses
SUBST_VARS+= VERSION
MAKE_FLAGS+= LIBlua5.2_VERSION="${LIBlua5.2_VERSION}"
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/lib/pkgconfig
${SUBST_CMD} -o ${SHAREOWN} -g ${SHAREGRP} -c ${FILESDIR}/lua52.pc \
${PREFIX}/lib/pkgconfig/lua52.pc
.include <bsd.port.mk>

5
lang/lua/5.2/distinfo Normal file
View File

@ -0,0 +1,5 @@
MD5 (lua-5.2.0.tar.gz) = 8eqDHzlyFLroomWZWrGpPg==
RMD160 (lua-5.2.0.tar.gz) = YVO93VdJNJC3LnAMyZE1Qyv2U/A=
SHA1 (lua-5.2.0.tar.gz) = CPhMNVzdZG9hfwnOvqSL2DJBWCk=
SHA256 (lua-5.2.0.tar.gz) = yr43lGWqjjiJiAc9WbaedroAJUKdLB2oCCGiUs32vg0=
SIZE (lua-5.2.0.tar.gz) = 246377

View File

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

View File

@ -0,0 +1,44 @@
$OpenBSD: patch-Makefile,v 1.1 2012/07/10 15:06:21 jasper Exp $
--- Makefile.orig Wed Nov 16 00:38:12 2011
+++ Makefile Sat May 12 14:32:43 2012
@@ -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.2
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 ansi bsd freebsd generic linux macosx mingw posix solaris
# What to install.
-TO_BIN= lua luac
+TO_BIN= lua52 luac52
TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
-TO_LIB= liblua.a
+TO_LIB= liblua5.2.a liblua5.2.so.${LIBlua5.2_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)/lua52.1
+ cd doc && $(INSTALL_DATA) luac.1 $(INSTALL_MAN)/luac52.1
uninstall:
cd src && cd $(INSTALL_BIN) && $(RM) $(TO_BIN)

View File

@ -0,0 +1,60 @@
$OpenBSD: patch-src_Makefile,v 1.1 2012/07/10 15:06:21 jasper Exp $
--- src/Makefile.orig Mon Sep 19 14:45:14 2011
+++ src/Makefile Sat May 12 14:19:29 2012
@@ -6,8 +6,7 @@
# Your platform. See PLATS for possible values.
PLAT= none
-CC= gcc
-CFLAGS= -O2 -Wall -DLUA_COMPAT_ALL $(SYSCFLAGS) $(MYCFLAGS)
+CFLAGS+= $(MYCFLAGS) -fPIC -DLUA_COMPAT_ALL $(SYSCFLAGS)
LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
LIBS= -lm $(SYSLIBS) $(MYLIBS)
@@ -28,7 +27,7 @@ MYOBJS=
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
-LUA_A= liblua.a
+LUA_A= liblua5.2.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 loadlib.o linit.o
BASE_O= $(CORE_O) $(LIB_O) $(MYOBJS)
-LUA_T= lua
+LUA_T= lua52
LUA_O= lua.o
+LUA_SO= liblua5.2.so.${LIBlua5.2_VERSION}
-LUAC_T= luac
+LUAC_T= luac52
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)
@@ -95,7 +98,7 @@ ansi:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_ANSI"
bsd:
- $(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" SYSLIBS="-Wl,-E"
+ $(MAKE) $(ALL) SYSCFLAGS=-DLUA_USE_BSD SYSLIBS="-Wl,-E -ledit -lcurses"
freebsd:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -lreadline"

View File

@ -0,0 +1,13 @@
$OpenBSD: patch-src_luaconf_h,v 1.1 2012/07/10 15:06:21 jasper Exp $
--- src/luaconf.h.orig Thu May 10 22:53:52 2012
+++ src/luaconf.h Thu May 10 22:54:16 2012
@@ -39,8 +39,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.2/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.

21
lang/lua/5.2/pkg/PLIST Normal file
View File

@ -0,0 +1,21 @@
@comment $OpenBSD: PLIST,v 1.1 2012/07/10 15:06:21 jasper Exp $
@option no-default-conflict
@conflict lua->=5.2,<5.3
@bin bin/lua52
@bin bin/luac52
include/lua-5.2/
include/lua-5.2/lauxlib.h
include/lua-5.2/lua.h
include/lua-5.2/lua.hpp
include/lua-5.2/luaconf.h
include/lua-5.2/lualib.h
lib/liblua5.2.a
@lib lib/liblua5.2.so.${LIBlua5.2_VERSION}
lib/lua/
lib/lua/5.2/
lib/pkgconfig/
lib/pkgconfig/lua52.pc
@man man/man1/lua52.1
@man man/man1/luac52.1
share/lua/
share/lua/5.2/