Bug#830876: Intend to help but FTBFS

Lumin cdluminate at gmail.com
Thu May 25 01:40:55 UTC 2017


Hi,

I intended to help but encountered the following FTBFS:

There is no luaL_reg in luajit headers (luajit 2.1.0~beta3 in experimental)

/u/i/luajit-2.1 ❯❯❯ ack luaL_reg lauxlib.h
28:LUALIB_API void (luaL_register) (lua_State *L, const char *libname,

/u/i/luajit-2.1 ❯❯❯ ack luaL_Reg lauxlib.h
21:typedef struct luaL_Reg {
24:} luaL_Reg;
27:                                const luaL_Reg *l, int nup);
29:                                const luaL_Reg *l);
88:LUALIB_API void (luaL_setfuncs) (lua_State *L, const luaL_Reg *l, int nup);

but the auxiliary header doesn't cover the case of luajit, I guess a possible
fix is like this:

--- a/src/libraries/luasocket/libluasocket/lua.h
+++ b/src/libraries/luasocket/libluasocket/lua.h
@@ -6,7 +6,7 @@
 #include <lualib.h>
 #include <lauxlib.h>

-#if LUA_VERSION_NUM > 501
+#if LUA_VERSION_NUM > 501 && !defined(LUAJIT_VERSION)
 #      define luaL_reg luaL_Reg
 #      define luaL_putchar(B, c) luaL_addchar(B, c)
 #      define luaL_typerror(L, n, t) luax_typerror(L, n, t)



FYI: FTBFS


/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DHAVE_CONFIG_H
-I. -I..  -I. -I./modules -I./libraries
-I./libraries/enet/libenet/include  -D_FILE_OFFSET_BITS=64
-D_REENTRANT -I/usr/include/SDL2 -I/usr/include/luajit-2.1
-I/usr/include/freetype2    -I/usr/include/AL        -Wdate-time
-D_FORTIFY_SOURCE=2  -g -O2
-fdebug-prefix-map=/home/lumin/packages/love.pkg/love=.
-fstack-protector-strong -Wformat -Werror=format-security -c -o
libraries/luasocket/libluasocket/timeout.lo
libraries/luasocket/libluasocket/timeout.c
libtool: compile:  gcc -DHAVE_CONFIG_H -I. -I.. -I. -I./modules
-I./libraries -I./libraries/enet/libenet/include
-D_FILE_OFFSET_BITS=64 -D_REENTRANT -I/usr/include/SDL2
-I/usr/include/luajit-2.1 -I/usr/include/freetype2 -I/usr/include/AL
-Wdate-time -D_FORTIFY_SOURCE=2 -g -O2
-fdebug-prefix-map=/home/lumin/packages/love.pkg/love=.
-fstack-protector-strong -Wformat -Werror=format-security -c
libraries/luasocket/libluasocket/timeout.c  -fPIC -DPIC -o
libraries/luasocket/libluasocket/.libs/timeout.o
In file included from libraries/luasocket/libluasocket/timeout.c:12:0:
libraries/luasocket/libluasocket/auxiliar.h:38:61: error: unknown type
name ‘luaL_reg’
 void auxiliar_newclass(lua_State *L, const char *classname, luaL_reg *func);
                                                             ^~~~~~~~
libraries/luasocket/libluasocket/timeout.c:38:8: error: unknown type
name ‘luaL_reg’
 static luaL_reg func[] = {
        ^~~~~~~~
libraries/luasocket/libluasocket/timeout.c:39:5: warning: braces
around scalar initializer
     { "gettime", timeout_lua_gettime },
     ^
libraries/luasocket/libluasocket/timeout.c:39:5: note: (near
initialization for ‘func[0]’)
libraries/luasocket/libluasocket/timeout.c:39:7: warning:
initialization makes integer from pointer without a cast
[-Wint-conversion]
     { "gettime", timeout_lua_gettime },
       ^~~~~~~~~
libraries/luasocket/libluasocket/timeout.c:39:7: note: (near
initialization for ‘func[0]’)
libraries/luasocket/libluasocket/timeout.c:39:7: error: initializer
element is not computable at load time
libraries/luasocket/libluasocket/timeout.c:39:7: note: (near
initialization for ‘func[0]’)
libraries/luasocket/libluasocket/timeout.c:39:18: warning: excess
elements in scalar initializer
     { "gettime", timeout_lua_gettime },
                  ^~~~~~~~~~~~~~~~~~~
libraries/luasocket/libluasocket/timeout.c:39:18: note: (near
initialization for ‘func[0]’)
libraries/luasocket/libluasocket/timeout.c:40:5: warning: braces
around scalar initializer
     { "sleep", timeout_lua_sleep },
     ^
libraries/luasocket/libluasocket/timeout.c:40:5: note: (near
initialization for ‘func[1]’)
libraries/luasocket/libluasocket/timeout.c:40:7: warning:
initialization makes integer from pointer without a cast
[-Wint-conversion]
     { "sleep", timeout_lua_sleep },
       ^~~~~~~
libraries/luasocket/libluasocket/timeout.c:40:7: note: (near
initialization for ‘func[1]’)
libraries/luasocket/libluasocket/timeout.c:40:7: error: initializer
element is not computable at load time
libraries/luasocket/libluasocket/timeout.c:40:7: note: (near
initialization for ‘func[1]’)
libraries/luasocket/libluasocket/timeout.c:40:16: warning: excess
elements in scalar initializer
     { "sleep", timeout_lua_sleep },
                ^~~~~~~~~~~~~~~~~
libraries/luasocket/libluasocket/timeout.c:40:16: note: (near
initialization for ‘func[1]’)
libraries/luasocket/libluasocket/timeout.c:41:5: warning: braces
around scalar initializer
     { NULL, NULL }
     ^
libraries/luasocket/libluasocket/timeout.c:41:5: note: (near
initialization for ‘func[2]’)
libraries/luasocket/libluasocket/timeout.c:41:7: warning:
initialization makes integer from pointer without a cast
[-Wint-conversion]
     { NULL, NULL }
       ^~~~
libraries/luasocket/libluasocket/timeout.c:41:7: note: (near
initialization for ‘func[2]’)
libraries/luasocket/libluasocket/timeout.c:41:13: warning: excess
elements in scalar initializer
     { NULL, NULL }
             ^~~~
libraries/luasocket/libluasocket/timeout.c:41:13: note: (near
initialization for ‘func[2]’)
libraries/luasocket/libluasocket/timeout.c: In function ‘timeout_open’:
libraries/luasocket/libluasocket/timeout.c:149:28: warning: passing
argument 3 of ‘luax_register’ from incompatible pointer type
[-Wincompatible-pointer-types]
     luax_register(L, NULL, func);
                            ^~~~
libraries/luasocket/libluasocket/timeout.c:30:13: note: expected
‘const luaL_Reg * {aka const struct luaL_Reg *}’ but argument is of
type ‘int *’
 extern void luax_register(lua_State *L, const char *name, const luaL_Reg *l);
             ^~~~~~~~~~~~~
Makefile:3635: recipe for target
'libraries/luasocket/libluasocket/timeout.lo' failed
make[4]: *** [libraries/luasocket/libluasocket/timeout.lo] Error 1
make[4]: *** Waiting for unfinished jobs....
make[4]: Leaving directory '/home/lumin/packages/love.pkg/love/src'
Makefile:3754: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/home/lumin/packages/love.pkg/love/src'
Makefile:518: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/lumin/packages/love.pkg/love'
Makefile:409: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/home/lumin/packages/love.pkg/love'
dh_auto_build: make -j4 returned exit code 2
debian/rules:4: recipe for target 'build' failed
make: *** [build] Error 2
dpkg-buildpackage: error: debian/rules build gave error exit status 2
debuild: fatal error at line 1116:
dpkg-buildpackage -rfakeroot -us -uc -i failed



More information about the Pkg-games-devel mailing list