telegram-bot icon indicating copy to clipboard operation
telegram-bot copied to clipboard

Luacrypto

Open Sethlans opened this issue 9 years ago • 9 comments

Hello. When i try to install the bot i got this error

Missing dependencies for oauth: luacrypto

Using https://rocks.moonscript.org/luacrypto-0.3.0.20120524-1.src.rock... switching to 'build' mode gcc -O2 -fPIC -I/usr/include -c src/lcrypto.c -o src/lcrypto.o -I/usr/include In file included from src/lcrypto.c:31:0: src/lcrypto.h:30:79: error: unknown type name ‘luaL_reg’ LUACRYPTO_API int luacrypto_createmeta (lua_State *L, const char *name, const luaL_reg *methods); ^ src/lcrypto.c:1708:79: error: unknown type name ‘luaL_reg’ LUACRYPTO_API int luacrypto_createmeta (lua_State *L, const char *name, const luaL_reg *methods) ^ src/lcrypto.c: In function ‘create_metatables’: src/lcrypto.c:1758:19: error: array type has incomplete element type struct luaL_reg core_functions[] = { ^ src/lcrypto.c:1763:19: error: array type has incomplete element type struct luaL_reg digest_methods[] = { ^ src/lcrypto.c:1773:15: error: array type has incomplete element type EVP_METHODS(encrypt); ^ src/lcrypto.c:1744:19: note: in definition of macro ‘EVP_METHODS’ struct luaL_reg name##_methods[] = {
^ src/lcrypto.c:1774:15: error: array type has incomplete element type EVP_METHODS(decrypt); ^ src/lcrypto.c:1744:19: note: in definition of macro ‘EVP_METHODS’ struct luaL_reg name##_methods[] = {
^ src/lcrypto.c:1775:15: error: array type has incomplete element type EVP_METHODS(sign); ^ src/lcrypto.c:1744:19: note: in definition of macro ‘EVP_METHODS’ struct luaL_reg name##_methods[] = {
^ src/lcrypto.c:1776:15: error: array type has incomplete element type EVP_METHODS(verify); ^ src/lcrypto.c:1744:19: note: in definition of macro ‘EVP_METHODS’ struct luaL_reg name##_methods[] = {
^ src/lcrypto.c:1777:15: error: array type has incomplete element type EVP_METHODS(seal); ^ src/lcrypto.c:1744:19: note: in definition of macro ‘EVP_METHODS’ struct luaL_reg name##_methods[] = {
^ src/lcrypto.c:1778:15: error: array type has incomplete element type EVP_METHODS(open); ^ src/lcrypto.c:1744:19: note: in definition of macro ‘EVP_METHODS’ struct luaL_reg name##_methods[] = {
^ src/lcrypto.c:1779:19: error: array type has incomplete element type struct luaL_reg hmac_functions[] = { ^ src/lcrypto.c:1784:19: error: array type has incomplete element type struct luaL_reg hmac_methods[] = { ^ src/lcrypto.c:1794:19: error: array type has incomplete element type struct luaL_reg rand_functions[] = { ^ src/lcrypto.c:1805:19: error: array type has incomplete element type struct luaL_reg pkey_functions[] = { ^ src/lcrypto.c:1811:19: error: array type has incomplete element type struct luaL_reg pkey_methods[] = { ^ src/lcrypto.c:1818:19: error: array type has incomplete element type struct luaL_reg x509_functions[] = { ^ src/lcrypto.c:1821:19: error: array type has incomplete element type struct luaL_reg x509_methods[] = { ^ src/lcrypto.c:1827:19: error: array type has incomplete element type struct luaL_reg x509_ca_functions[] = { ^ src/lcrypto.c:1830:19: error: array type has incomplete element type struct luaL_reg x509_ca_methods[] = { ^ src/lcrypto.c: In function ‘luaopen_crypto’: src/lcrypto.c:1901:19: error: array type has incomplete element type struct luaL_reg core[] = { ^

Error: Failed installing dependency: https://rocks.moonscript.org/luacrypto-0.3.0.20120524-1.src.rock - Build error: Failed compiling object src/lcrypto.o Error. Exiting.

I am on Arch Linux

Sethlans avatar Jun 06 '15 14:06 Sethlans

Install lua-sec and maybe lua-crypto from AUR. And becareful, in arch default lua is lua 5.3.

rockneurotiko avatar Jun 06 '15 14:06 rockneurotiko

So I have to install the 5.2 version?

Sethlans avatar Jun 06 '15 14:06 Sethlans

Probably you will have to use lua-5.2 or lua-5.1 (I have it with lua 5.1)

rockneurotiko avatar Jun 06 '15 14:06 rockneurotiko

I've noticed that i have Lua 5.3 installed

Sethlans avatar Jun 06 '15 15:06 Sethlans

Try the following command:

$ luarocks install luacrypto 0.3.2-1 --local

starius avatar Nov 02 '15 00:11 starius

The official rockspec for luacrypto has the following Lua version line:

dependencies = {
        "lua >= 5.1, < 5.3",
}

That is why luarocks doesn't list this version for Lua 5.3.

I have fixed incompatibilities with Lua 5.3 this issue in my fork of luacrypto and uploaded modified rockspec to gist.

The following command installs luacrypto from my fork. It should work for Lua 5.3.

$ luarocks install https://gist.githubusercontent.com/starius/b20d3e63929ae678c857/raw/4b4499f442337b6f577422364358590bd00c9d48/luacrypto-0.3.2-2.rockspec --local

You can use this workaround until this issue is fixed in the upstream.

starius avatar Nov 02 '15 20:11 starius

Thank you - this rockspec workaround finally fixed my issue. Any idea when LuaCrypto rockspec will be updated in the main repository?

FuriouslyCurious avatar Jul 03 '16 00:07 FuriouslyCurious

Any idea when LuaCrypto rockspec will be updated in the main repository?

Unfortunately, the main repo seems abandoned.

starius avatar Jul 03 '16 00:07 starius

Yeah :-( I have opened an issue, hopefully that gets it updated. Thank you for the workaround in the meantime!

FuriouslyCurious avatar Jul 03 '16 01:07 FuriouslyCurious