Group :: Sistema/Bibliotecas
RPM: tolua++
Main Changelog Spec Patches Sources Download Gear Bugs e FR Repocop
Patch: tolua++-1.0.93-no-buildin-bytecode.patch
Download
Download
diff -urN tolua++-1.0.93/src/bin/SCsub tolua++-1.0.93.no-builtin/src/bin/SCsub
--- tolua++-1.0.93/src/bin/SCsub 2008-04-21 02:05:35.000000000 +0200
+++ tolua++-1.0.93.no-builtin/src/bin/SCsub 2014-10-01 15:54:39.001158444 +0200
@@ -5,8 +5,8 @@
]
-toluabind = env.LuaBinding('toluabind.c', 'tolua_scons.pkg', 'tolua', bootstrap = True)
+#toluabind = env.LuaBinding('toluabind.c', 'tolua_scons.pkg', 'tolua', bootstrap = True)
-env.bin_target = env.Program('#/bin/'+env['tolua_bin'], src + [toluabind], LIBS = ['$tolua_lib'] + env['LIBS'])
+env.bin_target = env.Program('#/bin/'+env['tolua_bin'], src, LIBS = ['$tolua_lib'] + env['LIBS'])
env.bootstrap_target = env.Program('#/bin/'+env['TOLUAPP_BOOTSTRAP'], src + ['toluabind_default.c', env.lib_target_static], LIBS = env['LIBS'])
diff -urN tolua++-1.0.93/src/bin/tolua.c tolua++-1.0.93.no-builtin/src/bin/tolua.c
--- tolua++-1.0.93/src/bin/tolua.c 2006-07-29 04:45:56.000000000 +0200
+++ tolua++-1.0.93.no-builtin/src/bin/tolua.c 2014-10-01 16:06:09.791424704 +0200
@@ -145,7 +145,7 @@
}
lua_pop(L,1);
}
-/* #define TOLUA_SCRIPT_RUN */
+#define TOLUA_SCRIPT_RUN
#ifndef TOLUA_SCRIPT_RUN
{
int tolua_tolua_open (lua_State* L);
@@ -153,16 +153,17 @@
}
#else
{
- char* p;
- char path[BUFSIZ];
- strcpy(path,argv[0]);
- p = strrchr(path,'/');
- if (p==NULL) p = strrchr(path,'\\');
- p = (p==NULL) ? path : p+1;
- sprintf(p,"%s","../src/bin/lua/");
- lua_pushstring(L,path); lua_setglobal(L,"path");
- strcat(path,"all.lua");
- lua_dofile(L,path);
+ lua_pushstring(L, "/usr/share/tolua++/"); lua_setglobal(L,"path");
+ if (luaL_loadfile(L, "/usr/share/tolua++/all.lua") != 0) {
+ fprintf(stderr, "luaL_loadfile failed\n");
+ return 1;
+ }
+ if (lua_pcall(L, 0,0,0) != 0) {
+ const char *errmsg = lua_tostring(L, -1);
+ fprintf(stderr, "lua_pcall failed: %s\n", errmsg);
+ lua_pop(L, 1);
+ return 1;
+ }
}
#endif
return 0;