diff --git a/rspamd-moonjit.patch b/rspamd-moonjit.patch new file mode 100644 index 0000000..f68cae6 --- /dev/null +++ b/rspamd-moonjit.patch @@ -0,0 +1,40 @@ +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); diff --git a/rspamd.changes b/rspamd.changes index e877176..25c936a 100644 --- a/rspamd.changes +++ b/rspamd.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Apr 16 20:49:12 UTC 2020 - Hans-Peter Jansen + +- apply rspamd-moonjit.patch in order to allow using moonjit + ------------------------------------------------------------------- Wed Apr 1 21:48:03 UTC 2020 - Wolfgang Rosenauer diff --git a/rspamd.spec b/rspamd.spec index 3a35396..a79635b 100644 --- a/rspamd.spec +++ b/rspamd.spec @@ -31,6 +31,9 @@ %if (0%{?suse_version} >= 1315) %bcond_without luajit %endif + %if 0%{?suse_version} >= 1500 + %bcond_without moonjit + %endif %endif %if 0%{?suse_version} >= 1500 && ! 0%{?sle_version} @@ -60,6 +63,7 @@ Group: Productivity/Networking/Email/Utilities Source0: https://github.com/rspamd/rspamd/archive/%{version}/%{name}-%{version}.tar.gz Patch0: rspamd-conf.patch Patch1: rspamd-after-redis-target.patch +Patch2: rspamd-moonjit.patch BuildRequires: cmake BuildRequires: curl-devel BuildRequires: db-devel @@ -149,6 +153,9 @@ This package holds the client tools (rspamc and rspamadm) %setup -q %patch0 -p1 %patch1 -p1 +%if %{with moonjit} +%patch2 -p1 +%endif %build %cmake \