OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

278 lines
8.3 KiB

  1. # --- T2-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # T2 SDE: package/.../lua-curses/compile.patch
  5. # Copyright (C) 2006 The T2 SDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  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
  14. # version.
  15. # --- T2-COPYRIGHT-NOTE-END ---
  16. diff -ur lcurses-0.1-devel/Makefile lcurses-0.1-devel-t2/Makefile
  17. --- lcurses-0.1-devel/Makefile 2004-08-29 22:22:05.000000000 +0200
  18. +++ lcurses-0.1-devel-t2/Makefile 2006-02-12 23:08:39.000000000 +0100
  19. @@ -5,19 +5,25 @@
  20. TMP=/tmp
  21. # change these to reflect your Lua installation
  22. -LUA=../lua-5.0.2
  23. -LUAINC= $(LUA)/include
  24. -LUALIB= $(LUA)/lib
  25. -LUABIN= $(LUA)/bin
  26. +LUA = $(shell lua-config --prefix)
  27. +LUAINC = $(shell lua-config --includedir)
  28. +LUALIB = $(shell lua-config --libdir)
  29. +LUABIN = lua
  30. #LUABIN= /mingw/bin
  31. +LUALIBDIR = $(shell lua-config --pkglibdir)
  32. +LUADATADIR =$(shell lua-config --pkgdatadir)
  33. +
  34. +NCURSESINC=-I/usr/include
  35. +NCURSESLIB=-lpanel -lncurses
  36. +
  37. # no need to change anything below here
  38. -SHFLAGS= #-fPIC
  39. +SHFLAGS= -fPIC
  40. CFLAGS= $(INCS) $(DEFS) $(WARN) $(SHFLAGS) -O2
  41. -DEFS= # -DDEBUG
  42. -WARN= -Wall -Werror -ansi #-ansi -pedantic -Wall
  43. -INCS= -I$(LUAINC) #-I../curses
  44. -LIBS= -L$(LUALIB) -lpanel -lcurses #../curses/panel.a ../curses/pdcurses.a -llualib -llua
  45. +DEFS= -DINCLUDEPANEL
  46. +WARN= -Wall -Werror -ansi
  47. +INCS= -I$(LUAINC) $(NCURSESINC)
  48. +LIBS= -L$(LUALIB) $(NCURSESLIB)
  49. MYNAME= curses
  50. MYLIB= l$(MYNAME)
  51. @@ -37,6 +43,10 @@
  52. cui.lua cui.ctrls.lua testcui.lua \
  53. firework.lua interp.lua
  54. +INSTALL = install
  55. +INSTALL_DATA = $(INSTALL) -m 644
  56. +INSTALL_EXEC = $(INSTALL) -m 755
  57. +
  58. all: $T
  59. lua: lcurses.c lua.c
  60. @@ -64,3 +74,10 @@
  61. @rm -fr $(TMP)/$(MYLIB)-$(VER)
  62. @lsum $(TARFILE) $(DISTDIR)/md5sums.txt
  63. @echo 'Done.'
  64. +
  65. +install: $T
  66. + $(INSTALL_EXEC) -d $(DESTDIR)$(LUALIBDIR)/
  67. + $(INSTALL_EXEC) -d $(DESTDIR)$(LUADATADIR)/cui/
  68. + $(INSTALL_EXEC) lcurses.so $(DESTDIR)$(LUALIBDIR)/
  69. + $(INSTALL_DATA) cui.lua curses.lua $(DESTDIR)$(LUADATADIR)/
  70. + $(INSTALL_DATA) cui/*.lua $(DESTDIR)$(LUADATADIR)/cui/
  71. diff -ur lcurses-0.1-devel/cui/__core.lua lcurses-0.1-devel-t2/cui/__core.lua
  72. --- lcurses-0.1-devel/cui/__core.lua 2004-08-27 10:19:45.000000000 +0200
  73. +++ lcurses-0.1-devel-t2/cui/__core.lua 2006-02-10 03:19:54.000000000 +0100
  74. @@ -222,8 +222,7 @@
  75. --[[ load curses binding ]------------------------------------------------]]
  76. -require('requirelib')
  77. -local curses = requirelib('lcurses', 'luaopen_curses', true)
  78. +local curses = require('lcurses')
  79. --[[ local utils ]--------------------------------------------------------]]
  80. diff -ur lcurses-0.1-devel/cui/memory.lua lcurses-0.1-devel-t2/cui/memory.lua
  81. --- lcurses-0.1-devel/cui/memory.lua 2004-05-22 19:17:26.000000000 +0200
  82. +++ lcurses-0.1-devel-t2/cui/memory.lua 2006-02-10 14:03:03.000000000 +0100
  83. @@ -55,7 +55,7 @@
  84. local w = self:window()
  85. local str = _cui.new_chstr(self.size.x)
  86. local t, l = gcinfo()
  87. - local info = t..':'..l
  88. + local info = t..':'..(l or "nil")
  89. local pad = self.size.x - string.len(info)
  90. str:set_str(0, ' ', self.color, pad)
  91. str:set_str(pad, info, self.color)
  92. diff -ur lcurses-0.1-devel/cui.lua lcurses-0.1-devel-t2/cui.lua
  93. --- lcurses-0.1-devel/cui.lua 2004-05-22 19:04:45.000000000 +0200
  94. +++ lcurses-0.1-devel-t2/cui.lua 2006-02-10 03:17:59.000000000 +0100
  95. @@ -3,4 +3,4 @@
  96. assert(not cui, 'library already loaded!?')
  97. -- load the cui system
  98. -require 'cui/__core.lua'
  99. +require 'cui/__core'
  100. diff -ur lcurses-0.1-devel/curses.lua lcurses-0.1-devel-t2/curses.lua
  101. --- lcurses-0.1-devel/curses.lua 2004-07-22 21:13:42.000000000 +0200
  102. +++ lcurses-0.1-devel-t2/curses.lua 2006-02-10 03:18:40.000000000 +0100
  103. @@ -13,6 +13,5 @@
  104. --]]------------------------------------------------------------------------
  105. -require('requirelib')
  106. +require('lcurses')
  107. -curses = requirelib('lcurses', 'luaopen_curses', true)
  108. diff -ur lcurses-0.1-devel/lcurses.c lcurses-0.1-devel-t2/lcurses.c
  109. --- lcurses-0.1-devel/lcurses.c 2004-08-29 22:22:05.000000000 +0200
  110. +++ lcurses-0.1-devel-t2/lcurses.c 2006-02-10 13:28:48.000000000 +0100
  111. @@ -649,14 +649,13 @@
  112. static int lc_initscr(lua_State *L)
  113. {
  114. WINDOW *w;
  115. -
  116. /* initialize curses */
  117. w = initscr();
  118. /* no longer used, so clean it up */
  119. lua_pushstring(L, RIPOFF_TABLE);
  120. lua_pushnil(L);
  121. - lua_settable(L, LUA_REGISTRYINDEX);
  122. + lua_settable(L, LUA_REGISTRYINDEX);
  123. /* failed to initialize */
  124. if (w == NULL)
  125. @@ -664,10 +663,10 @@
  126. #if defined(PDCURSES)
  127. /* PDCurses does not enable echo at startup! */
  128. - echo();
  129. + echo();
  130. /* so we don't hang up after user presses a
  131. modifier key until a normal key is pressed */
  132. - PDC_return_key_modifiers(TRUE);
  133. + PDC_return_key_modifiers(TRUE);
  134. /*PDC_save_key_modifiers(TRUE);*/
  135. #endif
  136. @@ -677,7 +676,7 @@
  137. #endif
  138. /* return stdscr - main window */
  139. - lcw_new(L, w);
  140. + lcw_new(L, w);
  141. /* save main window on registry */
  142. lua_pushstring(L, STDSCR_REGISTRY);
  143. @@ -687,10 +686,10 @@
  144. /* setup curses constants - curses.xxx numbers */
  145. register_curses_constants(L);
  146. /* setup ascii map table */
  147. - init_ascii_map();
  148. + init_ascii_map();
  149. /* install cleanup handler to help in debugging and screen trashing */
  150. - atexit(cleanup);
  151. + atexit(cleanup);
  152. /* disable interrupt signal
  153. signal(SIGINT, SIG_IGN);
  154. signal(SIGBREAK, SIG_IGN);
  155. @@ -2350,7 +2349,7 @@
  156. };
  157. -int luaopen_curses(lua_State *L)
  158. +int luaopen_lcurses(lua_State *L)
  159. {
  160. /*
  161. ** create new metatable for window objects
  162. @@ -2379,7 +2378,7 @@
  163. ** create global table with curses methods/variables/constants
  164. */
  165. lua_newtable(L);
  166. - #if 0
  167. + #if 1
  168. lua_pushliteral(L, "curses");
  169. lua_pushvalue(L, -2);
  170. lua_settable(L, LUA_GLOBALSINDEX);
  171. @@ -2387,6 +2386,35 @@
  172. lua_pushvalue(L, -1);
  173. luaL_openlib(L, NULL, curseslib, 1);
  174. +
  175. +
  176. +
  177. +#ifdef INCLUDEPANEL
  178. + /* metatable with used panels and associated windows */
  179. + lua_newtable(L);
  180. +
  181. + /*
  182. + ** create new metatable for window objects
  183. + */
  184. + luaL_newmetatable(L, PANELMETA);
  185. + lua_pushliteral(L, "__index");
  186. + lua_pushvalue(L, -2); /* push metatable */
  187. + lua_rawset(L, -3); /* metatable.__index = metatable */
  188. +
  189. + lua_pushvalue(L, -2); /* upvalue table */
  190. + luaL_openlib(L, NULL, panellib, 1);
  191. +
  192. + lua_pop(L, 1); /* remove metatable from stack */
  193. +
  194. + /*
  195. + ** create global table with curses methods/variables/constants
  196. + */
  197. + lua_pop(L, 1);
  198. + luaL_openlib(L, "curses", cursespanellib, 1);
  199. +#endif
  200. +
  201. +
  202. +
  203. return 1;
  204. }
  205. Only in lcurses-0.1-devel-t2/: lcurses.o
  206. Only in lcurses-0.1-devel-t2/: lcurses.so
  207. diff -ur lcurses-0.1-devel/lpanel.c lcurses-0.1-devel-t2/lpanel.c
  208. --- lcurses-0.1-devel/lpanel.c 2003-12-31 05:27:04.000000000 +0100
  209. +++ lcurses-0.1-devel-t2/lpanel.c 2006-02-10 13:26:43.000000000 +0100
  210. @@ -328,6 +328,7 @@
  211. {NULL, NULL}
  212. };
  213. +#ifndef INCLUDEPANEL
  214. /*
  215. ** TODO: add upvalue table with lightuserdata keys and weak keyed
  216. ** values containing WINDOWS and PANELS used in above functions
  217. @@ -357,3 +358,4 @@
  218. luaL_openlib(L, "curses", cursespanellib, 1);
  219. return 1;
  220. }
  221. +#endif
  222. diff -ur lcurses-0.1-devel/test.lua lcurses-0.1-devel-t2/test.lua
  223. --- lcurses-0.1-devel/test.lua 2004-08-29 22:22:05.000000000 +0200
  224. +++ lcurses-0.1-devel-t2/test.lua 2006-02-10 14:16:27.000000000 +0100
  225. @@ -1,5 +1,4 @@
  226. ---require('bit')
  227. -
  228. +require('curses')
  229. local _topw = {}
  230. local top_lines = 10
  231. curses.slk_init(2)
  232. @@ -122,7 +121,7 @@
  233. curses.doupdate()
  234. end
  235. -local ok, msg = xpcall(_main, _TRACEBACK)
  236. +local ok, msg = xpcall(_main, debug.traceback)
  237. curses.done()
  238. diff -ur lcurses-0.1-devel/testcui.lua lcurses-0.1-devel-t2/testcui.lua
  239. --- lcurses-0.1-devel/testcui.lua 2004-08-27 01:28:57.000000000 +0200
  240. +++ lcurses-0.1-devel-t2/testcui.lua 2006-02-10 13:29:53.000000000 +0100
  241. @@ -224,7 +224,7 @@
  242. app:close()
  243. end
  244. -local ok, msg = xpcall(run, _TRACEBACK)
  245. +local ok, msg = xpcall(run, debug.traceback)
  246. if (not ok) then
  247. if (not cui.isdone()) then