From 8eb48c2d8b17a01a1424d3b08277670590152ae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ignacio=20Burgue=C3=B1o?= Date: Sun, 31 Jan 2016 15:35:19 -0300 Subject: [PATCH] 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_". 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. --- ...pha-2.rockspec => luasec-0.6alpha-3.rockspec | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) rename luasec-0.6alpha-2.rockspec => luasec-0.6alpha-3.rockspec (87%) diff --git a/luasec-0.6alpha-2.rockspec b/luasec-0.6alpha-3.rockspec similarity index 87% rename from luasec-0.6alpha-2.rockspec rename to luasec-0.6alpha-3.rockspec index 3fe0044..f81b9b9 100644 --- a/luasec-0.6alpha-2.rockspec +++ b/luasec-0.6alpha-3.rockspec @@ -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 +]] } } }