1 # --- T2-COPYRIGHT-NOTE-BEGIN ---
2 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
4 # T2 SDE: package/.../lua-curses/compile.patch
5 # Copyright (C) 2006 The T2 SDE Project
7 # More information can be found in the files COPYING and README.
9 # This patch file is dual-licensed. It is available under the license the
10 # patched project is licensed under, as long as it is an OpenSource license
11 # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
12 # of the GNU General Public License as published by the Free Software
13 # Foundation; either version 2 of the License, or (at your option) any later
15 # --- T2-COPYRIGHT-NOTE-END ---
17 diff -ur lcurses-0.1-devel/Makefile lcurses-0.1-devel-t2/Makefile
18 --- lcurses-0.1-devel/Makefile 2004-08-29 22:22:05.000000000 +0200
19 +++ lcurses-0.1-devel-t2/Makefile 2006-02-12 23:08:39.000000000 +0100
23 # change these to reflect your Lua installation
25 -LUAINC= $(LUA)/include
28 +LUA = $(shell lua-config --prefix)
29 +LUAINC = $(shell lua-config --includedir)
30 +LUALIB = $(shell lua-config --libdir)
34 +LUALIBDIR = $(shell lua-config --pkglibdir)
35 +LUADATADIR =$(shell lua-config --pkgdatadir)
37 +NCURSESINC=-I/usr/include
38 +NCURSESLIB=-lpanel -lncurses
40 # no need to change anything below here
43 CFLAGS= $(INCS) $(DEFS) $(WARN) $(SHFLAGS) -O2
45 -WARN= -Wall -Werror -ansi #-ansi -pedantic -Wall
46 -INCS= -I$(LUAINC) #-I../curses
47 -LIBS= -L$(LUALIB) -lpanel -lcurses #../curses/panel.a ../curses/pdcurses.a -llualib -llua
49 +WARN= -Wall -Werror -ansi
50 +INCS= -I$(LUAINC) $(NCURSESINC)
51 +LIBS= -L$(LUALIB) $(NCURSESLIB)
56 cui.lua cui.ctrls.lua testcui.lua \
57 firework.lua interp.lua
60 +INSTALL_DATA = $(INSTALL) -m 644
61 +INSTALL_EXEC = $(INSTALL) -m 755
67 @rm -fr $(TMP)/$(MYLIB)-$(VER)
68 @lsum $(TARFILE) $(DISTDIR)/md5sums.txt
72 + $(INSTALL_EXEC) -d $(DESTDIR)$(LUALIBDIR)/
73 + $(INSTALL_EXEC) -d $(DESTDIR)$(LUADATADIR)/cui/
74 + $(INSTALL_EXEC) lcurses.so $(DESTDIR)$(LUALIBDIR)/
75 + $(INSTALL_DATA) cui.lua curses.lua $(DESTDIR)$(LUADATADIR)/
76 + $(INSTALL_DATA) cui/*.lua $(DESTDIR)$(LUADATADIR)/cui/
77 diff -ur lcurses-0.1-devel/cui/__core.lua lcurses-0.1-devel-t2/cui/__core.lua
78 --- lcurses-0.1-devel/cui/__core.lua 2004-08-27 10:19:45.000000000 +0200
79 +++ lcurses-0.1-devel-t2/cui/__core.lua 2006-02-10 03:19:54.000000000 +0100
82 --[[ load curses binding ]------------------------------------------------]]
84 -require('requirelib')
85 -local curses = requirelib('lcurses', 'luaopen_curses', true)
86 +local curses = require('lcurses')
89 --[[ local utils ]--------------------------------------------------------]]
90 diff -ur lcurses-0.1-devel/cui/memory.lua lcurses-0.1-devel-t2/cui/memory.lua
91 --- lcurses-0.1-devel/cui/memory.lua 2004-05-22 19:17:26.000000000 +0200
92 +++ lcurses-0.1-devel-t2/cui/memory.lua 2006-02-10 14:03:03.000000000 +0100
94 local w = self:window()
95 local str = _cui.new_chstr(self.size.x)
97 - local info = t..':'..l
98 + local info = t..':'..(l or "nil")
99 local pad = self.size.x - string.len(info)
100 str:set_str(0, ' ', self.color, pad)
101 str:set_str(pad, info, self.color)
102 diff -ur lcurses-0.1-devel/cui.lua lcurses-0.1-devel-t2/cui.lua
103 --- lcurses-0.1-devel/cui.lua 2004-05-22 19:04:45.000000000 +0200
104 +++ lcurses-0.1-devel-t2/cui.lua 2006-02-10 03:17:59.000000000 +0100
106 assert(not cui, 'library already loaded!?')
108 -- load the cui system
109 -require 'cui/__core.lua'
110 +require 'cui/__core'
111 diff -ur lcurses-0.1-devel/curses.lua lcurses-0.1-devel-t2/curses.lua
112 --- lcurses-0.1-devel/curses.lua 2004-07-22 21:13:42.000000000 +0200
113 +++ lcurses-0.1-devel-t2/curses.lua 2006-02-10 03:18:40.000000000 +0100
116 --]]------------------------------------------------------------------------
118 -require('requirelib')
121 -curses = requirelib('lcurses', 'luaopen_curses', true)
122 diff -ur lcurses-0.1-devel/lcurses.c lcurses-0.1-devel-t2/lcurses.c
123 --- lcurses-0.1-devel/lcurses.c 2004-08-29 22:22:05.000000000 +0200
124 +++ lcurses-0.1-devel-t2/lcurses.c 2006-02-10 13:28:48.000000000 +0100
125 @@ -649,14 +649,13 @@
126 static int lc_initscr(lua_State *L)
130 /* initialize curses */
133 /* no longer used, so clean it up */
134 lua_pushstring(L, RIPOFF_TABLE);
136 - lua_settable(L, LUA_REGISTRYINDEX);
137 + lua_settable(L, LUA_REGISTRYINDEX);
139 /* failed to initialize */
141 @@ -664,10 +663,10 @@
143 #if defined(PDCURSES)
144 /* PDCurses does not enable echo at startup! */
147 /* so we don't hang up after user presses a
148 modifier key until a normal key is pressed */
149 - PDC_return_key_modifiers(TRUE);
150 + PDC_return_key_modifiers(TRUE);
151 /*PDC_save_key_modifiers(TRUE);*/
157 /* return stdscr - main window */
161 /* save main window on registry */
162 lua_pushstring(L, STDSCR_REGISTRY);
163 @@ -687,10 +686,10 @@
164 /* setup curses constants - curses.xxx numbers */
165 register_curses_constants(L);
166 /* setup ascii map table */
170 /* install cleanup handler to help in debugging and screen trashing */
173 /* disable interrupt signal
174 signal(SIGINT, SIG_IGN);
175 signal(SIGBREAK, SIG_IGN);
176 @@ -2350,7 +2349,7 @@
180 -int luaopen_curses(lua_State *L)
181 +int luaopen_lcurses(lua_State *L)
184 ** create new metatable for window objects
185 @@ -2379,7 +2378,7 @@
186 ** create global table with curses methods/variables/constants
191 lua_pushliteral(L, "curses");
192 lua_pushvalue(L, -2);
193 lua_settable(L, LUA_GLOBALSINDEX);
194 @@ -2387,6 +2386,35 @@
195 lua_pushvalue(L, -1);
196 luaL_openlib(L, NULL, curseslib, 1);
202 + /* metatable with used panels and associated windows */
206 + ** create new metatable for window objects
208 + luaL_newmetatable(L, PANELMETA);
209 + lua_pushliteral(L, "__index");
210 + lua_pushvalue(L, -2); /* push metatable */
211 + lua_rawset(L, -3); /* metatable.__index = metatable */
213 + lua_pushvalue(L, -2); /* upvalue table */
214 + luaL_openlib(L, NULL, panellib, 1);
216 + lua_pop(L, 1); /* remove metatable from stack */
219 + ** create global table with curses methods/variables/constants
222 + luaL_openlib(L, "curses", cursespanellib, 1);
230 Only in lcurses-0.1-devel-t2/: lcurses.o
231 Only in lcurses-0.1-devel-t2/: lcurses.so
232 diff -ur lcurses-0.1-devel/lpanel.c lcurses-0.1-devel-t2/lpanel.c
233 --- lcurses-0.1-devel/lpanel.c 2003-12-31 05:27:04.000000000 +0100
234 +++ lcurses-0.1-devel-t2/lpanel.c 2006-02-10 13:26:43.000000000 +0100
239 +#ifndef INCLUDEPANEL
241 ** TODO: add upvalue table with lightuserdata keys and weak keyed
242 ** values containing WINDOWS and PANELS used in above functions
244 luaL_openlib(L, "curses", cursespanellib, 1);
248 diff -ur lcurses-0.1-devel/test.lua lcurses-0.1-devel-t2/test.lua
249 --- lcurses-0.1-devel/test.lua 2004-08-29 22:22:05.000000000 +0200
250 +++ lcurses-0.1-devel-t2/test.lua 2006-02-10 14:16:27.000000000 +0100
262 -local ok, msg = xpcall(_main, _TRACEBACK)
263 +local ok, msg = xpcall(_main, debug.traceback)
267 diff -ur lcurses-0.1-devel/testcui.lua lcurses-0.1-devel-t2/testcui.lua
268 --- lcurses-0.1-devel/testcui.lua 2004-08-27 01:28:57.000000000 +0200
269 +++ lcurses-0.1-devel-t2/testcui.lua 2006-02-10 13:29:53.000000000 +0100
274 -local ok, msg = xpcall(run, _TRACEBACK)
275 +local ok, msg = xpcall(run, debug.traceback)
278 if (not cui.isdone()) then