Recipe for Lua.

* It's failing to do prepareInstalledDevelLib, I don't know why.
This commit is contained in:
Adrien Destugues
2013-10-05 23:18:55 +02:00
parent 620303182f
commit 68d27172b2
2 changed files with 102 additions and 55 deletions

View File

@@ -1,23 +1,51 @@
DESCRIPTION="Lua is a powerful, fast, light-weight, embeddable scripting language."
SUMMARY="Lua is a powerful, fast, light-weight, embeddable scripting language."
HOMEPAGE="http://www.lua.org"
SRC_URI="http://www.lua.org/ftp/lua-5.1.4.tar.gz"
CHECKSUM_MD5="d0870f2de55d59c1c8419f36e8fac150"
REVISION="3"
STATUS_HAIKU="stable"
DEPEND="pkgconfig >= 0.25"
ARCHITECTURES="!x86 !x86_gcc2"
PROVIDES="
lua = $portVersion compat = 5.1
cmd:lua = $portVersion compat = 5.1
cmd:luac = $portVersion
"
REQUIRES="
haiku >= $haikuVersion
"
BUILD_REQUIRES="
cmd:pkg_config
"
BUILD_PREREQUIRES="
haiku_devel >= $haikuVersion
cmd:make
cmd:gcc
"
PATCHES="lua-5.1.4.patchset"
BUILD()
{
cd lua-5.1.4
make haiku
}
INSTALL()
{
cd lua-5.1.4
make install INSTALL_TOP="${DESTDIR}`finddir B_COMMON_DIRECTORY`" \
INSTALL_MAN="${DESTDIR}`finddir B_COMMON_DOCUMENTATION_DIRECTORY`/man"
mkdir -p ${DESTDIR}`finddir B_COMMON_LIB_DIRECTORY`/pkgconfig
cp etc/lua.pc ${DESTDIR}`finddir B_COMMON_LIB_DIRECTORY`/pkgconfig/lua.pc
make install INSTALL_TOP="$prefix" INSTALL_MAN="$manDir" \
INSTALL_INC="$includeDir" INSTALL_LMOD="$dataDir/lua/$V"
mkdir -p $libDir/pkgconfig
cp etc/lua.pc $libDir/pkgconfig/lua.pc
prepareInstalledDevelLib liblua
fixPkgconfig
}
LICENSE="MIT"
COPYRIGHT="1994-2009, Lua.org, PUC-Rio"
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.
"

View File

@@ -1,7 +1,14 @@
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 @@
From 80ca93a71df5709617854121b54a0fcfca61f188 Mon Sep 17 00:00:00 2001
From: Adrien Destugues <pulkomandy@pulkomandy.tk>
Date: Sat, 5 Oct 2013 22:01:42 +0200
Subject: Import existing haikuport patch.
diff --git a/Makefile b/Makefile
index 6e78f66..8b8fbfc 100644
--- a/Makefile
+++ b/Makefile
@@ -13,11 +13,11 @@ INSTALL_TOP= /usr/local
INSTALL_BIN= $(INSTALL_TOP)/bin
INSTALL_INC= $(INSTALL_TOP)/include
INSTALL_LIB= $(INSTALL_TOP)/lib
@@ -15,7 +22,7 @@ diff -urN lua-5.1.4/Makefile lua-5.1.4-haiku/Makefile
INSTALL_CMOD= $(INSTALL_TOP)/lib/lua/$V
# How to install. If your install program does not support "-p", then you
@@ -38,12 +38,12 @@
@@ -38,12 +38,12 @@ RANLIB= ranlib
# == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
# Convenience platforms targets.
@@ -30,10 +37,11 @@ diff -urN lua-5.1.4/Makefile lua-5.1.4-haiku/Makefile
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 @@
diff --git a/src/Makefile b/src/Makefile
index e4a3cd6..4cfea30 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -20,9 +20,10 @@ MYLIBS=
# == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE =========
@@ -45,7 +53,7 @@ diff -urN lua-5.1.4/src/Makefile lua-5.1.4-haiku/src/Makefile
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 @@
@@ -36,7 +37,7 @@ LUAC_T= luac
LUAC_O= luac.o print.o
ALL_O= $(CORE_O) $(LIB_O) $(LUA_O) $(LUAC_O)
@@ -54,7 +62,7 @@ diff -urN lua-5.1.4/src/Makefile lua-5.1.4-haiku/src/Makefile
ALL_A= $(LUA_A)
default: $(PLAT)
@@ -57,6 +58,9 @@
@@ -57,6 +58,9 @@ $(LUA_T): $(LUA_O) $(LUA_A)
$(LUAC_T): $(LUAC_O) $(LUA_A)
$(CC) -o $@ $(MYLDFLAGS) $(LUAC_O) $(LUA_A) $(LIBS)
@@ -64,7 +72,7 @@ diff -urN lua-5.1.4/src/Makefile lua-5.1.4-haiku/src/Makefile
clean:
$(RM) $(ALL_T) $(ALL_O)
@@ -95,6 +99,9 @@
@@ -95,6 +99,9 @@ freebsd:
generic:
$(MAKE) all MYCFLAGS=
@@ -74,9 +82,10 @@ diff -urN lua-5.1.4/src/Makefile lua-5.1.4-haiku/src/Makefile
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
diff --git a/src/lcode.c b/src/lcode.c
index cff626b..679cb9c 100644
--- a/src/lcode.c
+++ b/src/lcode.c
@@ -1,5 +1,5 @@
/*
-** $Id: lcode.c,v 2.25.1.3 2007/12/28 15:32:23 roberto Exp $
@@ -84,7 +93,7 @@ diff -urN lua-5.1.4/src/lcode.c lua-5.1.4-haiku/src/lcode.c
** Code generator for Lua
** See Copyright Notice in lua.h
*/
@@ -544,10 +544,6 @@
@@ -544,10 +544,6 @@ void luaK_goiftrue (FuncState *fs, expdesc *e) {
pc = NO_JUMP; /* always true; do nothing */
break;
}
@@ -95,7 +104,7 @@ diff -urN lua-5.1.4/src/lcode.c lua-5.1.4-haiku/src/lcode.c
case VJMP: {
invertjump(fs, e);
pc = e->u.s.info;
@@ -572,10 +568,6 @@
@@ -572,10 +568,6 @@ static void luaK_goiffalse (FuncState *fs, expdesc *e) {
pc = NO_JUMP; /* always false; do nothing */
break;
}
@@ -106,9 +115,10 @@ diff -urN lua-5.1.4/src/lcode.c lua-5.1.4-haiku/src/lcode.c
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
diff --git a/src/ldblib.c b/src/ldblib.c
index 67de122..2027eda 100644
--- a/src/ldblib.c
+++ b/src/ldblib.c
@@ -1,5 +1,5 @@
/*
-** $Id: ldblib.c,v 1.104.1.3 2008/01/21 13:11:21 roberto Exp $
@@ -116,7 +126,7 @@ diff -urN lua-5.1.4/src/ldblib.c lua-5.1.4-haiku/src/ldblib.c
** Interface from Lua to its debug API
** See Copyright Notice in lua.h
*/
@@ -45,6 +45,7 @@
@@ -45,6 +45,7 @@ static int db_setmetatable (lua_State *L) {
static int db_getfenv (lua_State *L) {
@@ -124,9 +134,10 @@ diff -urN lua-5.1.4/src/ldblib.c lua-5.1.4-haiku/src/ldblib.c
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
diff --git a/src/liolib.c b/src/liolib.c
index e79ed1c..649f9a5 100644
--- a/src/liolib.c
+++ b/src/liolib.c
@@ -1,5 +1,5 @@
/*
-** $Id: liolib.c,v 2.73.1.3 2008/01/18 17:47:43 roberto Exp $
@@ -134,7 +145,7 @@ diff -urN lua-5.1.4/src/liolib.c lua-5.1.4-haiku/src/liolib.c
** Standard I/O (and system) library
** See Copyright Notice in lua.h
*/
@@ -276,7 +276,10 @@
@@ -276,7 +276,10 @@ static int read_number (lua_State *L, FILE *f) {
lua_pushnumber(L, d);
return 1;
}
@@ -146,9 +157,10 @@ diff -urN lua-5.1.4/src/liolib.c lua-5.1.4-haiku/src/liolib.c
}
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
diff --git a/src/llex.c b/src/llex.c
index 6dc3193..88c6790 100644
--- a/src/llex.c
+++ b/src/llex.c
@@ -1,5 +1,5 @@
/*
-** $Id: llex.c,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $
@@ -156,7 +168,7 @@ diff -urN lua-5.1.4/src/llex.c lua-5.1.4-haiku/src/llex.c
** Lexical Analyzer
** See Copyright Notice in lua.h
*/
@@ -118,8 +118,10 @@
@@ -118,8 +118,10 @@ TString *luaX_newstring (LexState *ls, const char *str, size_t l) {
lua_State *L = ls->L;
TString *ts = luaS_newlstr(L, str, l);
TValue *o = luaH_setstr(L, ls->fs->h, ts); /* entry for `str' */
@@ -168,9 +180,10 @@ diff -urN lua-5.1.4/src/llex.c lua-5.1.4-haiku/src/llex.c
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
diff --git a/src/loadlib.c b/src/loadlib.c
index 0d401eb..6158c53 100644
--- a/src/loadlib.c
+++ b/src/loadlib.c
@@ -1,5 +1,5 @@
/*
-** $Id: loadlib.c,v 1.52.1.3 2008/08/06 13:29:28 roberto Exp $
@@ -178,7 +191,7 @@ diff -urN lua-5.1.4/src/loadlib.c lua-5.1.4-haiku/src/loadlib.c
** Dynamic library loader for Lua
** See Copyright Notice in lua.h
**
@@ -639,7 +639,7 @@
@@ -639,7 +639,7 @@ LUALIB_API int luaopen_package (lua_State *L) {
lua_pushvalue(L, -1);
lua_replace(L, LUA_ENVIRONINDEX);
/* create `loaders' table */
@@ -187,9 +200,10 @@ diff -urN lua-5.1.4/src/loadlib.c lua-5.1.4-haiku/src/loadlib.c
/* 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
diff --git a/src/lstrlib.c b/src/lstrlib.c
index 1b4763d..7a03489 100644
--- a/src/lstrlib.c
+++ b/src/lstrlib.c
@@ -1,5 +1,5 @@
/*
-** $Id: lstrlib.c,v 1.132.1.4 2008/07/11 17:27:21 roberto Exp $
@@ -197,7 +211,7 @@ diff -urN lua-5.1.4/src/lstrlib.c lua-5.1.4-haiku/src/lstrlib.c
** Standard library for string operations and pattern-matching
** See Copyright Notice in lua.h
*/
@@ -754,6 +754,7 @@
@@ -754,6 +754,7 @@ static void addintlen (char *form) {
static int str_format (lua_State *L) {
@@ -205,7 +219,7 @@ diff -urN lua-5.1.4/src/lstrlib.c lua-5.1.4-haiku/src/lstrlib.c
int arg = 1;
size_t sfl;
const char *strfrmt = luaL_checklstring(L, arg, &sfl);
@@ -768,7 +769,8 @@
@@ -768,7 +769,8 @@ static int str_format (lua_State *L) {
else { /* format item */
char form[MAX_FORMAT]; /* to store the format (`%...') */
char buff[MAX_ITEM]; /* to store the formatted item */
@@ -215,9 +229,10 @@ diff -urN lua-5.1.4/src/lstrlib.c lua-5.1.4-haiku/src/lstrlib.c
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
diff --git a/src/luaconf.h b/src/luaconf.h
index e2cb261..9f28f41 100644
--- a/src/luaconf.h
+++ b/src/luaconf.h
@@ -33,6 +33,13 @@
#define LUA_WIN
#endif
@@ -245,9 +260,10 @@ diff -urN lua-5.1.4/src/luaconf.h lua-5.1.4-haiku/src/luaconf.h
#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
diff --git a/src/lvm.c b/src/lvm.c
index ee3256a..8aeafda 100644
--- a/src/lvm.c
+++ b/src/lvm.c
@@ -1,5 +1,5 @@
/*
-** $Id: lvm.c,v 2.63.1.3 2007/12/28 15:32:23 roberto Exp $
@@ -255,7 +271,7 @@ diff -urN lua-5.1.4/src/lvm.c lua-5.1.4-haiku/src/lvm.c
** Lua virtual machine
** See Copyright Notice in lua.h
*/
@@ -133,6 +133,7 @@
@@ -133,6 +133,7 @@ void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) {
void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
int loop;
@@ -263,7 +279,7 @@ diff -urN lua-5.1.4/src/lvm.c lua-5.1.4-haiku/src/lvm.c
for (loop = 0; loop < MAXTAGLOOP; loop++) {
const TValue *tm;
if (ttistable(t)) { /* `t' is a table? */
@@ -152,7 +153,9 @@
@@ -152,7 +153,9 @@ void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) {
callTM(L, tm, t, key, val);
return;
}
@@ -274,3 +290,6 @@ diff -urN lua-5.1.4/src/lvm.c lua-5.1.4-haiku/src/lvm.c
}
luaG_runerror(L, "loop in settable");
}
--
1.8.3.4