lua: bump version.

* remove oldest recipes.
This commit is contained in:
Jerome Duval
2015-08-11 17:17:01 +00:00
parent cf9f4629d6
commit 9b3fcef5c0
8 changed files with 231 additions and 700 deletions

View File

@@ -1,78 +0,0 @@
SUMMARY="A powerful, fast, light-weight, embeddable scripting language"
DESCRIPTION="Lua combines simple procedural syntax with powerful data \
description constructs based on associative arrays and extensible semantics. \
Lua is dynamically typed, runs by interpreting bytecode for a register-based \
virtual machine, and has automatic memory management with incremental garbage \
collection, making it ideal for configuration, scripting, and rapid \
prototyping."
HOMEPAGE="http://www.lua.org"
LICENSE="MIT"
REVISION="6"
ARCHITECTURES="x86 x86_gcc2"
SECONDARY_ARCHITECTURES="x86 x86_gcc2"
SOURCE_URI="http://www.lua.org/ftp/lua-5.1.4.tar.gz"
CHECKSUM_SHA256="b038e225eaf2a5b57c9bcc35cd13aa8c6c8288ef493d52970c9545074098af3a"
COPYRIGHT="1994-2009, Lua.org, PUC-Rio"
PATCHES="lua-5.1.4.patchset"
PROVIDES="
lua${secondaryArchSuffix} = $portVersion compat >= 5.1
cmd:lua${secondaryArchSuffix} = $portVersion compat >= 5.1
cmd:lua5.1${secondaryArchSuffix} = $portVersion compat >= 5.1
cmd:luac${secondaryArchSuffix} = $portVersion compat >= 5.1
lib:liblua${secondaryArchSuffix} = $portVersion compat >= 5.1
"
REQUIRES="
haiku${secondaryArchSuffix}
"
PROVIDES_devel="
lua${secondaryArchSuffix}_devel = $portVersion compat >= 5.1
devel:liblua$secondaryArchSuffix = $portVersion compat >= 5.1
devel:liblua5.1$secondaryArchSuffix = $portVersion compat >= 5.1
"
REQUIRES_devel="
lua$secondaryArchSuffix == $portVersion
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
haiku${secondaryArchSuffix}_devel
cmd:make
cmd:gcc${secondaryArchSuffix}
"
BUILD()
{
make haiku
}
INSTALL()
{
make install INSTALL_TOP="$prefix" INSTALL_MAN="$manDir/man1" \
INSTALL_INC="$includeDir/lua5.1" INSTALL_LMOD="$dataDir/lua/5.1" \
INSTALL_LIB="$libDir" INSTALL_BIN="$binDir"
mkdir -p $libDir/pkgconfig
cp etc/lua.pc $libDir/pkgconfig/lua.pc
ln -s liblua.so $libDir/liblua.so.5.1
ln -s liblua.a $libDir/liblua5.1.a
mv $binDir/lua $binDir/lua5.1
ln -s $binDir/lua5.1 $binDir/lua
prepareInstalledDevelLib liblua
prepareInstalledDevelLib liblua5.1
fixPkgconfig
# The includes are in a subdirectory of includeDir, and fixPkgconfig breaks
# that.
sed -i -e "s,^includedir=.*,includedir=$prefix/$relativeIncludeDir/lua5.1," \
$developLibDir/pkgconfig/lua.pc
packageEntries devel $developDir
}

View File

@@ -1,66 +0,0 @@
SUMMARY="A powerful, fast, light-weight, embeddable scripting language"
DESCRIPTION="Lua combines simple procedural syntax with powerful data \
description constructs based on associative arrays and extensible semantics. \
Lua is dynamically typed, runs by interpreting bytecode for a register-based \
virtual machine, and has automatic memory management with incremental garbage \
collection, making it ideal for configuration, scripting, and rapid \
prototyping."
HOMEPAGE="http://www.lua.org"
LICENSE="MIT"
REVISION="7"
ARCHITECTURES="x86 x86_gcc2"
SECONDARY_ARCHITECTURES="x86"
SOURCE_URI="http://www.lua.org/ftp/lua-$portVersion.tar.gz"
CHECKSUM_SHA256="64304da87976133196f9e4c15250b70f444467b6ed80d7cfd7b3b982b5177be5"
COPYRIGHT="1994-2012, Lua.org, PUC-Rio"
PATCHES="lua-$portVersion.patchset"
PROVIDES="
lua$secondaryArchSuffix = $portVersion compat >= 5.2
cmd:lua$secondaryArchSuffix = $portVersion compat >= 5.2
cmd:lua5.2$secondaryArchSuffix = $portVersion compat >= 5.2
cmd:luac$secondaryArchSuffix = $portVersion compat >= 5.2
lib:liblua$secondaryArchSuffix = $portVersion compat >= 5.2
"
REQUIRES="
haiku$secondaryArchSuffix
"
PROVIDES_devel="
lua${secondaryArchSuffix}_devel = $portVersion compat >= 5.2
devel:liblua$secondaryArchSuffix = $portVersion compat >= 5.2
devel:liblua52$secondaryArchSuffix = $portVersion compat >= 5.2
"
REQUIRES_devel="
lua$secondaryArchSuffix == $portVersion
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
"
BUILD_PREREQUIRES="
cmd:make
cmd:gcc$secondaryArchSuffix
"
BUILD()
{
make haiku MYCFLAGS="-DLUA_ROOT='\"$prefix/\"' -DLUA_LDIR='\"$dataDir/lua/5.2/\"'"
}
INSTALL()
{
make install INSTALL_TOP="$prefix" INSTALL_MAN="$manDir/man1" \
INSTALL_INC="$includeDir/lua52" INSTALL_LMOD="$dataDir/lua/5.2" \
INSTALL_LIB="$libDir" INSTALL_BIN="$binDir"
ln -s liblua.so $libDir/liblua.so.5.2
ln -s liblua.a $libDir/liblua52.a
mv $binDir/lua $binDir/lua5.2
ln -s $binDir/lua5.2 $binDir/lua
prepareInstalledDevelLib liblua
prepareInstalledDevelLib liblua52
packageEntries devel $developDir
}

View File

@@ -0,0 +1,94 @@
SUMMARY="A powerful, fast, light-weight, embeddable scripting language"
DESCRIPTION="
Lua combines simple procedural syntax with powerful data description \
constructs based on associative arrays and extensible semantics. Lua is \
dynamically typed, runs by interpreting bytecode for a register-based virtual \
machine, and has automatic memory management with incremental garbage \
collection, making it ideal for configuration, scripting, and rapid prototyping.
"
HOMEPAGE="http://www.lua.org"
SOURCE_URI="http://www.lua.org/ftp/lua-$portVersion.tar.gz"
CHECKSUM_SHA256="072767aad6cc2e62044a66e8562f51770d941e972dc1e4068ba719cd8bffac17"
LICENSE="MIT"
COPYRIGHT="1994-2012, Lua.org, PUC-Rio"
REVISION="1"
ARCHITECTURES="x86 x86_gcc2 x86_64"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
lua$secondaryArchSuffix = $portVersion compat >= 5.3
cmd:lua$secondaryArchSuffix = $portVersion compat >= 5.3
cmd:lua5.3$secondaryArchSuffix = $portVersion compat >= 5.3
cmd:luac$secondaryArchSuffix = $portVersion compat >= 5.3
lib:liblua$secondaryArchSuffix = $portVersion compat >= 5.3
"
REQUIRES="
haiku$secondaryArchSuffix
"
BUILD_PREREQUIRES="
haiku${secondaryArchSuffix}_devel
cmd:make
cmd:gcc$secondaryArchSuffix
"
PROVIDES_devel="
lua${secondaryArchSuffix}_devel = $portVersion compat >= 5.3
devel:liblua$secondaryArchSuffix = $portVersion compat >= 5.3
devel:liblua53$secondaryArchSuffix = $portVersion compat >= 5.3
"
REQUIRES_devel="
lua$secondaryArchSuffix == $portVersion
"
PATCHES="lua-$portVersion.patchset"
if [ $effectiveTargetArchitecture = x86_gcc2 ]; then
PATCHES+="
lua-$portVersion.gcc2.patchset
"
fi
BUILD()
{
make haiku MYCFLAGS="-DLUA_ROOT='\"$prefix/\"' -DLUA_LDIR='\"$dataDir/lua/5.3/\"'"
}
INSTALL()
{
make install INSTALL_TOP="$prefix" INSTALL_MAN="$manDir/man1" \
INSTALL_INC="$includeDir/lua53" INSTALL_LMOD="$dataDir/lua/5.3" \
INSTALL_LIB="$libDir" INSTALL_BIN="$binDir"
ln -s liblua.so $libDir/liblua.so.5.3
ln -s liblua.a $libDir/liblua53.a
mv $binDir/lua $binDir/lua5.3
ln -s lua5.3 $binDir/lua
mkdir -p $developLibDir/pkgconfig
cat > $developLibDir/pkgconfig/lua.pc << EOF
V=5.3
R=5.3.1
INSTALL_BIN=$binDir
INSTALL_INC=$includeDir
INSTALL_LIB=$libDir
INSTALL_MAN=$manDir
INSTALL_LMOD=${dataDir}/lua/\${V}
INSTALL_CMOD=${libDir}/lua/\${V}
exec_prefix=$prefix
libdir=$libDir
includedir=$includeDir
Name: Lua
Description: An Extensible Extension Language
Version: \${R}
Requires:
Libs: -L\${libdir} -llua
Cflags: -I\${includedir}/lua53
EOF
prepareInstalledDevelLib liblua
prepareInstalledDevelLib liblua53
packageEntries devel $developDir
}

View File

@@ -1,276 +0,0 @@
diff -urN lua-5.1.4/Makefile lua-5.1.4-haiku/Makefile
--- lua-5.1.4/Makefile 2008-08-12 00:40:48.066322432 +0000
+++ lua-5.1.4-haiku/Makefile 2011-05-03 22:29:07.568328192 +0000
@@ -13,11 +13,11 @@
INSTALL_BIN= $(INSTALL_TOP)/bin
INSTALL_INC= $(INSTALL_TOP)/include
INSTALL_LIB= $(INSTALL_TOP)/lib
-INSTALL_MAN= $(INSTALL_TOP)/man/man1
+INSTALL_MAN= `finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man/man1
#
# You probably want to make INSTALL_LMOD and INSTALL_CMOD consistent with
# LUA_ROOT, LUA_LDIR, and LUA_CDIR in luaconf.h (and also with etc/lua.pc).
-INSTALL_LMOD= $(INSTALL_TOP)/share/lua/$V
+INSTALL_LMOD= `finddir B_COMMON_DATA_DIRECTORY`/lua/$V
INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
# How to install. If your install program does not support "-p", then you
@@ -38,12 +38,12 @@
# == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
# Convenience platforms targets.
-PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
+PLATS= aix ansi bsd freebsd generic haiku linux macosx mingw posix solaris
# What to install.
TO_BIN= lua luac
TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
-TO_LIB= liblua.a
+TO_LIB= liblua.a liblua.so
TO_MAN= lua.1 luac.1
# Lua version and release.
diff -urN lua-5.1.4/src/Makefile lua-5.1.4-haiku/src/Makefile
--- lua-5.1.4/src/Makefile 2008-01-19 19:37:58.066584576 +0000
+++ lua-5.1.4-haiku/src/Makefile 2011-05-03 22:08:17.191627264 +0000
@@ -20,9 +20,10 @@
# == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
-PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
+PLATS= aix ansi bsd freebsd generic haiku linux macosx mingw posix solaris
LUA_A= liblua.a
+LUA_SO= liblua.so
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
@@ -36,7 +37,7 @@
LUAC_O= luac.o print.o
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)
@@ -57,6 +58,9 @@
$(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) $? $(LIBS)
+
clean:
$(RM) $(ALL_T) $(ALL_O)
@@ -95,6 +99,9 @@
generic:
$(MAKE) all MYCFLAGS=
+haiku:
+ $(MAKE) all MYCFLAGS=-DLUA_USE_HAIKU LIBS=
+
linux:
$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
diff -urN lua-5.1.4/src/lcode.c lua-5.1.4-haiku/src/lcode.c
--- lua-5.1.4/src/lcode.c 2007-12-28 15:32:23.000262144 +0000
+++ lua-5.1.4-haiku/src/lcode.c 2011-05-03 22:06:13.312999936 +0000
@@ -1,5 +1,5 @@
/*
-** $Id: lcode.c,v 2.25.1.3 2007/12/28 15:32:23 roberto Exp $
+** $Id: lcode.c,v 2.25.1.5 2011/01/31 14:53:16 roberto Exp $
** Code generator for Lua
** See Copyright Notice in lua.h
*/
@@ -544,10 +544,6 @@
pc = NO_JUMP; /* always true; do nothing */
break;
}
- case VFALSE: {
- pc = luaK_jump(fs); /* always jump */
- break;
- }
case VJMP: {
invertjump(fs, e);
pc = e->u.s.info;
@@ -572,10 +568,6 @@
pc = NO_JUMP; /* always false; do nothing */
break;
}
- case VTRUE: {
- pc = luaK_jump(fs); /* always jump */
- break;
- }
case VJMP: {
pc = e->u.s.info;
break;
diff -urN lua-5.1.4/src/ldblib.c lua-5.1.4-haiku/src/ldblib.c
--- lua-5.1.4/src/ldblib.c 2008-01-21 13:11:21.000262144 +0000
+++ lua-5.1.4-haiku/src/ldblib.c 2011-05-03 22:06:13.322699264 +0000
@@ -1,5 +1,5 @@
/*
-** $Id: ldblib.c,v 1.104.1.3 2008/01/21 13:11:21 roberto Exp $
+** $Id: ldblib.c,v 1.104.1.4 2009/08/04 18:50:18 roberto Exp $
** Interface from Lua to its debug API
** See Copyright Notice in lua.h
*/
@@ -45,6 +45,7 @@
static int db_getfenv (lua_State *L) {
+ luaL_checkany(L, 1);
lua_getfenv(L, 1);
return 1;
}
diff -urN lua-5.1.4/src/liolib.c lua-5.1.4-haiku/src/liolib.c
--- lua-5.1.4/src/liolib.c 2008-01-18 17:47:43.001572864 +0000
+++ lua-5.1.4-haiku/src/liolib.c 2011-05-03 22:06:13.346292224 +0000
@@ -1,5 +1,5 @@
/*
-** $Id: liolib.c,v 2.73.1.3 2008/01/18 17:47:43 roberto Exp $
+** $Id: liolib.c,v 2.73.1.4 2010/05/14 15:33:51 roberto Exp $
** Standard I/O (and system) library
** See Copyright Notice in lua.h
*/
@@ -276,7 +276,10 @@
lua_pushnumber(L, d);
return 1;
}
- else return 0; /* read fails */
+ else {
+ lua_pushnil(L); /* "result" to be removed */
+ return 0; /* read fails */
+ }
}
diff -urN lua-5.1.4/src/llex.c lua-5.1.4-haiku/src/llex.c
--- lua-5.1.4/src/llex.c 2007-12-27 13:02:25.001835008 +0000
+++ lua-5.1.4-haiku/src/llex.c 2011-05-03 22:06:13.368050176 +0000
@@ -1,5 +1,5 @@
/*
-** $Id: llex.c,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $
+** $Id: llex.c,v 2.20.1.2 2009/11/23 14:58:22 roberto Exp $
** Lexical Analyzer
** See Copyright Notice in lua.h
*/
@@ -118,8 +118,10 @@
lua_State *L = ls->L;
TString *ts = luaS_newlstr(L, str, l);
TValue *o = luaH_setstr(L, ls->fs->h, ts); /* entry for `str' */
- if (ttisnil(o))
+ if (ttisnil(o)) {
setbvalue(o, 1); /* make sure `str' will not be collected */
+ luaC_checkGC(L);
+ }
return ts;
}
diff -urN lua-5.1.4/src/loadlib.c lua-5.1.4-haiku/src/loadlib.c
--- lua-5.1.4/src/loadlib.c 2008-08-06 13:29:28.002621440 +0000
+++ lua-5.1.4-haiku/src/loadlib.c 2011-05-03 22:06:13.391380992 +0000
@@ -1,5 +1,5 @@
/*
-** $Id: loadlib.c,v 1.52.1.3 2008/08/06 13:29:28 roberto Exp $
+** $Id: loadlib.c,v 1.52.1.4 2009/09/09 13:17:16 roberto Exp $
** Dynamic library loader for Lua
** See Copyright Notice in lua.h
**
@@ -639,7 +639,7 @@
lua_pushvalue(L, -1);
lua_replace(L, LUA_ENVIRONINDEX);
/* create `loaders' table */
- lua_createtable(L, 0, sizeof(loaders)/sizeof(loaders[0]) - 1);
+ lua_createtable(L, sizeof(loaders)/sizeof(loaders[0]) - 1, 0);
/* fill it with pre-defined loaders */
for (i=0; loaders[i] != NULL; i++) {
lua_pushcfunction(L, loaders[i]);
diff -urN lua-5.1.4/src/lstrlib.c lua-5.1.4-haiku/src/lstrlib.c
--- lua-5.1.4/src/lstrlib.c 2008-07-11 17:27:21.004194304 +0000
+++ lua-5.1.4-haiku/src/lstrlib.c 2011-05-03 22:06:13.411303936 +0000
@@ -1,5 +1,5 @@
/*
-** $Id: lstrlib.c,v 1.132.1.4 2008/07/11 17:27:21 roberto Exp $
+** $Id: lstrlib.c,v 1.132.1.5 2010/05/14 15:34:19 roberto Exp $
** Standard library for string operations and pattern-matching
** See Copyright Notice in lua.h
*/
@@ -754,6 +754,7 @@
static int str_format (lua_State *L) {
+ int top = lua_gettop(L);
int arg = 1;
size_t sfl;
const char *strfrmt = luaL_checklstring(L, arg, &sfl);
@@ -768,7 +769,8 @@
else { /* format item */
char form[MAX_FORMAT]; /* to store the format (`%...') */
char buff[MAX_ITEM]; /* to store the formatted item */
- arg++;
+ if (++arg > top)
+ luaL_argerror(L, arg, "no value");
strfrmt = scanformat(L, strfrmt, form);
switch (*strfrmt++) {
case 'c': {
diff -urN lua-5.1.4/src/luaconf.h lua-5.1.4-haiku/src/luaconf.h
--- lua-5.1.4/src/luaconf.h 2008-02-11 16:25:08.004980736 +0000
+++ lua-5.1.4-haiku/src/luaconf.h 2011-05-03 22:08:17.243793920 +0000
@@ -33,6 +33,13 @@
#define LUA_WIN
#endif
+#if defined(LUA_USE_HAIKU)
+#define LUA_USE_MKSTEMP
+#define LUA_USE_ISATTY
+#define LUA_USE_POPEN
+#define LUA_USE_DLOPEN
+#endif
+
#if defined(LUA_USE_LINUX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
@@ -94,7 +101,11 @@
".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
#else
-#define LUA_ROOT "/usr/local/"
+# if defined(LUA_USE_HAIKU)
+# define LUA_ROOT "/boot/common/"
+# else
+# define LUA_ROOT "/usr/local/"
+# endif
#define LUA_LDIR LUA_ROOT "share/lua/5.1/"
#define LUA_CDIR LUA_ROOT "lib/lua/5.1/"
#define LUA_PATH_DEFAULT \
diff -urN lua-5.1.4/src/lvm.c lua-5.1.4-haiku/src/lvm.c
--- lua-5.1.4/src/lvm.c 2007-12-28 15:32:23.005242880 +0000
+++ lua-5.1.4-haiku/src/lvm.c 2011-05-03 22:06:13.432537600 +0000
@@ -1,5 +1,5 @@
/*
-** $Id: lvm.c,v 2.63.1.3 2007/12/28 15:32:23 roberto Exp $
+** $Id: lvm.c,v 2.63.1.4 2009/07/01 21:10:33 roberto Exp $
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ -133,6 +133,7 @@
void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
int loop;
+ TValue temp;
for (loop = 0; loop < MAXTAGLOOP; loop++) {
const TValue *tm;
if (ttistable(t)) { /* `t' is a table? */
@@ -152,7 +153,9 @@
callTM(L, tm, t, key, val);
return;
}
- t = tm; /* else repeat with `tm' */
+ /* else repeat with `tm' */
+ setobj(L, &temp, tm); /* avoid pointing inside table (may rehash) */
+ t = &temp;
}
luaG_runerror(L, "loop in settable");
}

View File

@@ -1,123 +0,0 @@
From 0ba6279d1bee18e580206f0f86e3410f65db73c5 Mon Sep 17 00:00:00 2001
From: Alexander von Gluck IV <kallisti5@unixzen.com>
Date: Wed, 15 Jan 2014 15:33:52 -0600
Subject: [PATCH] lua: fix 5.1 runtime issues
* Thanks to the work of Chris Roberts and
Adrien Destugues
---
Makefile | 6 +++---
src/Makefile | 13 ++++++++++---
src/luaconf.h | 11 +++++++++++
3 files changed, 24 insertions(+), 6 deletions(-)
diff --git a/Makefile b/Makefile
index 6e78f66..b2e3868 100644
--- a/Makefile
+++ b/Makefile
@@ -38,12 +38,12 @@ RANLIB= ranlib
# == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
# Convenience platforms targets.
-PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
+PLATS= aix ansi bsd freebsd generic haiku linux macosx mingw posix solaris
# What to install.
TO_BIN= lua luac
TO_INC= lua.h luaconf.h lualib.h lauxlib.h ../etc/lua.hpp
-TO_LIB= liblua.a
+TO_LIB= liblua.a liblua.so
TO_MAN= lua.1 luac.1
# Lua version and release.
@@ -53,7 +53,7 @@ R= 5.1.4
all: $(PLAT)
$(PLATS) clean:
- cd src && $(MAKE) $@
+ cd src && $(MAKE) V=$(V) $@
test: dummy
src/lua test/hello.lua
diff --git a/src/Makefile b/src/Makefile
index e4a3cd6..9df0326 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -20,9 +20,10 @@ MYLIBS=
# == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
-PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
+PLATS= aix ansi bsd freebsd generic haiku linux macosx mingw posix solaris
LUA_A= liblua.a
+LUA_SO= liblua.so
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
@@ -36,7 +37,7 @@ LUAC_T= luac
LUAC_O= luac.o print.o
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)
@@ -57,8 +58,11 @@ $(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 -Wl,-soname=liblua.so.$(V) $(LDFLAGS) $? $(LIBS)
+
clean:
- $(RM) $(ALL_T) $(ALL_O)
+ $(RM) $(ALL_T) $(ALL_O) $(ALL_SO)
depend:
@$(CC) $(CFLAGS) -MM l*.c print.c
@@ -95,6 +99,9 @@ freebsd:
generic:
$(MAKE) all MYCFLAGS=
+haiku:
+ $(MAKE) all SYSCFLAGS="-DLUA_USE_HAIKU" LIBS=
+
linux:
$(MAKE) all MYCFLAGS=-DLUA_USE_LINUX MYLIBS="-Wl,-E -ldl -lreadline -lhistory -lncurses"
diff --git a/src/luaconf.h b/src/luaconf.h
index e2cb261..96c4d45 100644
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -33,6 +33,13 @@
#define LUA_WIN
#endif
+#if defined(LUA_USE_HAIKU)
+#define LUA_USE_MKSTEMP
+#define LUA_USE_ISATTY
+#define LUA_USE_POPEN
+#define LUA_USE_DLOPEN
+#endif
+
#if defined(LUA_USE_LINUX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
@@ -94,8 +101,12 @@
".\\?.dll;" LUA_CDIR"?.dll;" LUA_CDIR"loadall.dll"
#else
+#ifndef LUA_ROOT
#define LUA_ROOT "/usr/local/"
+#endif
+#ifndef LUA_LDIR
#define LUA_LDIR LUA_ROOT "share/lua/5.1/"
+#endif
#define LUA_CDIR LUA_ROOT "lib/lua/5.1/"
#define LUA_PATH_DEFAULT \
"./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
--
1.8.3.4

View File

@@ -1,157 +0,0 @@
From a2fa4f5ec85201d7aa2721594a66d9171c0e6dd1 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sun, 6 Oct 2013 10:13:45 +0200
Subject: Import existing patch.
diff --git a/Makefile b/Makefile
index bd9515f..22d3a62 100644
--- a/Makefile
+++ b/Makefile
@@ -36,12 +36,12 @@ RM= rm -f
# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
# Convenience platforms targets.
-PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
+PLATS= aix ansi bsd freebsd generic haiku linux macosx mingw posix solaris
# What to install.
TO_BIN= lua luac
TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
-TO_LIB= liblua.a
+TO_LIB= liblua.a liblua.so
TO_MAN= lua.1 luac.1
# Lua version and release.
diff --git a/src/Makefile b/src/Makefile
index 8c9ee67..507632b 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -26,9 +26,10 @@ MYOBJS=
# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
-PLATS= aix ansi bsd freebsd generic linux macosx mingw posix solaris
+PLATS= aix ansi bsd freebsd generic haiku linux macosx mingw posix solaris
LUA_A= liblua.a
+LUA_SO= liblua.so
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
@@ -43,7 +44,7 @@ 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.
@@ -65,6 +66,9 @@ $(LUA_T): $(LUA_O) $(LUA_A)
$(LUAC_T): $(LUAC_O) $(LUA_A)
$(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+$(LUA_SO): $(CORE_O) $(LIB_O)
+ $(CC) -o $@ -shared -fPIC $(LDFLAGS) $? $(LIBS)
+
clean:
$(RM) $(ALL_T) $(ALL_O)
@@ -102,6 +106,9 @@ freebsd:
generic: $(ALL)
+haiku:
+ $(MAKE) all SYSCFLAGS="-DLUA_USE_HAIKU" LIBS=
+
linux:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline -lncurses"
diff --git a/src/luaconf.h b/src/luaconf.h
index e4335df..107b864 100644
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -40,6 +40,13 @@
+#if defined(LUA_USE_HAIKU)
+#define LUA_USE_MKSTEMP
+#define LUA_USE_ISATTY
+#define LUA_USE_POPEN
+#define LUA_USE_DLOPEN
+#endif
+
#if defined(LUA_USE_LINUX)
#define LUA_USE_POSIX
#define LUA_USE_DLOPEN /* needs an extra library: -ldl */
--
1.8.3.4
From ccb35be40296d43903e01fdd01d2e53cd017b615 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sun, 6 Oct 2013 10:25:23 +0200
Subject: Set the library soname
* prepareInstalledDevelLib will fail if there is no soname.
diff --git a/src/Makefile b/src/Makefile
index 507632b..dd3c36b 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -67,7 +67,7 @@ $(LUAC_T): $(LUAC_O) $(LUA_A)
$(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
$(LUA_SO): $(CORE_O) $(LIB_O)
- $(CC) -o $@ -shared -fPIC $(LDFLAGS) $? $(LIBS)
+ $(CC) -o $@ -shared -fPIC -Wl,-soname=liblua.so.$(V) $(LDFLAGS) $? $(LIBS)
clean:
$(RM) $(ALL_T) $(ALL_O)
--
1.8.3.4
From a367a186c5058f68c758f0ff6fc45f3033a5ae97 Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Tue, 22 Oct 2013 02:42:32 -0600
Subject: =?UTF-8?q?Allow=20passing=20LUA=5FROOT=20and=20LUA=5FLDIR=20on=20?=
=?UTF-8?q?the=20command=20line=0APass=20V=20(version)=20onto=20src/Makefi?=
=?UTF-8?q?le?=
diff --git a/Makefile b/Makefile
index 22d3a62..729ede5 100644
--- a/Makefile
+++ b/Makefile
@@ -52,7 +52,7 @@ R= $V.1
all: $(PLAT)
$(PLATS) clean:
- cd src && $(MAKE) $@
+ cd src && $(MAKE) V=$(V) $@
test: dummy
src/lua -v
diff --git a/src/luaconf.h b/src/luaconf.h
index 107b864..2418ef6 100644
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -107,8 +107,12 @@
#else /* }{ */
#define LUA_VDIR LUA_VERSION_MAJOR "." LUA_VERSION_MINOR "/"
+#ifndef LUA_ROOT
#define LUA_ROOT "/usr/local/"
+#endif
+#ifndef LUA_LDIR
#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR
+#endif
#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR
#define LUA_PATH_DEFAULT \
LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
--
1.8.3.4

View File

@@ -0,0 +1,24 @@
From 0fe2f71f6eb7fb099b4ad950b50e2f27d919ea67 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Tue, 11 Aug 2015 17:13:15 +0000
Subject: gcc2 patch
diff --git a/src/Makefile b/src/Makefile
index d9b39fb..c005a80 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -6,8 +6,8 @@
# 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
+CFLAGS= -O2 -Wall -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS)
LDFLAGS= $(SYSLDFLAGS) $(MYLDFLAGS)
LIBS= -lm $(SYSLIBS) $(MYLIBS)
--
2.2.2

View File

@@ -0,0 +1,113 @@
From cb6d6fae1c5deb2efa132697cdd9cf00d727d129 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Mon, 5 May 2014 15:59:15 +0000
Subject: import patch from 5.2.1
diff --git a/Makefile b/Makefile
index 5ee5601..551b8c5 100644
--- a/Makefile
+++ b/Makefile
@@ -36,12 +36,12 @@ RM= rm -f
# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
# Convenience platforms targets.
-PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
+PLATS= aix bsd c89 freebsd generic haiku linux macosx mingw posix solaris
# What to install.
TO_BIN= lua luac
TO_INC= lua.h luaconf.h lualib.h lauxlib.h lua.hpp
-TO_LIB= liblua.a
+TO_LIB= liblua.a liblua.so
TO_MAN= lua.1 luac.1
# Lua version and release.
@@ -52,7 +52,7 @@ R= $V.1
all: $(PLAT)
$(PLATS) clean:
- cd src && $(MAKE) $@
+ cd src && $(MAKE) V=$(V) $@
test: dummy
src/lua -v
diff --git a/src/Makefile b/src/Makefile
index d71c75c..d9b39fb 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -26,9 +26,10 @@ MYOBJS=
# == END OF USER SETTINGS -- NO NEED TO CHANGE ANYTHING BELOW THIS LINE =======
-PLATS= aix bsd c89 freebsd generic linux macosx mingw posix solaris
+PLATS= aix bsd c89 freebsd generic haiku linux macosx mingw posix solaris
LUA_A= liblua.a
+LUA_SO= liblua.so
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
@@ -43,7 +44,7 @@ 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.
@@ -65,6 +66,9 @@ $(LUA_T): $(LUA_O) $(LUA_A)
$(LUAC_T): $(LUAC_O) $(LUA_A)
$(CC) -o $@ $(LDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
+$(LUA_SO): $(CORE_O) $(LIB_O)
+ $(CC) -o $@ -shared -fPIC -Wl,-soname=liblua.so.$(V) $(LDFLAGS) $? $(LIBS)
+
clean:
$(RM) $(ALL_T) $(ALL_O)
@@ -106,6 +110,9 @@ freebsd:
generic: $(ALL)
+haiku:
+ $(MAKE) all SYSCFLAGS="-DLUA_USE_HAIKU" LIBS=
+
linux:
$(MAKE) $(ALL) SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
diff --git a/src/luaconf.h b/src/luaconf.h
index 7cfa4fa..e947453 100644
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -81,7 +81,12 @@
#define LUA_C89_NUMBERS
#endif
-
+#if defined(LUA_USE_HAIKU)
+#define LUA_USE_MKSTEMP
+#define LUA_USE_ISATTY
+#define LUA_USE_POPEN
+#define LUA_USE_DLOPEN
+#endif
/*
@@ LUAI_BITSINT defines the (minimum) number of bits in an 'int'.
@@ -188,8 +193,12 @@
#else /* }{ */
+#ifndef LUA_ROOT
#define LUA_ROOT "/usr/local/"
+#endif
+#ifndef LUA_LDIR
#define LUA_LDIR LUA_ROOT "share/lua/" LUA_VDIR "/"
+#endif
#define LUA_CDIR LUA_ROOT "lib/lua/" LUA_VDIR "/"
#define LUA_PATH_DEFAULT \
LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \
--
2.2.2