Move lua 5.1 into it's own directory

This commit is contained in:
jasper 2012-07-10 15:04:52 +00:00
parent 7a50e70a56
commit 4d5f9beaf3
8 changed files with 203 additions and 0 deletions

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

@ -0,0 +1,20 @@
# $OpenBSD: Makefile,v 1.1 2012/07/10 15:04:52 jasper Exp $
VERSION= 5.1.5
PKGSPEC= lua->=5.1,<5.2
REVISION= 0
SHARED_LIBS= lua5.1 ${VERSION:R}
WANTLIB= c m edit curses
MAKE_FLAGS+= LIBlua5.1_VERSION="${LIBlua5.1_VERSION}"
pre-configure:
${SUBST_CMD} ${WRKSRC}/etc/lua.pc
post-install:
${INSTALL_DATA_DIR} ${PREFIX}/lib/pkgconfig
${INSTALL_DATA} ${WRKSRC}/etc/lua.pc ${PREFIX}/lib/pkgconfig/lua51.pc
.include <bsd.port.mk>

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

@ -0,0 +1,5 @@
MD5 (lua-5.1.5.tar.gz) = LhFf4m5DXjOw1cAi5EkFZw==
RMD160 (lua-5.1.5.tar.gz) = sMIjRnUzWovxWKEltneM+ADHVKA=
SHA1 (lua-5.1.5.tar.gz) = s4ghEa0C7Ma5cvjBJBZHkFyy4/w=
SHA256 (lua-5.1.5.tar.gz) = JkD8VqeV8p0o7xXhPDSkfiI5YLAkDoywqC2bBzhpUzM=
SIZE (lua-5.1.5.tar.gz) = 221213

View File

@ -0,0 +1,42 @@
$OpenBSD: patch-Makefile,v 1.1 2012/07/10 15:04:52 jasper Exp $
--- Makefile.orig Fri Feb 10 10:50:23 2012
+++ Makefile Sat May 12 14:31:52 2012
@@ -5,13 +5,13 @@
# == 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.
-INSTALL_TOP= /usr/local
+INSTALL_TOP= $(PREFIX)
INSTALL_BIN= $(INSTALL_TOP)/bin
-INSTALL_INC= $(INSTALL_TOP)/include
+INSTALL_INC= $(INSTALL_TOP)/include/lua-5.1
INSTALL_LIB= $(INSTALL_TOP)/lib
INSTALL_MAN= $(INSTALL_TOP)/man/man1
#
@@ -41,9 +41,9 @@ RANLIB= ranlib
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
# What to install.
-TO_BIN= lua luac
+TO_BIN= lua51 luac51
TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
-TO_LIB= liblua.a
+TO_LIB= liblua5.1.a liblua5.1.so.${LIBlua5.1_VERSION}
TO_MAN= lua.1 luac.1
# Lua version and release.
@@ -63,7 +63,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)/lua51.1
+ cd doc && $(INSTALL_DATA) luac.1 $(INSTALL_MAN)/luac51.1
ranlib:
cd src && cd $(INSTALL_LIB) && $(RANLIB) $(TO_LIB)

View File

@ -0,0 +1,31 @@
$OpenBSD: patch-etc_lua_pc,v 1.1 2012/07/10 15:04:52 jasper Exp $
--- etc/lua.pc.orig Fri Feb 10 10:50:30 2012
+++ etc/lua.pc Sat May 12 14:42:04 2012
@@ -8,9 +8,9 @@ V= 5.1
R= 5.1.5
# grep '^INSTALL_.*=' ../Makefile | sed 's/INSTALL_TOP/prefix/'
-prefix= /usr/local
+prefix= ${PREFIX}
INSTALL_BIN= ${prefix}/bin
-INSTALL_INC= ${prefix}/include
+INSTALL_INC= ${prefix}/include/lua-5.1
INSTALL_LIB= ${prefix}/lib
INSTALL_MAN= ${prefix}/man/man1
INSTALL_LMOD= ${prefix}/share/lua/${V}
@@ -19,13 +19,13 @@ INSTALL_CMOD= ${prefix}/lib/lua/${V}
# canonical vars
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
-includedir=${prefix}/include
+includedir=${prefix}/include/lua-5.1
Name: Lua
Description: An Extensible Extension Language
Version: ${R}
Requires:
-Libs: -L${libdir} -llua -lm
+Libs: -L${libdir} -llua5.1 -lm
Cflags: -I${includedir}
# (end of lua.pc)

View File

@ -0,0 +1,68 @@
$OpenBSD: patch-src_Makefile,v 1.1 2012/07/10 15:04:52 jasper Exp $
--- src/Makefile.orig Mon Feb 13 21:41:22 2012
+++ src/Makefile Sat May 12 14:18:20 2012
@@ -7,8 +7,7 @@
# Your platform. See PLATS for possible values.
PLAT= none
-CC= gcc
-CFLAGS= -O2 -Wall $(MYCFLAGS)
+CFLAGS+= $(MYCFLAGS) -fPIC
AR= ar rcu
RANLIB= ranlib
RM= rm -f
@@ -22,21 +21,22 @@ MYLIBS=
PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
-LUA_A= liblua.a
+LUA_A= liblua5.1.a
CORE_O= lapi.o lcode.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
LIB_O= lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o loslib.o ltablib.o \
lstrlib.o loadlib.o linit.o
-LUA_T= lua
+LUA_T= lua51
LUA_O= lua.o
-LUAC_T= luac
+LUAC_T= luac51
LUAC_O= luac.o print.o
+LUA_SO= liblua5.1.so.${LIBlua5.1_VERSION}
ALL_O= $(CORE_O) $(LIB_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)
default: $(PLAT)
@@ -48,7 +48,7 @@ o: $(ALL_O)
a: $(ALL_A)
$(LUA_A): $(CORE_O) $(LIB_O)
- $(AR) $@ $(CORE_O) $(LIB_O) # DLL needs all object files
+ $(AR) $@ $(CORE_O) $(LIB_O)
$(RANLIB) $@
$(LUA_T): $(LUA_O) $(LUA_A)
@@ -57,6 +57,9 @@ $(LUA_T): $(LUA_O) $(LUA_A)
$(LUAC_T): $(LUAC_O) $(LUA_A)
$(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+$(LUA_SO): $(CORE_O) $(LIB_O)
+ $(CC) -o $@ -shared -fPIC $(MYLDFLAGS) $(CORE_O) $(LIB_O)
+
clean:
$(RM) $(ALL_T) $(ALL_O)
@@ -87,7 +90,7 @@ ansi:
$(MAKE) all MYCFLAGS=-DLUA_ANSI
bsd:
- $(MAKE) all MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN" MYLIBS="-Wl,-E"
+ $(MAKE) all MYCFLAGS=-DLUA_USE_BSD MYLIBS="-Wl,-E -ledit -lcurses"
freebsd:
$(MAKE) all MYCFLAGS="-DLUA_USE_LINUX" MYLIBS="-Wl,-E -lreadline"

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_luaconf_h,v 1.1 2012/07/10 15:04:52 jasper Exp $
--- src/luaconf.h.orig Fri Jan 18 18:07:48 2008
+++ src/luaconf.h Mon Mar 24 13:53:08 2008
@@ -33,7 +33,7 @@
#define LUA_WIN
#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.1/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.

22
lang/lua/5.1/pkg/PLIST Normal file
View File

@ -0,0 +1,22 @@
@comment $OpenBSD: PLIST,v 1.1 2012/07/10 15:04:52 jasper Exp $
@option no-default-conflict
@conflict lua->=5.1.5,<5.2
@pkgpath lang/lua
@bin bin/lua51
@bin bin/luac51
include/lua-5.1/
include/lua-5.1/lauxlib.h
include/lua-5.1/lua.h
include/lua-5.1/lua.hpp
include/lua-5.1/luaconf.h
include/lua-5.1/lualib.h
lib/liblua5.1.a
@lib lib/liblua5.1.so.${LIBlua5.1_VERSION}
lib/lua/
lib/lua/5.1/
lib/pkgconfig/
lib/pkgconfig/lua51.pc
@man man/man1/lua51.1
@man man/man1/luac51.1
share/lua/
share/lua/5.1/