commit:     08f5c2682300ed9088fc4ead069a4e69fc85b4dc
Author:     Petr Vaněk <arkamar <AT> atlas <DOT> cz>
AuthorDate: Tue Sep  1 12:06:43 2020 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Fri Oct  2 07:21:44 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=08f5c268

mail-filter/rspamd: sync live

Package-Manager: Portage-3.0.4, Repoman-2.3.23
Signed-off-by: Petr Vaněk <arkamar <AT> atlas.cz>
Closes: https://github.com/gentoo/gentoo/pull/17345
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 .../files/rspamd-9999-unbundle-hiredis.patch       |  93 +++++++++++++++
 .../rspamd/files/rspamd-9999-unbundle-lua.patch    | 101 ++++++++++++++++
 .../rspamd/files/rspamd-9999-unbundle-zstd.patch   | 128 +++++++++++++++++++++
 mail-filter/rspamd/rspamd-9999.ebuild              |  13 ++-
 4 files changed, 331 insertions(+), 4 deletions(-)

diff --git a/mail-filter/rspamd/files/rspamd-9999-unbundle-hiredis.patch 
b/mail-filter/rspamd/files/rspamd-9999-unbundle-hiredis.patch
new file mode 100644
index 00000000000..875009da41a
--- /dev/null
+++ b/mail-filter/rspamd/files/rspamd-9999-unbundle-hiredis.patch
@@ -0,0 +1,93 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0afb5feff..966173075 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -170,6 +170,8 @@ ELSE()
+               ROOT ${PCRE_ROOT_DIR} MODULES pcre libpcre pcre3 libpcre3)
+ ENDIF()
+ 
++ProcessPackage(HIREDIS LIBRARY hiredis INCLUDE hiredis.h
++      ROOT ${HIREDIS_ROOT_DIR} MODULES hiredis)
+ ProcessPackage(ZSTD LIBRARY zstd INCLUDE zstd.h
+       ROOT ${ZSTD_ROOT_DIR} MODULES libzstd)
+ ProcessPackage(SQLITE3 LIBRARY sqlite3 INCLUDE sqlite3.h INCLUDE_SUFFIXES 
include/sqlite3 include/sqlite
+@@ -555,9 +557,7 @@ ENDIF(NOT DESTDIR)
+ 
+ 
+ ################################ SUBDIRS SECTION ###########################
+-ADD_SUBDIRECTORY(contrib/hiredis)
+ SET(WITH_HIREDIS 1)
+-INCLUDE_DIRECTORIES(BEFORE "${CMAKE_SOURCE_DIR}/contrib/hiredis")
+ 
+ LIST(APPEND RSPAMD_REQUIRED_LIBRARIES "${CMAKE_REQUIRED_LIBRARIES}")
+ IF(HAVE_FETCH_H)
+@@ -604,7 +604,6 @@ ENDIF()
+ IF (ENABLE_SNOWBALL MATCHES "ON")
+       LIST(APPEND RSPAMD_REQUIRED_LIBRARIES stemmer)
+ ENDIF()
+-LIST(APPEND RSPAMD_REQUIRED_LIBRARIES rspamd-hiredis)
+ 
+ LIST(APPEND RSPAMD_REQUIRED_LIBRARIES rspamd-actrie)
+ LIST(APPEND RSPAMD_REQUIRED_LIBRARIES rspamd-t1ha)
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index e0e2edd58..4908013da 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -190,7 +190,6 @@ ENDIF()
+ IF (ENABLE_SNOWBALL MATCHES "ON")
+       TARGET_LINK_LIBRARIES(rspamd-server stemmer)
+ ENDIF()
+-TARGET_LINK_LIBRARIES(rspamd-server rspamd-hiredis)
+ 
+ IF (ENABLE_FANN MATCHES "ON")
+       TARGET_LINK_LIBRARIES(rspamd-server fann)
+diff --git a/src/libserver/fuzzy_backend/fuzzy_backend_redis.c 
b/src/libserver/fuzzy_backend/fuzzy_backend_redis.c
+index d1e3e7532..882acdf6a 100644
+--- a/src/libserver/fuzzy_backend/fuzzy_backend_redis.c
++++ b/src/libserver/fuzzy_backend/fuzzy_backend_redis.c
+@@ -22,8 +22,8 @@
+ #include "cryptobox.h"
+ #include "str_util.h"
+ #include "upstream.h"
+-#include "contrib/hiredis/hiredis.h"
+-#include "contrib/hiredis/async.h"
++#include <hiredis.h>
++#include <async.h>
+ #include "lua/lua_common.h"
+ 
+ #define REDIS_DEFAULT_PORT 6379
+diff --git a/src/libserver/redis_pool.c b/src/libserver/redis_pool.c
+index 7e835013c..fccf189e1 100644
+--- a/src/libserver/redis_pool.c
++++ b/src/libserver/redis_pool.c
+@@ -18,9 +18,9 @@
+ #include "contrib/libev/ev.h"
+ #include "redis_pool.h"
+ #include "cfg_file.h"
+-#include "contrib/hiredis/hiredis.h"
+-#include "contrib/hiredis/async.h"
+-#include "contrib/hiredis/adapters/libev.h"
++#include <hiredis.h>
++#include <async.h>
++#include <adapters/libev.h>
+ #include "cryptobox.h"
+ #include "logger.h"
+ 
+diff --git a/src/lua/lua_redis.c b/src/lua/lua_redis.c
+index f9dbbdd13..b885a8b61 100644
+--- a/src/lua/lua_redis.c
++++ b/src/lua/lua_redis.c
+@@ -17,8 +17,8 @@
+ #include "lua_thread_pool.h"
+ #include "utlist.h"
+ 
+-#include "contrib/hiredis/hiredis.h"
+-#include "contrib/hiredis/async.h"
++#include <hiredis.h>
++#include <async.h>
+ 
+ #define REDIS_DEFAULT_TIMEOUT 1.0
+ 
+-- 
+2.25.3
+

diff --git a/mail-filter/rspamd/files/rspamd-9999-unbundle-lua.patch 
b/mail-filter/rspamd/files/rspamd-9999-unbundle-lua.patch
new file mode 100644
index 00000000000..c6f6324befc
--- /dev/null
+++ b/mail-filter/rspamd/files/rspamd-9999-unbundle-lua.patch
@@ -0,0 +1,101 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index b794b9dbd..90caf4048 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -111,7 +111,6 @@ INCLUDE_DIRECTORIES("${CMAKE_SOURCE_DIR}/"
+               "${CMAKE_SOURCE_DIR}/contrib/librdns"
+               "${CMAKE_SOURCE_DIR}/contrib/aho-corasick"
+               "${CMAKE_SOURCE_DIR}/contrib/lc-btrie"
+-              "${CMAKE_SOURCE_DIR}/contrib/lua-lpeg"
+               "${CMAKE_BINARY_DIR}/src" #Stored in the binary dir
+               "${CMAKE_BINARY_DIR}/src/libcryptobox")
+ 
+@@ -624,7 +623,6 @@ ENDIF()
+ ADD_SUBDIRECTORY(contrib/libucl)
+ ADD_SUBDIRECTORY(contrib/librdns)
+ ADD_SUBDIRECTORY(contrib/aho-corasick)
+-ADD_SUBDIRECTORY(contrib/lua-lpeg)
+ ADD_SUBDIRECTORY(contrib/t1ha)
+ ADD_SUBDIRECTORY(contrib/libev)
+ ADD_SUBDIRECTORY(contrib/kann)
+@@ -632,10 +630,6 @@ ADD_SUBDIRECTORY(contrib/fastutf8)
+ ADD_SUBDIRECTORY(contrib/google-ced)
+ 
+ 
+-IF (NOT WITH_LUAJIT)
+-      ADD_SUBDIRECTORY(contrib/lua-bit)
+-ENDIF()
+-
+ IF (ENABLE_LUA_REPL MATCHES "ON")
+       ADD_SUBDIRECTORY(contrib/replxx)
+       SET(WITH_LUA_REPL 1)
+@@ -735,7 +729,6 @@ INSTALL(FILES "contrib/lua-fun/fun.lua" DESTINATION 
${LUALIBDIR})
+ INSTALL(FILES "contrib/lua-argparse/argparse.lua" DESTINATION ${LUALIBDIR})
+ INSTALL(FILES "contrib/lua-tableshape/tableshape.lua" DESTINATION 
${LUALIBDIR})
+ INSTALL(FILES "contrib/lua-lupa/lupa.lua" DESTINATION ${LUALIBDIR})
+-INSTALL(FILES "contrib/lua-lpeg/lpegre.lua" DESTINATION ${LUALIBDIR})
+ 
+ # systemd unit
+ IF(CMAKE_SYSTEM_NAME STREQUAL "Linux" AND WANT_SYSTEMD_UNITS MATCHES "ON")
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 9a34d2ac4..54b2e4083 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -180,7 +180,6 @@ ENDIF()
+ TARGET_LINK_LIBRARIES(rspamd-server rspamd-http-parser)
+ TARGET_LINK_LIBRARIES(rspamd-server rspamd-fpconv)
+ TARGET_LINK_LIBRARIES(rspamd-server rspamd-cdb)
+-TARGET_LINK_LIBRARIES(rspamd-server rspamd-lpeg)
+ TARGET_LINK_LIBRARIES(rspamd-server lcbtrie)
+ TARGET_LINK_LIBRARIES(rspamd-server rspamd-zstd)
+ TARGET_LINK_LIBRARIES(rspamd-server rspamd-fastutf8)
+@@ -189,10 +188,6 @@ IF (ENABLE_CLANG_PLUGIN MATCHES "ON")
+       ADD_DEPENDENCIES(rspamd-server rspamd-clang)
+ ENDIF()
+ 
+-IF (NOT WITH_LUAJIT)
+-      TARGET_LINK_LIBRARIES(rspamd-server rspamd-bit)
+-ENDIF()
+-
+ IF (ENABLE_SNOWBALL MATCHES "ON")
+       TARGET_LINK_LIBRARIES(rspamd-server stemmer)
+ ENDIF()
+diff --git a/src/lua/lua_common.c b/src/lua/lua_common.c
+index b7fcc2034..b8120af97 100644
+--- a/src/lua/lua_common.c
++++ b/src/lua/lua_common.c
+@@ -14,7 +14,6 @@
+  * limitations under the License.
+  */
+ #include "lua_common.h"
+-#include "lptree.h"
+ #include "utlist.h"
+ #include "unix-std.h"
+ #include "ottery.h"
+@@ -922,10 +921,6 @@ rspamd_lua_wipe_realloc (void *ud,
+       return NULL;
+ }
+ 
+-#ifndef WITH_LUAJIT
+-extern int luaopen_bit(lua_State *L);
+-#endif
+-
+ lua_State *
+ rspamd_lua_init (bool wipe_mem)
+ {
+@@ -981,7 +976,6 @@ rspamd_lua_init (bool wipe_mem)
+       luaopen_spf (L);
+       luaopen_tensor (L);
+ #ifndef WITH_LUAJIT
+-      rspamd_lua_add_preload (L, "bit", luaopen_bit);
+       lua_settop (L, 0);
+ #endif
+ 
+@@ -991,7 +985,6 @@ rspamd_lua_init (bool wipe_mem)
+       rspamd_lua_new_class (L, "rspamd{session}", NULL);
+       lua_pop (L, 1);
+ 
+-      rspamd_lua_add_preload (L, "lpeg", luaopen_lpeg);
+       luaopen_ucl (L);
+       rspamd_lua_add_preload (L, "ucl", luaopen_ucl);
+ 

diff --git a/mail-filter/rspamd/files/rspamd-9999-unbundle-zstd.patch 
b/mail-filter/rspamd/files/rspamd-9999-unbundle-zstd.patch
new file mode 100644
index 00000000000..1a7f4453c86
--- /dev/null
+++ b/mail-filter/rspamd/files/rspamd-9999-unbundle-zstd.patch
@@ -0,0 +1,128 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 90caf4048..e2e5d182c 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -198,6 +198,8 @@ ELSE()
+               ROOT ${PCRE_ROOT_DIR} MODULES pcre libpcre pcre3 libpcre3)
+ ENDIF()
+ 
++ProcessPackage(ZSTD LIBRARY zstd INCLUDE zstd.h
++      ROOT ${ZSTD_ROOT_DIR} MODULES libzstd)
+ ProcessPackage(SQLITE3 LIBRARY sqlite3 INCLUDE sqlite3.h INCLUDE_SUFFIXES 
include/sqlite3 include/sqlite
+       ROOT ${SQLITE3_ROOT_DIR} MODULES sqlite3 sqlite)
+ ProcessPackage(ICUDATA LIBRARY icudata INCLUDE unicode/ucnv.h
+@@ -615,7 +617,6 @@ ADD_SUBDIRECTORY(contrib/http-parser)
+ ADD_SUBDIRECTORY(contrib/fpconv)
+ ADD_SUBDIRECTORY(contrib/lc-btrie)
+ ADD_SUBDIRECTORY(contrib/libottery)
+-ADD_SUBDIRECTORY(contrib/zstd)
+ IF(ENABLE_SNOWBALL MATCHES "ON")
+       ADD_SUBDIRECTORY(contrib/snowball)
+       SET(WITH_SNOWBALL 1)
+diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
+index 54b2e4083..e0e2edd58 100644
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -181,7 +181,6 @@ TARGET_LINK_LIBRARIES(rspamd-server rspamd-http-parser)
+ TARGET_LINK_LIBRARIES(rspamd-server rspamd-fpconv)
+ TARGET_LINK_LIBRARIES(rspamd-server rspamd-cdb)
+ TARGET_LINK_LIBRARIES(rspamd-server lcbtrie)
+-TARGET_LINK_LIBRARIES(rspamd-server rspamd-zstd)
+ TARGET_LINK_LIBRARIES(rspamd-server rspamd-fastutf8)
+ 
+ IF (ENABLE_CLANG_PLUGIN MATCHES "ON")
+diff --git a/src/client/rspamdclient.c b/src/client/rspamdclient.c
+index bcb25672e..48ca58e94 100644
+--- a/src/client/rspamdclient.c
++++ b/src/client/rspamdclient.c
+@@ -19,7 +19,7 @@
+ #include "libserver/http/http_private.h"
+ #include "libserver/protocol_internal.h"
+ #include "unix-std.h"
+-#include "contrib/zstd/zstd.h"
++#include <zstd.h>
+ 
+ #ifdef HAVE_FETCH_H
+ #include <fetch.h>
+diff --git a/src/libserver/cfg_utils.c b/src/libserver/cfg_utils.c
+index 78e3fc79f..40110c693 100644
+--- a/src/libserver/cfg_utils.c
++++ b/src/libserver/cfg_utils.c
+@@ -36,8 +36,7 @@
+ #include "contrib/libottery/ottery.h"
+ #include "contrib/fastutf8/fastutf8.h"
+ 
+-#define ZSTD_STATIC_LINKING_ONLY
+-#include "contrib/zstd/zstd.h"
++#include <zstd.h>
+ 
+ #ifdef HAVE_OPENSSL
+ #include <openssl/rand.h>
+diff --git a/src/libserver/maps/map.c b/src/libserver/maps/map.c
+index 8b9f522b2..8cf03ffd6 100644
+--- a/src/libserver/maps/map.c
++++ b/src/libserver/maps/map.c
+@@ -23,7 +23,7 @@
+ #include "libserver/http/http_connection.h"
+ #include "libserver/http/http_private.h"
+ #include "rspamd.h"
+-#include "contrib/zstd/zstd.h"
++#include <zstd.h>
+ #include "contrib/libev/ev.h"
+ #include "contrib/uthash/utlist.h"
+ 
+diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c
+index 9d1276064..6f0a66fb8 100644
+--- a/src/libserver/protocol.c
++++ b/src/libserver/protocol.c
+@@ -21,7 +21,7 @@
+ #include "worker_private.h"
+ #include "libserver/cfg_file_private.h"
+ #include "libmime/scan_result_private.h"
+-#include "contrib/zstd/zstd.h"
++#include <zstd.h>
+ #include "lua/lua_common.h"
+ #include "unix-std.h"
+ #include "protocol_internal.h"
+diff --git a/src/libserver/task.c b/src/libserver/task.c
+index 53da0dae6..6538abdbf 100644
+--- a/src/libserver/task.c
++++ b/src/libserver/task.c
+@@ -25,7 +25,7 @@
+ #include "stat_api.h"
+ #include "unix-std.h"
+ #include "utlist.h"
+-#include "contrib/zstd/zstd.h"
++#include <zstd.h>
+ #include "libserver/mempool_vars_internal.h"
+ #include "libserver/cfg_file_private.h"
+ #include "libmime/lang_detection.h"
+diff --git a/src/lua/lua_util.c b/src/lua/lua_util.c
+index 0787736d5..21474317a 100644
+--- a/src/lua/lua_util.c
++++ b/src/lua/lua_util.c
+@@ -17,7 +17,7 @@
+ #include "html.h"
+ #include "tokenizers/tokenizers.h"
+ #include "unix-std.h"
+-#include "contrib/zstd/zstd.h"
++#include <zstd.h>
+ #include "contrib/uthash/utlist.h"
+ #include "libmime/email_addr.h"
+ #include "libmime/content_type.h"
+diff --git a/src/rspamd_proxy.c b/src/rspamd_proxy.c
+index 4ed8cfab7..5f8808e40 100644
+--- a/src/rspamd_proxy.c
++++ b/src/rspamd_proxy.c
+@@ -36,7 +36,7 @@
+ #include "libserver/milter.h"
+ #include "libserver/milter_internal.h"
+ #include "libmime/lang_detection.h"
+-#include "contrib/zstd/zstd.h"
++#include <zstd.h>
+ 
+ #include <math.h>
+ 
+-- 
+2.26.2
+

diff --git a/mail-filter/rspamd/rspamd-9999.ebuild 
b/mail-filter/rspamd/rspamd-9999.ebuild
index b5d45580a5d..cad05375702 100644
--- a/mail-filter/rspamd/rspamd-9999.ebuild
+++ b/mail-filter/rspamd/rspamd-9999.ebuild
@@ -25,13 +25,17 @@ RDEPEND="
        app-arch/zstd
        dev-db/sqlite:3
        dev-libs/glib:2
+       dev-libs/hiredis:=
        dev-libs/icu:=
        dev-libs/libev
        dev-libs/libsodium
        dev-libs/snowball-stemmer
        net-libs/libnsl
        sys-apps/file
-       blas? ( sci-libs/openblas )
+       blas? (
+               virtual/blas
+               virtual/lapack
+       )
        cpu_flags_x86_ssse3? ( dev-libs/hyperscan )
        jemalloc? ( dev-libs/jemalloc )
        jit? (
@@ -54,15 +58,16 @@ BDEPEND="
 "
 
 PATCHES=(
-       "${FILESDIR}/rspamd-2.5-unbundle-lua.patch"
-       "${FILESDIR}/rspamd-2.5-unbundle-zstd.patch"
+       "${FILESDIR}/rspamd-9999-unbundle-lua.patch"
+       "${FILESDIR}/rspamd-9999-unbundle-zstd.patch"
        "${FILESDIR}/rspamd-2.5-unbundle-snowball.patch"
+       "${FILESDIR}/rspamd-9999-unbundle-hiredis.patch"
 )
 
 src_prepare() {
        cmake_src_prepare
 
-       rm -vrf contrib/{lua-{bit,lpeg},snowball,zstd} || die
+       rm -vrf contrib/{hiredis,lua-{bit,lpeg},snowball,zstd} || die
 
        sed -i -e 's/User=_rspamd/User=rspamd/g' \
                rspamd.service \

Reply via email to