File rspamd-moonjit.patch of Package rspamd
Index: b/cmake/FindLua.cmake
===================================================================
--- a/cmake/FindLua.cmake
+++ b/cmake/FindLua.cmake
@@ -16,6 +16,7 @@ MACRO(FindLua)
"${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}"
$ENV{LUA_DIR}
PATH_SUFFIXES "include/luajit-2.0"
+ "include/moonjit-2.2"
"include/luajit-2.1"
"include/luajit${LUA_VERSION_MAJOR}${LUA_VERSION_MINOR}"
"include/luajit${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR}"
@@ -111,4 +112,4 @@ MACRO(FindLua)
MESSAGE(STATUS "Found lua ${LUA_VERSION_MAJOR}.${LUA_VERSION_MINOR} in lib:${LUA_LIBRARY}, headers:${LUA_INCLUDE_DIR}")
ENDIF(ENABLE_LUAJIT MATCHES "ON")
ENDIF(LUA_LIBRARY AND LUA_INCLUDE_DIR)
-ENDMACRO()
\ No newline at end of file
+ENDMACRO()
Index: b/src/lua/lua_common.h
===================================================================
--- a/src/lua/lua_common.h
+++ b/src/lua/lua_common.h
@@ -41,11 +41,16 @@ luaL_register (lua_State *L, const gchar
#endif
#if defined(LUA_VERSION_NUM) && LUA_VERSION_NUM == 501
+#if 0
+/* FIXME: need to check for LUAJIT_VERSION_NUM for moonjit
+ but cannot just include luajit.h unconditionally here
+*/
static inline int lua_absindex (lua_State *L, int i) {
if (i < 0 && i > LUA_REGISTRYINDEX)
i += lua_gettop(L) + 1;
return i;
}
+#endif
static inline int lua_rawgetp (lua_State *L, int i, const void *p) {
int abs_i = lua_absindex(L, i);
lua_pushlightuserdata(L, (void*)p);