Enables building with LuaRocks and MS compilers

A patch is added to the rockspec to fix an issue in the
interaction between LuaRocks and Microsoft compilers.

LuaRocks build backend assumes the library being built will
allways export a symbol called "luaopen_<library name>". This is
not the case with LuaSec so it fails to link.
The patch just adds an empty implementation of that, so it will
properly link.
This commit is contained in:
Ignacio Burgueño 2016-01-31 15:35:19 -03:00
parent 73a2c4ceda
commit 8eb48c2d8b

View File

@ -1,5 +1,5 @@
package = "LuaSec"
version = "0.6alpha-2"
version = "0.6alpha-3"
source = {
url = "git://github.com/brunoos/luasec.git",
tag = "luasec-0.6alpha"
@ -93,6 +93,21 @@ build = {
"src/luasocket/timeout.c", "src/luasocket/wsocket.c"
}
}
},
patches = {
["luarocks_vs_compiler.patch"] = [[
--- a/src/ssl.c.orig
+++ b/src/ssl.c
@@ -844,3 +844,8 @@ LSEC_API int luaopen_ssl_core(lua_State *L)
return 1;
}
+
+#if defined(_MSC_VER)
+/* Empty implementation to allow building with LuaRocks and MS compilers */
+LSEC_API int luaopen_ssl(lua_State *L) { return 0; }
+#endif
]]
}
}
}