Commit b03afe69 authored by Duncan Bellamy's avatar Duncan Bellamy Committed by Rasmus Thomsen
Browse files

community/rspamd: backport lua fix for non x86 x86_64 arches

* from #11340
parent cc0df111
diff -Nurp a/CMakeLists.txt b.allerrors/CMakeLists.txt
--- a/CMakeLists.txt 2020-09-30 20:27:23.000000000 +0100
+++ b.allerrors/CMakeLists.txt 2020-12-27 18:35:06.703013307 +0000
@@ -23,6 +23,8 @@ SET(RSPAMD_VERSION "${RSPAMD_VER
PROJECT(rspamd VERSION "${RSPAMD_VERSION}" LANGUAGES C CXX ASM)
+CMAKE_POLICY(SET CMP0075 NEW)
+
# This is supported merely with cmake 3.1
SET(CMAKE_C_STANDARD 11)
SET(CMAKE_C_STANDARD_REQUIRED ON)
diff -Nurp a/contrib/mumhash/mum.h b.allerrors/contrib/mumhash/mum.h
--- a/contrib/mumhash/mum.h 2020-09-30 20:27:23.000000000 +0100
+++ b.allerrors/contrib/mumhash/mum.h 2020-12-27 18:05:30.916331886 +0000
@@ -115,7 +115,7 @@ _mum (uint64_t v, uint64_t p) {
multiplication. If we use a generic code we actually call a
function doing 128x128->128 bit multiplication. The function is
very slow. */
- lo = v * p, hi;
+ lo = v * p;
__asm__ ("umulh %0, %1, %2" : "=r" (hi) : "r" (v), "r" (p));
#else
__uint128_t r = (__uint128_t) v * (__uint128_t) p;
--- a/cmake/FindLua.cmake
+++ b/cmake/FindLua.cmake
@@ -93,7 +93,7 @@
HINTS
"${RSPAMD_SEARCH_PATH}" "${LUA_ROOT}"
$ENV{LUA_DIR}
- PATH_SUFFIXES lib64 lib
+ PATH_SUFFIXES lib64 lib lua5.3
PATHS ${RSPAMD_DEFAULT_LIBRARY_PATHS}
DOC "Lua library"
)
......@@ -6,7 +6,7 @@
# Contributor: Duncan Bellamy <dunk@denkimushi.com>
pkgname=rspamd
pkgver=2.5
pkgrel=6
pkgrel=7
pkgdesc="Fast, free and open-source spam filtering system"
url="https://rspamd.com/"
arch="all"
......@@ -24,7 +24,6 @@ makedepends="
libevent-dev
libsodium-dev
openssl-dev
luajit-dev
pcre2-dev
perl
ragel
......@@ -50,8 +49,19 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/rspamd/rspamd/archive/$pkgve
30-conf-split-workers.patch
20-default-configs.patch
10-control_socket.patch
09-lua-suffix.patch
08-errors.patch
"
case "$CARCH" in
x86|x86_64)
makedepends="$makedepends luajit-dev"
_jit="ON" ;;
*)
makedepends="$makedepends lua5.3-dev"
_jit="OFF" ;;
esac
build() {
if [ "$CBUILD" != "$CHOST" ]; then
CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
......@@ -66,6 +76,7 @@ build() {
-DENABLE_REDIRECTOR=ON \
-DENABLE_URL_INCLUDE=ON \
-DENABLE_PCRE2=ON \
-DENABLE_LUAJIT="$_jit" \
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-DCMAKE_C_FLAGS="$CFLAGS" \
"$CMAKE_CROSSOPTS" .
......@@ -162,4 +173,6 @@ sha512sums="6068309da98eeb75f95188414b12ce9443aef31200853f820646e70e1dbf2d9d1e2c
a2003ef0c9d64a44480f59302864a2dfedcbe3a0047fcbb655408bc8aae9014b6ad0ddc6b64d4abeeb21bea0f86678afd30589ac8eed83e07ad7f87710e93702 rspamd.confd
a8aefee649bf6630339d1d3f2bb20c25ca70b21a8eaa92951e926d0fd4525f1d4ac4cc7ea66ac2b15323cf02c93c759ddf7181502f0d71b21384ced9d88c008e 30-conf-split-workers.patch
8801e3af59886847c25c87ca2f231cd9ededf35f376f9920967e72696fb017b1a4312f3a49017b52f65556bfe5c9f74a80405643afa32bb2906c38d39c5e1818 20-default-configs.patch
6f828601ce460f2fd3b1c430974b719e36b0aa5600bd7074683fd646d99a4e76da35840b54c50416a9ae6d87babe39c5d463fc2ec05814e164a96d16f5da18b7 10-control_socket.patch"
6f828601ce460f2fd3b1c430974b719e36b0aa5600bd7074683fd646d99a4e76da35840b54c50416a9ae6d87babe39c5d463fc2ec05814e164a96d16f5da18b7 10-control_socket.patch
2fbcdf32ec8ac945dbadcdb908500574ea48304e8722d1328f9f196e9278cd1868f258fa63f03bdaacce66788a55130bfc2f565e92d1d94f2c1740a2d70b52c4 09-lua-suffix.patch
d13b07ec403209ab0b62cb309c43eca483888d10c127a83ce1358439af88802616477e57f530064f178d64bdea63555e581ef07ee41c70eab03014804144e0f4 08-errors.patch"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment