diff options
Diffstat (limited to 'packages/lua/files')
-rw-r--r-- | packages/lua/files/.mtn2git_empty | 0 | ||||
-rw-r--r-- | packages/lua/files/advanced-readline.patch | 336 | ||||
-rw-r--r-- | packages/lua/files/debian.patch | 674 | ||||
-rw-r--r-- | packages/lua/files/make.patch | 20 |
4 files changed, 1030 insertions, 0 deletions
diff --git a/packages/lua/files/.mtn2git_empty b/packages/lua/files/.mtn2git_empty new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/packages/lua/files/.mtn2git_empty diff --git a/packages/lua/files/advanced-readline.patch b/packages/lua/files/advanced-readline.patch index e69de29bb2..93a7da8389 100644 --- a/packages/lua/files/advanced-readline.patch +++ b/packages/lua/files/advanced-readline.patch @@ -0,0 +1,336 @@ + +# +# Patch managed by http://www.holgerschurig.de/patcher.html +# + +--- lua-5.0.2/etc/saconfig.c~advanced-readline ++++ lua-5.0.2/etc/saconfig.c +@@ -1,14 +1,14 @@ +-/* sa-config.c -- configuration for stand-alone Lua interpreter ++/* saconfig.c -- configuration for stand-alone Lua interpreter + * + * #define LUA_USERCONFIG to this file + * + * Here are the features that can be customized using #define: + * +-*** Line edit and history: ++*** Line editing and history: + * #define USE_READLINE to use the GNU readline library. + * + * To use another library for this, use the code below as a start. +-* Make sure you #define lua_readline and lua_saveline accordingly. ++* Make sure you #define lua_{read,save,init,exit}line accordingly. + * If you do not #define lua_readline, you'll get a version based on fgets + * that uses a static buffer of size MAXINPUT. + * +@@ -41,13 +41,20 @@ + + #ifdef USE_READLINE + /* +-* This section implements of lua_readline and lua_saveline for lua.c using +-* the GNU readline and history libraries. It should also work with drop-in +-* replacements such as editline and libedit (you may have to include +-* different headers, though). ++* This section implements lua_xxxxline for lua.c using the GNU readline ++* and history libraries or compatible replacements. + * ++* It has been successfully tested with: ++* ++* GNU readline 2.2.1 (1998-07-17) ++* GNU readline 4.0 (1999-02-18) [harmless compiler warning] ++* GNU readline 4.3 (2002-07-16) ++* NETBSD libedit 2.6.5 (2002-03-25) ++* NETBSD libedit 2.6.9 (2004-05-01) + */ + ++#define lua_initline myinitline ++#define lua_exitline myexitline + #define lua_readline myreadline + #define lua_saveline mysaveline + +@@ -55,33 +62,226 @@ + #include <readline/readline.h> + #include <readline/history.h> + +-static int myreadline (lua_State *L, const char *prompt) { +- char *s=readline(prompt); +- if (s==NULL) +- return 0; +- else { +- lua_pushstring(L,s); +- lua_pushliteral(L,"\n"); +- lua_concat(L,2); +- free(s); +- return 1; +- } ++/* Environment variable names for the history file and the history size */ ++#ifndef LUA_HISTORY_ENV ++#define LUA_HISTORY_ENV "LUA_HISTORY" ++#endif ++ ++#ifndef LUA_HISTSIZE_ENV ++#define LUA_HISTSIZE_ENV "LUA_HISTSIZE" ++#endif ++ ++static char *myhist; ++static int myhistsize; ++ ++static lua_State *myL; /* readline does not pass user data to callbacks */ ++ ++/* Read a line from the terminal with line editing */ ++static int myreadline(lua_State *L, const char *prompt) ++{ ++ char *s; ++ if (!(s = readline(prompt))) return 0; ++ lua_pushstring(L, s); ++ lua_pushliteral(L, "\n"); ++ lua_concat(L, 2); ++ free(s); ++ return 1; + } + +-static void mysaveline (lua_State *L, const char *s) { ++/* Add a line to the history */ ++static void mysaveline(lua_State *L, const char *s) ++{ + const char *p; +- for (p=s; isspace(*p); p++) +- ; +- if (*p!=0) { +- size_t n=strlen(s)-1; +- if (s[n]!='\n') ++ for (p = s; isspace(*p); p++) ; ++ if (*p) { ++ size_t n = strlen(s)-1; ++ if (s[n] != '\n') { + add_history(s); +- else { +- lua_pushlstring(L,s,n); +- s=lua_tostring(L,-1); ++ } else { ++ lua_pushlstring(L, s, n); ++ s = lua_tostring(L, -1); + add_history(s); +- lua_remove(L,-1); ++ lua_pop(L, 1); ++ } ++ } ++} ++ ++/* Reserved lua keywords */ ++static const char * const reskeywords[] = { ++ "and", "break", "do", "else", "elseif", "end", "false", ++ "for", "function", "if", "in", "local", "nil", "not", "or", ++ "repeat", "return", "then", "true", "until", "while", NULL ++}; ++ ++static int valididentifier(const char *s) ++{ ++ if (!(isalpha(*s) || *s == '_')) return 0; ++ for (s++; *s; s++) if (!(isalpha(*s) || isdigit(*s) || *s == '_')) return 0; ++ return 1; ++} ++ ++/* Dynamically resizable match list */ ++typedef struct { ++ char **list; ++ size_t idx, allocated, matchlen; ++} dmlist; ++ ++/* Add prefix + string + suffix to list and compute common prefix */ ++static int dmadd(dmlist *ml, const char *p, size_t pn, const char *s, int suf) ++{ ++ char *t = NULL; ++ ++ if (ml->idx+1 >= ml->allocated && ++ !(ml->list = realloc(ml->list, sizeof(char *)*(ml->allocated += 32)))) ++ return -1; ++ ++ if (s) { ++ size_t n = strlen(s); ++ if (!(t = (char *)malloc(sizeof(char)*(pn+n+(suf?2:1))))) return 1; ++ memcpy(t, p, pn); ++ memcpy(t+pn, s, n); ++ n += pn; ++ t[n] = suf; ++ if (suf) t[++n] = '\0'; ++ ++ if (ml->idx == 0) { ++ ml->matchlen = n; ++ } else { ++ size_t i; ++ for (i = 0; i < ml->matchlen && i < n && ml->list[1][i] == t[i]; i++) ; ++ ml->matchlen = i; /* Set matchlen to common prefix */ ++ } ++ } ++ ++ ml->list[++ml->idx] = t; ++ return 0; ++} ++ ++/* Get __index field of metatable of object on top of stack */ ++static int getmetaindex(lua_State *L) ++{ ++ if (!lua_getmetatable(L, -1)) { lua_pop(L, 1); return 0; } ++ lua_pushstring(L, "__index"); ++ lua_rawget(L, -2); ++ lua_replace(L, -2); ++ if (lua_isnil(L, -1) || lua_rawequal(L, -1, -2)) { lua_pop(L, 2); return 0; } ++ lua_replace(L, -2); ++ return 1; ++} /* 1: obj -- val, 0: obj -- */ ++ ++/* Get field from object on top of stack. Avoid calling metamethods */ ++static int safegetfield(lua_State *L, const char *s, size_t n) ++{ ++ int i = 20; /* Avoid infinite metatable loops */ ++ do { ++ if (lua_istable(L, -1)) { ++ lua_pushlstring(L, s, n); ++ lua_rawget(L, -2); ++ if (!lua_isnil(L, -1)) { lua_replace(L, -2); return 1; } ++ lua_pop(L, 1); ++ } ++ } while (--i > 0 && getmetaindex(L)); ++ lua_pop(L, 1); ++ return 0; ++} /* 1: obj -- val, 0: obj -- */ ++ ++/* Completion function */ ++static char **mycomplete(const char *text, int start, int end) ++{ ++ dmlist ml; ++ const char *s; ++ size_t i, n, dot; ++ int savetop; ++ ++ if (!(text[0] == '\0' || isalpha(text[0]) || text[0] == '_')) return NULL; ++ ++ ml.list = NULL; ++ ml.idx = ml.allocated = ml.matchlen = 0; ++ ++ savetop = lua_gettop(myL); ++ lua_pushvalue(myL, LUA_GLOBALSINDEX); ++ for (n = (size_t)(end-start), i = dot = 0; i < n; i++) ++ if (text[i] == '.' || text[i] == ':') { ++ if (!safegetfield(myL, text+dot, i-dot)) goto error; /* invalid prefix */ ++ dot = i+1; /* points to first char after dot/colon */ ++ } ++ ++ /* Add all matches against keywords if there is no dot/colon */ ++ if (dot == 0) ++ for (i = 0; (s = reskeywords[i]) != NULL; i++) ++ if (!strncmp(s, text, n) && dmadd(&ml, NULL, 0, s, ' ')) goto error; ++ ++ /* Add all valid matches from all tables/metatables */ ++ i = 20; /* Avoid infinite metatable loops */ ++ do { ++ if (lua_istable(myL, -1)) ++ for (lua_pushnil(myL); lua_next(myL, -2); lua_pop(myL, 1)) ++ if (lua_type(myL, -2) == LUA_TSTRING) { ++ s = lua_tostring(myL, -2); ++ /* Only match names starting with '_' if explicitly requested */ ++ if (!strncmp(s, text+dot, n-dot) && valididentifier(s) && ++ (*s != '_' || text[dot] == '_')) { ++ int suf = ' '; /* default suffix is a space */ ++ switch (lua_type(myL, -1)) { ++ case LUA_TTABLE: suf = '.'; break; /* No way to guess ':' */ ++ case LUA_TFUNCTION: suf = '('; break; ++ case LUA_TUSERDATA: ++ if (lua_getmetatable(myL, -1)) { lua_pop(myL, 1); suf = ':'; } ++ break; ++ } ++ if (dmadd(&ml, text, dot, s, suf)) goto error; ++ } ++ } ++ } while (--i > 0 && getmetaindex(myL)); ++ ++ if (ml.idx > 1) { ++ /* list[0] holds the common prefix of all matches (may be "") */ ++ if (!(ml.list[0] = (char *)malloc(sizeof(char)*(ml.matchlen+1)))) { ++error: ++ lua_settop(myL, savetop); ++ return NULL; + } ++ memcpy(ml.list[0], ml.list[1], ml.matchlen); ++ ml.list[0][ml.matchlen] = '\0'; ++ /* Add the NULL list terminator */ ++ if (dmadd(&ml, NULL, 0, NULL, 0)) goto error; ++ } else if (ml.idx == 1) { ++ ml.list[0] = ml.list[1]; /* Only return common prefix */ ++ ml.list[1] = NULL; + } ++ ++ lua_settop(myL, savetop); ++ return ml.list; ++} ++ ++/* Initialize library */ ++static void myinitline(lua_State *L, char *pname) ++{ ++ char *s; ++ ++ myL = L; ++ ++ /* This allows for $if lua ... $endif in ~/.inputrc */ ++ rl_readline_name = pname; ++ /* Break words at every non-identifier character except '.' and ':' */ ++ rl_completer_word_break_characters = ++ "\t\r\n !\"#$%&'()*+,-/;<=>?@[\\]^`{|}~"; ++ rl_completer_quote_characters = "\"'"; ++ rl_completion_append_character = '\0'; ++ rl_attempted_completion_function = mycomplete; ++ rl_initialize(); ++ ++ /* Start using history, optionally set history size and load history file */ ++ using_history(); ++ if ((s = getenv(LUA_HISTSIZE_ENV)) && ++ (myhistsize = atoi(s))) stifle_history(myhistsize); ++ if ((myhist = getenv(LUA_HISTORY_ENV))) read_history(myhist); ++} ++ ++/* Finalize library */ ++static void myexitline(lua_State *L) ++{ ++ /* Optionally save history file */ ++ if (myhist) write_history(myhist); + } + #endif +--- lua-5.0.2/src/lua/lua.c~advanced-readline ++++ lua-5.0.2/src/lua/lua.c +@@ -265,6 +265,19 @@ + + + /* ++** these macros can be used to perform initialization and finalization ++** for lua_saveline and lua_readline ++*/ ++#ifndef lua_initline ++#define lua_initline(L,pname) /* empty */ ++#endif ++ ++#ifndef lua_exitline ++#define lua_exitline(L) /* empty */ ++#endif ++ ++ ++/* + ** this macro can be used by some `history' system to save lines + ** read in manual input + */ +@@ -352,6 +365,7 @@ + const char *oldprogname = progname; + progname = NULL; + do_path(); ++ lua_initline(L, PROGNAME); /* progname may contain a path, so use PROGNAME */ + while ((status = load_string()) != -1) { + if (status == 0) status = lcall(0, 0); + report(status); +@@ -365,6 +379,7 @@ + } + lua_settop(L, 0); /* clear stack */ + fputs("\n", stdout); ++ lua_exitline(L); + progname = oldprogname; + } + diff --git a/packages/lua/files/debian.patch b/packages/lua/files/debian.patch index e69de29bb2..38ca37946d 100644 --- a/packages/lua/files/debian.patch +++ b/packages/lua/files/debian.patch @@ -0,0 +1,674 @@ +--- lua-5.0.2.orig/doc/lua.1 ++++ lua-5.0.2/doc/lua.1 +@@ -152,6 +152,16 @@ + .TP + .B \-v + show version information. ++.TP ++.B \-C ++load the compatibility library into the interpreter. If you specify ++this, then you will also need to specify the ++.B \-i ++option in order to enter an interactive interpreter. ++.TP ++.B \-P ++suppress the creation of a standard LUA_PATH variable. Use this if ++you need to run scripts which conflict with system-installed libraries. + .SH "SEE ALSO" + .BR luac (1) + .br +@@ -163,5 +173,11 @@ + L. H. de Figueiredo, + and + W. Celes +-(lua@tecgraf.puc-rio.br) ++.LP ++.BI <lua@tecgraf.puc-rio.br> ++.LP ++Debian modifications to the manpage by ++Daniel Silverstone ++.LP ++.BI <dsilvers@debian.org> + .\" EOF +--- lua-5.0.2.orig/src/luac/Makefile ++++ lua-5.0.2/src/luac/Makefile +@@ -12,8 +12,8 @@ + + all: $T + +-$T: $(OBJS) $(LIB)/liblua.a $(LIB)/liblualib.a +- $(CC) -o $@ $(MYLDFLAGS) $(OBJS) -L$(LIB) -llua -llualib $(EXTRA_LIBS) $(DLLIB) ++$T: $(OBJS) $(LIB)/liblua.a $(LIB)/liblualib.a ++ $(CC) -o $@ $(MYLDFLAGS) $(OBJS) -L$(LIB) -llua -llualib $(EXTRA_LIBS) + + # print.c needs opcode names from lopcodes.c + lopcodes.o: ../lopcodes.c ../lopcodes.h +--- lua-5.0.2.orig/src/lib/Makefile ++++ lua-5.0.2/src/lib/Makefile +@@ -9,16 +9,18 @@ + OBJS= lauxlib.o lbaselib.o ldblib.o liolib.o lmathlib.o ltablib.o lstrlib.o loadlib.o + SRCS= lauxlib.c lbaselib.c ldblib.c liolib.c lmathlib.c ltablib.c lstrlib.c loadlib.c + +-T= $(LIB)/liblualib.a ++SOBJS := $(patsubst %.o,%.os,$(OBJS)) ++ ++T= $(LIB)/liblualib.a + + all: $T + +-$T: $(OBJS) ++$T: $(OBJS) $(SOBJS) + $(AR) $@ $(OBJS) + $(RANLIB) $@ + + clean: +- rm -f $(OBJS) $T ++ rm -f $(OBJS) $(SOBJS) $T + + co: + co -q -f -M $(SRCS) +--- lua-5.0.2.orig/src/lib/liolib.c ++++ lua-5.0.2/src/lib/liolib.c +@@ -149,7 +149,14 @@ + if (f == stdin || f == stdout || f == stderr) + return 0; /* file cannot be closed */ + else { +- int ok = (pclose(f) != -1) || (fclose(f) == 0); ++ int ok; ++ errno = 0; ++ ok = (pclose(f) != -1); ++ if (!ok) { ++ if (errno == ECHILD) ok = 1; /* pclose worked, but could reap child */ ++ else ok = (fclose(f) == 0); ++ } ++ + if (ok) + *(FILE **)lua_touserdata(L, 1) = NULL; /* mark file as closed */ + return ok; +--- lua-5.0.2.orig/src/lua/Makefile ++++ lua-5.0.2/src/lua/Makefile +@@ -12,8 +12,8 @@ + + all: $T + +-$T: $(OBJS) $(LIB)/liblua.a $(LIB)/liblualib.a +- $(CC) -o $@ $(MYLDFLAGS) $(OBJS) -L$(LIB) -llua -llualib $(EXTRA_LIBS) $(DLLIB) ++$T: $(OBJS) $(LIB)/liblua.a $(LIB)/liblualib.a ++ $(CC) -o $@ $(MYLDFLAGS) $(OBJS) -L$(LIB) -llua -llualib $(EXTRA_LIBS) $(DLLIB) + + $(LIB)/liblua.a: + cd ..; $(MAKE) +--- lua-5.0.2.orig/src/lua/lua.c ++++ lua-5.0.2/src/lua/lua.c +@@ -65,7 +65,57 @@ + + static const char *progname = PROGNAME; + ++/* These bits are added for Debian's -P functionality */ + ++static int done_path = 0; ++static int suppress_path = 0; ++ ++static const char* paths[] = { ++ "~/.lua", ++ "~/share/lua", ++ "/usr/share/lua", ++ "/usr/local/share/lua", ++ NULL ++}; ++ ++static void do_path() ++{ ++ const char** p = paths; ++ int any; ++ if( done_path || suppress_path ) return; ++ if( ! L ) return; ++ done_path = 1; ++ lua_pushliteral(L,"LUA_PATH"); ++ lua_pushliteral(L,""); ++ while( *p ) { ++ any = 0; ++ if( **p == '~' ) { ++ const char* home = getenv("HOME"); ++ if( home ) { ++ lua_pushstring(L,home); ++ lua_pushstring(L,*p+1); ++ lua_pushliteral(L,"/?.lua;"); ++ lua_pushstring(L,home); ++ lua_pushstring(L,*p+1); ++ lua_pushliteral(L,"/?;"); ++ any = 6; ++ } ++ } else { ++ lua_pushstring(L,*p); ++ lua_pushliteral(L,"/?.lua;"); ++ lua_pushstring(L,*p); ++ lua_pushliteral(L,"/?;"); ++ any = 4; ++ } ++ if( any ) { ++ lua_concat(L,any+1); ++ } ++ p++; ++ } ++ lua_pushliteral(L, "?.lua;?"); ++ lua_concat(L,2); ++ lua_settable(L, LUA_GLOBALSINDEX); ++} + + static const luaL_reg lualibs[] = { + {"base", luaopen_base}, +@@ -85,13 +135,12 @@ + static void lstop (lua_State *l, lua_Debug *ar) { + (void)ar; /* unused arg. */ + lua_sethook(l, NULL, 0, 0); +- luaL_error(l, "interrupted!"); ++ lua_pushnil(l); ++ lua_error(l); + } + + + static void laction (int i) { +- signal(i, SIG_DFL); /* if another SIGINT happens before lstop, +- terminate process (default action) */ + lua_sethook(L, lstop, LUA_MASKCALL | LUA_MASKRET | LUA_MASKCOUNT, 1); + } + +@@ -105,6 +154,9 @@ + " -i enter interactive mode after executing `script'\n" + " -l name load and run library `name'\n" + " -v show version information\n" ++ " -C load the compatibility library before startup\n" ++ " -P suppress the setting of LUA_PATH. If not specified\n" ++ " very early, this setting may not take effect.\n" + " -- stop handling options\n" , + progname); + } +@@ -120,23 +172,42 @@ + const char *msg; + if (status) { + msg = lua_tostring(L, -1); +- if (msg == NULL) msg = "(error with no message)"; +- l_message(progname, msg); ++ if (msg == NULL) { ++ const char *str; ++ lua_getglobal(L, "LUA_DEFAULT_ERROR"); /* try global variable */ ++ str = lua_tostring(L, -1); ++ lua_pop(L, 1); ++ if (str) { ++ if (*str != '\0') msg = str; ++ } else msg = "(error with no message)"; ++ } ++ if (msg) l_message(progname, msg); + lua_pop(L, 1); + } + return status; + } + ++static void sig_catch(int sig, void (*handler)(int)) ++{ ++ struct sigaction sa; ++ sa.sa_handler = handler; ++ sa.sa_flags = 0; ++ sigemptyset(&sa.sa_mask); ++ sigaction(sig, &sa, 0); /* XXX ignores errors */ ++} ++ + + static int lcall (int narg, int clear) { + int status; + int base = lua_gettop(L) - narg; /* function index */ ++ do_path(); ++ lua_settop(L,base); + lua_pushliteral(L, "_TRACEBACK"); + lua_rawget(L, LUA_GLOBALSINDEX); /* get traceback function */ + lua_insert(L, base); /* put it under chunk and args */ +- signal(SIGINT, laction); ++ sig_catch(SIGINT, laction); + status = lua_pcall(L, narg, (clear ? 0 : LUA_MULTRET), base); +- signal(SIGINT, SIG_DFL); ++ sig_catch(SIGINT, SIG_DFL); + lua_remove(L, base); /* remove traceback function */ + return status; + } +@@ -179,6 +250,7 @@ + + + static int load_file (const char *name) { ++ do_path(); + lua_pushliteral(L, "require"); + lua_rawget(L, LUA_GLOBALSINDEX); + if (!lua_isfunction(L, -1)) { /* no `require' defined? */ +@@ -279,6 +351,7 @@ + int status; + const char *oldprogname = progname; + progname = NULL; ++ do_path(); + while ((status = load_string()) != -1) { + if (status == 0) status = lcall(0, 0); + report(status); +@@ -352,6 +425,18 @@ + return 1; /* stop if file fails */ + break; + } ++ case 'C': { ++ const char *filename = "compat.lua"; ++ if (load_file(filename)) ++ return 1; /* stop if file fails */ ++ break; ++ } ++ case 'P': { ++ if( done_path ) ++ l_message(progname, "option `-P' is too late, ignored"); ++ suppress_path = 1; ++ break; ++ } + case 'c': { + l_message(progname, "option `-c' is deprecated"); + break; +@@ -413,6 +498,7 @@ + status = handle_luainit(); + if (status == 0) { + status = handle_argv(s->argv, &interactive); ++ do_path(); + if (status == 0 && interactive) manual_input(); + } + s->status = status; +--- lua-5.0.2.orig/src/Makefile ++++ lua-5.0.2/src/Makefile +@@ -67,16 +67,19 @@ + lvm.h \ + lzio.h + +-T= $(LIB)/liblua.a ++T= $(LIB)/liblua.a ++ ++SOBJS := $(patsubst %.o,%.os,$(OBJS)) + + all: $T + +-$T: $(OBJS) ++$T: $(OBJS) $(SOBJS) + $(AR) $@ $(OBJS) + $(RANLIB) $@ + ++ + clean: +- rm -f $(OBJS) $T ++ rm -f $(OBJS) $(SOBJS) $T + + co: + co -q -f -M $(SRCS) +--- lua-5.0.2.orig/lua-config ++++ lua-5.0.2/lua-config +@@ -0,0 +1,165 @@ ++#!/usr/bin/lua ++-- -*- Lua -*- ++ ++-- This file is under the terms of the MIT licence. Do as you will. ++ ++-- Process the arg table ++function usage() ++ info(); ++ io.stderr:write([[Usage: lua-config <options> ++ ++ Valid options are: ++ ++ --include Outputs the -I switches needed to find <lua.h> etc. ++ ++ --static Outputs the full path to the static libraries ++ ++ --libs Outputs the -L and -l switches needed to find the library ++ --libs-only-L Outputs only the -L switches ++ --libs-only-l Outputs only the -l switches ++ ++ --extralibs Outputs the -l switches appropriate to the extra libs needed by lua ++ ++ Note that --static is mututally exclusive with the --libs* options ++ ++ Also, you can specify the following ++ ++ --vmonly Outputs only the switches for finding the VM libraries ++ --libonly Outputs only the switches for finding the standard libraries ++ --both Outputs the switches for both [The default] ++ ++ Example: ++ ++ gcc `lua-config --include` my_prog.c -o my_prog `lua-config --libs` ++ ++]] ); ++ os.exit(1); ++end ++ ++function version() ++ io.stdout:write( [[5.0.0 ++]] ); ++ os.exit(0); ++end ++ ++function info() ++ io.stdout:write( [[lua-config version 1.10 (c) Daniel Silverstone 2002 ++ ++lua-config was written for the Debian GNU/Linux project. This version ++of lua-config will provide switches appropriate to Lua 5.0 ++ ++]] ); ++end ++ ++if( table.getn(arg) == 0 ) then ++ usage() ++end ++ ++output_vm = 1 ++output_lib = 1 ++ ++output_static = 0 ++output_libs_l = 0 ++output_libs_L = 0 ++output_include = 0 ++output_extras = 0 ++ ++table.foreachi( arg, ++ function(n,param) ++ if( param == '--version' ) then ++ version() ++ end ++ if( param == '--help' ) then ++ usage() ++ end ++ if( param == '--include' ) then ++ output_include = 1; ++ return ++ end ++ if( param == '--libs' ) then ++ output_libs_l = 1; ++ output_libs_L = 1; ++ return ++ end ++ if( param == '--libs-only-L' ) then ++ output_libs_L = 1; ++ return ++ end ++ if( param == '--libs-only-l' ) then ++ output_libs_l = 1; ++ return ++ end ++ if( param == '--extralibs' ) then ++ output_extras = 1; ++ return ++ end ++ if( param == '--static' ) then ++ output_static = 1; ++ return ++ end ++ if( param == '--vmonly' ) then ++ output_vm = 1; ++ output_lib = 0; ++ return ++ end ++ if( param == '--libonly' ) then ++ output_lib = 1; ++ output_vm = 0; ++ return ++ end ++ if( param == '--both' ) then ++ output_lib = 1; ++ output_vm = 1; ++ return ++ end ++ io.stderr:write( "Unknown argument ", param ); ++ usage(); ++ end ); ++ ++if( (output_extras + output_libs_l + output_libs_L + output_include + output_static) == 0 ) then ++ usage() ++end ++ ++if( (output_static + (output_libs_l or output_libs_L)) > 1 ) then ++ usage(); ++end ++ ++outargs = {} ++ ++if( output_include == 1 ) then ++ table.insert( outargs, "-I/usr/include/lua" ); ++end ++ ++if( output_libs_L == 1 ) then ++ table.insert( outargs, "-L/usr/include" ); ++end ++ ++if( output_libs_l == 1 ) then ++ if( output_lib == 1 ) then ++ table.insert( outargs, "-llualib" ); ++ end ++ if( output_vm == 1 ) then ++ table.insert( outargs, "-llua" ); ++ end ++end ++ ++if( output_static == 1 ) then ++ if( output_lib == 1 ) then ++ table.insert( outargs, "/usr/lib/liblualib.a" ); ++ end ++ if( output_vm == 1 ) then ++ table.insert( outargs, "/usr/lib/liblua.a" ); ++ end ++end ++ ++if( output_extras == 1 ) then ++ table.insert( outargs, "-lm" ); ++end ++ ++io.stdout:write( outargs[1] ); ++ ++for i=2,table.getn(outargs) do ++ io.stdout:write( " ", outargs[i] ); ++end ++ ++io.stdout:write( "\n" ); +--- lua-5.0.2.orig/config ++++ lua-5.0.2/config +@@ -25,15 +25,15 @@ + # interface (e.g., Linux, Solaris, IRIX, BSD, AIX, HPUX, and probably others), + # uncomment the next two lines. + # +-#LOADLIB= -DUSE_DLOPEN=1 +-#DLLIB= -ldl ++LOADLIB= -DUSE_DLOPEN=1 ++DLLIB= -ldl + # + # In Linux with gcc, you should also uncomment the next definition for + # MYLDFLAGS, which passes -E (= -export-dynamic) to the linker. This option + # allows dynamic libraries to link back to the `lua' program, so that they do + # not need the Lua libraries. (Other systems may have an equivalent facility.) + # +-#MYLDFLAGS= -Wl,-E ++MYLDFLAGS= -Wl,-E + # + # On Windows systems. support for dynamic loading is enabled by default. + # To disable this support, uncomment the next line. +@@ -92,7 +92,7 @@ + # or if you are using a modified interpreter that does not need them, + # then comment the following line or add the appropriates libraries. + # +-EXTRA_LIBS= -lm ++#EXTRA_LIBS= -lm + + # If you want to customize the stand-alone Lua interpreter, uncomment and + # edit the following two lines; also edit etc/saconfig.c to suit your needs. +@@ -100,8 +100,8 @@ + # to add -lreadline (and perhaps also -lhistory and -lcurses or -lncurses) + # to EXTRA_LIBS. + # +-#USERCONF=-DLUA_USERCONFIG='"$(LUA)/etc/saconfig.c"' -DUSE_READLINE +-#EXTRA_LIBS= -lm -ldl -lreadline # -lhistory -lcurses -lncurses ++USERCONF=-DLUA_USERCONFIG='"$(LUA)/etc/saconfig.c"' -DUSE_READLINE ++EXTRA_LIBS= -lreadline -lm -ldl # -lhistory -lcurses -lncurses + + # ------------------------------------------------------------------ C compiler + +@@ -119,7 +119,7 @@ + # debug information. If you only want the shared libraries, you may want to + # add -fPIC to MYCFLAGS. + # +-MYCFLAGS= -O2 ++MYCFLAGS= -O3 -g + #MYCFLAGS= -O3 -fomit-frame-pointer # -fPIC + + # Write here any options you may need for your C linker. +@@ -148,19 +148,20 @@ + + # Locations for "make install". You may need to be root do "make install". + # +-INSTALL_ROOT= /usr/local ++INSTALL_ROOT= $(PREFIX)/usr/ + INSTALL_BIN= $(INSTALL_ROOT)/bin +-INSTALL_INC= $(INSTALL_ROOT)/include ++INSTALL_INC= $(INSTALL_ROOT)/include/lua + INSTALL_LIB= $(INSTALL_ROOT)/lib +-INSTALL_MAN= $(INSTALL_ROOT)/man/man1 ++INSTALL_MAN= $(INSTALL_ROOT)/share/man/man1 ++INSTALL_SHARE= $(INSTALL_ROOT)/share/lua + + # You may prefer to use "install" instead of "cp" if you have it. + # If you use "install", you may also want to change the permissions after -m. + # +-INSTALL_EXEC= cp +-INSTALL_DATA= cp +-#INSTALL_EXEC= install -m 0755 +-#INSTALL_DATA= install -m 0644 ++#INSTALL_EXEC= cp ++#INSTALL_DATA= cp ++INSTALL_EXEC= install -m 0755 ++INSTALL_DATA= install -m 0644 + + # == END OF USER SETTINGS. NO NEED TO CHANGE ANYTHING BELOW THIS LINE ========= + +@@ -173,6 +174,10 @@ + INCS= -I$(INC) $(EXTRA_INCS) + DEFS= $(NUMBER) $(EXTRA_DEFS) + +-CFLAGS= $(MYCFLAGS) $(WARN) $(INCS) $(DEFS) ++CFLAGS= $(MYCFLAGS) $(WARN) $(INCS) $(DEFS) -DINSTALL_SHARE=\"$(INSTALL_SHARE)\" ++ ++# Extra rule for .os files ++%.os: %.c ++ $(CC) $(CFLAGS) -fPIC -DPIC -o $@ -c $< + + # (end of config) +--- lua-5.0.2.orig/Makefile ++++ lua-5.0.2/Makefile +@@ -38,9 +38,13 @@ + + # shared libraries (for Linux) + so: +- ld -o lib/liblua.so.$V -shared src/*.o +- ld -o lib/liblualib.so.$V -shared src/lib/*.o +- cd lib; ln -fs liblua.so.$V liblua.so; ln -fs liblualib.so.$V liblualib.so ++ gcc -o lib/liblua.so.$V -shared -Wl,-soname,liblua.so.$V \ ++ src/*.os -lc ++ ln -fs liblua.so.$V lib/liblua-build.so ++ gcc -o lib/liblualib.so.$V -shared -Wl,-soname,liblualib.so.$V \ ++ src/lib/*.os -Llib -llua-build -lm -ldl -lc ++ cd lib; ln -fs liblua.so.$V liblua.so; \ ++ ln -fs liblualib.so.$V liblualib.so + + # binaries using shared libraries + sobin: +--- lua-5.0.2.orig/lua.pc ++++ lua-5.0.2/lua.pc +@@ -0,0 +1,11 @@ ++prefix=/usr ++exec_prefix=/usr ++libdir=/usr/lib ++includedir=/usr/include/ ++ ++Name: lua ++Description: The Lua 5.0 programming language ++Version: 5.0.0 ++Libs: -L${libdir} -llua ++Cflags: -I${includedir}/lua ++ +--- lua-5.0.2.orig/lualib.pc ++++ lua-5.0.2/lualib.pc +@@ -0,0 +1,12 @@ ++prefix=/usr ++exec_prefix=/usr ++libdir=/usr/lib ++includedir=/usr/include/ ++ ++Name: lua ++Description: The Lua 5.0 programming language addon libraries ++Version: 5.0.0 ++Requires: lua ++Libs: -L${libdir} -llualib ++Cflags: -I${includedir}/lua ++ +--- lua-5.0.2.orig/lua-config.1 ++++ lua-5.0.2/lua-config.1 +@@ -0,0 +1,64 @@ ++.\" Manual page for lua-config ++.\" Written by Daniel Silverstone <dsilvers@debian.org> ++.\" For the Debian GNU/Linux system ++ ++.TH lua-config 1 ++.SH NAME ++lua-config \- Lua configuration information ++.SH SYNOPSIS ++Basic usage ++.PP ++.B gcc ++` ++.B lua-config ++.I \-\-include ++` ++my_prog.c ++.B \-o ++my_prog ++` ++.B lua-config ++.I \-\-libs ++` ++ ++.SH DESCRIPTION ++The lua-config script allows you to determine useful information ++about the chosen version of lua running on the Debian GNU/Linux ++system in use. ++More information can be found by running ++.B lua-config ++without any arguments. ++.SH CAVEATS ++This script is unique to Debian and as such you shouldn't rely ++on its presence on every system. Lua is an embedded language ++by default and different Linux distributions each take a different ++approach to making it possible to compile with Lua. The ++.B pkg-config ++system also provides a way to look for libraries and is more likely ++to be supported across different Linux distributions. Debian's ++.B pkg-config ++name for Lua 5.0 is ++.I lua ++and the libraries are in ++.I lualib. ++These ++.B pkg-config ++files can be found in the ++.I liblua-dev ++and ++.I liblualib-dev ++packages. ++.SH AUTHOR ++lua-config was written by ++.B Daniel Silverstone ++.BI <dsilvers@debian.org>. ++ ++This manual page was written by ++.B Daniel Silverstone ++.BI <dsilvers@debian.org>. ++For the Debian project. It may be used without restriction in any ++other system. ++.SH "SEE ALSO" ++.IR lua (1) ++.IR pkg-config (1) ++ diff --git a/packages/lua/files/make.patch b/packages/lua/files/make.patch index e69de29bb2..0abb552827 100644 --- a/packages/lua/files/make.patch +++ b/packages/lua/files/make.patch @@ -0,0 +1,20 @@ + +# +# Patch managed by http://www.mn-logistik.de/unsupported/pxa250/patcher +# + +--- lua-5.0.2/Makefile~make 2004-12-18 02:09:42.006884000 -0500 ++++ lua-5.0.2/Makefile 2004-12-18 02:10:35.951683632 -0500 +@@ -38,10 +38,10 @@ + + # shared libraries (for Linux) + so: +- gcc -o lib/liblua.so.$V -shared -Wl,-soname,liblua.so.$V \ ++ $(CC) -o lib/liblua.so.$V -shared -Wl,-soname,liblua.so.$V \ + src/*.os -lc + ln -fs liblua.so.$V lib/liblua-build.so +- gcc -o lib/liblualib.so.$V -shared -Wl,-soname,liblualib.so.$V \ ++ $(CC) -o lib/liblualib.so.$V -shared -Wl,-soname,liblualib.so.$V \ + src/lib/*.os -Llib -llua-build -lm -ldl -lc + cd lib; ln -fs liblua.so.$V liblua.so; \ + ln -fs liblualib.so.$V liblualib.so |