commit:     e1469bfbcb388eb9f6d036befb2f1baa974e2bc1
Author:     Petr Vaněk <arkamar <AT> gentoo <DOT> org>
AuthorDate: Thu May  8 06:59:23 2025 +0000
Commit:     Petr Vaněk <arkamar <AT> gentoo <DOT> org>
CommitDate: Thu May  8 07:30:59 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1469bfb

mail-filter/rspamd: Fix doctest 2.4.12 compatibility

Upstream-PR: https://github.com/rspamd/rspamd/pull/5458
Closes: https://bugs.gentoo.org/955440
Signed-off-by: Petr Vaněk <arkamar <AT> gentoo.org>

 .../rspamd-3.11.1-doctest-compatibility.patch      | 45 ++++++++++++++++++++++
 ...spamd-3.11.1.ebuild => rspamd-3.11.1-r1.ebuild} |  3 ++
 2 files changed, 48 insertions(+)

diff --git a/mail-filter/rspamd/files/rspamd-3.11.1-doctest-compatibility.patch 
b/mail-filter/rspamd/files/rspamd-3.11.1-doctest-compatibility.patch
new file mode 100644
index 000000000000..68d91b4c3124
--- /dev/null
+++ b/mail-filter/rspamd/files/rspamd-3.11.1-doctest-compatibility.patch
@@ -0,0 +1,45 @@
+From 08e94fb8276b568e33480df60dec0a72ba1bef26 Mon Sep 17 00:00:00 2001
+From: Alexandra Parker <[email protected]>
+Date: Wed, 7 May 2025 13:17:32 -0700
+Subject: [PATCH] [Fix] libmime: declare comparators const for doctest 2.4.12
+ compatibility
+
+Petr Vaněk pointed out a change in doctest 2.4.12 that broke the libmime
+test code:
+https://github.com/doctest/doctest/commit/d7a5eeb820b61cc3af8a61b3117f76a403b7742a
+
+CHECK is now treats LHS as const and the compiler won't find non-const
+operator== as a result. It's reasonable for comparators to be const, so
+make them const.
+
+Signed-Off-By: Alexandra Parker <[email protected]>
+Upstream-PR: https://github.com/rspamd/rspamd/pull/5458
+
+diff --git a/src/libmime/mime_string.hxx b/src/libmime/mime_string.hxx
+index b181576d33..d6c11d018b 100644
+--- a/src/libmime/mime_string.hxx
++++ b/src/libmime/mime_string.hxx
+@@ -497,19 +497,19 @@ public:
+       }
+ 
+       /* Comparison */
+-      auto operator==(const basic_mime_string &other)
++      auto operator==(const basic_mime_string &other) const
+       {
+               return other.storage == storage;
+       }
+-      auto operator==(const storage_type &other)
++      auto operator==(const storage_type &other) const
+       {
+               return other == storage;
+       }
+-      auto operator==(const view_type &other)
++      auto operator==(const view_type &other) const
+       {
+               return other == storage;
+       }
+-      auto operator==(const CharT *other)
++      auto operator==(const CharT *other) const
+       {
+               if (other == NULL) {
+                       return false;

diff --git a/mail-filter/rspamd/rspamd-3.11.1.ebuild 
b/mail-filter/rspamd/rspamd-3.11.1-r1.ebuild
similarity index 97%
rename from mail-filter/rspamd/rspamd-3.11.1.ebuild
rename to mail-filter/rspamd/rspamd-3.11.1-r1.ebuild
index a1465d928f29..83ff23a2295d 100644
--- a/mail-filter/rspamd/rspamd-3.11.1.ebuild
+++ b/mail-filter/rspamd/rspamd-3.11.1-r1.ebuild
@@ -75,6 +75,9 @@ PATCHES=(
 
        # backward compatibility with <dev-libs/libfmt-11
        "${FILESDIR}/${PN}-3.9.0-older-libfmt.patch"
+
+       # compatibility for doctest-2.4.12, bug 955440
+       "${FILESDIR}/${PN}-3.11.1-doctest-compatibility.patch"
 )
 
 src_prepare() {

Reply via email to