From 2f13b0922ae775e02536d546e8e89075d84bf189 Mon Sep 17 00:00:00 2001 From: Steven Thomas Smith Date: Fri, 12 Jun 2026 07:29:27 -0400 Subject: [PATCH] rspamd: Update to version 4.1.0 --- mail/rspamd/Portfile | 25 ++++-- mail/rspamd/files/patch-mime_string_hxx.diff | 95 ++++++++++++++++++++ 2 files changed, 112 insertions(+), 8 deletions(-) create mode 100644 mail/rspamd/files/patch-mime_string_hxx.diff diff --git a/mail/rspamd/Portfile b/mail/rspamd/Portfile index 7cb4354f9fd..d8c13821374 100644 --- a/mail/rspamd/Portfile +++ b/mail/rspamd/Portfile @@ -5,13 +5,13 @@ PortGroup cmake 1.1 PortGroup github 1.0 PortGroup legacysupport 1.1 -github.setup rspamd rspamd 4.0.0 -revision 1 +github.setup rspamd rspamd 4.1.0 +revision 0 categories mail license BSD maintainers nomaintainer license Apache-2 -homepage https://rspamd.com +supported_archs arm64 x86_64 github.tarball_from archive description Rapid spam filtering system. @@ -36,9 +36,11 @@ long_description Rspamd is an advanced spam filtering system and \ API to access external resources, such as DNS, \ HTTP or even generic TCP/UDP services. -checksums rmd160 07b9dd3169b4c7921ba84dc89bb164d557ca948b \ - sha256 badd46de83a3dc831263bead1ffa7f5c9a1cea63e01e04493e89cd831732b7ff \ - size 6985425 +homepage https://rspamd.com + +checksums rmd160 8d4cd7f917b8ed1e2f9bac6297441bfb1c084c7e \ + sha256 1e92b976aff69fe0b74c02819a2a26b5821e55f185b9acdb5ddc1c08bcbfde19 \ + size 7161409 # open_memstream, fmemopen, std::filesystem legacysupport.newest_darwin_requires_legacy 18 @@ -47,7 +49,8 @@ legacysupport.use_mp_libcxx yes depends_build-append \ path:bin/pkg-config:pkgconfig -depends_lib-append port:fann \ +depends_lib-append port:doctest \ + port:fann \ port:gd2 \ path:lib/pkgconfig/glib-2.0.pc:glib2 \ port:gmime \ @@ -72,6 +75,10 @@ depends_lib-append port:fann \ depends_run-append port:hiredis \ port:redis +# https://github.com/rspamd/rspamd/issues/6093 +# diff -NaurdwB ./rspamd-orig/src/libmime/mime_string.hxx ./rspamd-new/src/libmime/mime_string.hxx | sed -E -e 's/\.\/rspamd-(orig|new)/\./g' | sed -E -e 's|/opt/local|@@PREFIX@@|g' > ~/Downloads/patch-mime_string_hxx.diff +patchfiles-append patch-mime_string_hxx.diff + variant hyperscan \ description {Use hyperscan instead of vectorscan.} { if {${build_arch} ne {x86_64}} { @@ -89,7 +96,6 @@ variant hyperscan \ } # Match requirements of dependency vectorscan -supported_archs arm64 x86_64 compiler.cxx_standard 2020 # Previous issue note; see https://github.com/rspamd/rspamd/issues/2884 @@ -107,6 +113,9 @@ libpath ${prefix}/var/lib/${name} # See https://github.com/rspamd/rspamd/issues/2883 cmake.set_osx_architectures no +configure.cppflags-prepend \ + "-I${worksrcpath}/contrib/doctest/doctest" + # Reference: https://github.com/rspamd/rspamd/blob/master/CMakeLists.txt # Also see https://github.com/rspamd/rspamd/issues/2884 configure.args-append \ diff --git a/mail/rspamd/files/patch-mime_string_hxx.diff b/mail/rspamd/files/patch-mime_string_hxx.diff new file mode 100644 index 00000000000..26cc05293c5 --- /dev/null +++ b/mail/rspamd/files/patch-mime_string_hxx.diff @@ -0,0 +1,95 @@ +--- ./src/libmime/mime_string.hxx 2026-06-12 07:07:05 ++++ ./src/libmime/mime_string.hxx 2026-06-12 07:17:42 +@@ -94,7 +94,7 @@ + return idx != it.idx; + } + +- iterator_base(difference_type index, Container *instance) noexcept ++ iterator_base(difference_type index, const Container *instance) noexcept + : idx(index), cont_instance(instance) + { + } +@@ -103,7 +103,7 @@ + + iterator_base &operator=(const iterator_base &) noexcept = default; + +- Container *get_instance() const noexcept ++ const Container *get_instance() const noexcept + { + return cont_instance; + } +@@ -118,7 +118,7 @@ + + protected: + difference_type idx; +- Container *cont_instance = nullptr; ++ const Container *cont_instance = nullptr; + + protected: + void advance(difference_type n) noexcept +@@ -164,7 +164,7 @@ + return idx != it.idx; + } + +- iterator_base(difference_type index, Container *instance) noexcept ++ iterator_base(difference_type index, const Container *instance) noexcept + : idx(index), cont_instance(instance) + { + } +@@ -172,7 +172,7 @@ + iterator_base() noexcept = default; + iterator_base(const iterator_base &) noexcept = default; + iterator_base &operator=(const iterator_base &) noexcept = default; +- Container *get_instance() const noexcept ++ const Container *get_instance() const noexcept + { + return cont_instance; + } +@@ -184,7 +184,7 @@ + + protected: + difference_type idx; +- Container *cont_instance = nullptr; ++ const Container *cont_instance = nullptr; + + protected: + //! Advance the iterator n times (negative values allowed!) +@@ -210,7 +210,7 @@ + + template + struct iterator : iterator_base { +- iterator(typename iterator_base::difference_type index, Container *instance) noexcept ++ iterator(typename iterator_base::difference_type index, const Container *instance) noexcept + : iterator_base(index, instance) + { + } +@@ -523,17 +523,17 @@ + } + + /* Iterators */ +- inline auto begin() noexcept -> iterator ++ inline auto begin() const noexcept -> iterator + { + return {0, this}; + } + +- inline auto raw_begin() noexcept -> raw_iterator ++ inline auto raw_begin() const noexcept -> raw_iterator + { + return {0, this}; + } + +- inline auto end() noexcept -> iterator ++ inline auto end() const noexcept -> iterator + { + return {(difference_type) size(), this}; + } +@@ -569,7 +569,7 @@ + + + /* For doctest stringify */ +- friend std::ostream &operator<<(std::ostream &os, const CharT &value) ++ friend std::ostream &operator<<(std::ostream &os, const basic_mime_string &value) + { + os << value.storage; + return os;