aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDuncan Bellamy <dunk@denkimushi.com>2021-01-07 20:41:50 +0000
committerRasmus Thomsen <oss@cogitri.dev>2021-01-09 11:54:24 +0000
commitb03afe69ee39076246c2066d4097e232099c1e74 (patch)
tree8f7f702be2d72200f5580e2366e3d254084e2665
parentcc0df1112e9e20d96bf12d360c1bb85cb3d64f05 (diff)
downloadaports-b03afe69ee39076246c2066d4097e232099c1e74.tar.gz
aports-b03afe69ee39076246c2066d4097e232099c1e74.tar.bz2
aports-b03afe69ee39076246c2066d4097e232099c1e74.tar.xz
community/rspamd: backport lua fix for non x86 x86_64 arches
* from #11340
-rw-r--r--community/rspamd/08-errors.patch24
-rw-r--r--community/rspamd/09-lua-suffix.patch11
-rw-r--r--community/rspamd/APKBUILD19
3 files changed, 51 insertions, 3 deletions
diff --git a/community/rspamd/08-errors.patch b/community/rspamd/08-errors.patch
new file mode 100644
index 0000000000..cbfd21d586
--- /dev/null
+++ b/community/rspamd/08-errors.patch
@@ -0,0 +1,24 @@
+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;
diff --git a/community/rspamd/09-lua-suffix.patch b/community/rspamd/09-lua-suffix.patch
new file mode 100644
index 0000000000..428e24e5ed
--- /dev/null
+++ b/community/rspamd/09-lua-suffix.patch
@@ -0,0 +1,11 @@
+--- 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"
+ )
diff --git a/community/rspamd/APKBUILD b/community/rspamd/APKBUILD
index eed18f89c6..a5e443b7d6 100644
--- a/community/rspamd/APKBUILD
+++ b/community/rspamd/APKBUILD
@@ -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"