commit:     88218a840c990719954f75cb24c6da4ebd33613e
Author:     Matthew Smith <matthew <AT> gentoo <DOT> org>
AuthorDate: Mon Apr  1 11:33:20 2024 +0000
Commit:     Matthew Smith <matthew <AT> gentoo <DOT> org>
CommitDate: Mon Apr  1 11:33:20 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=88218a84

net-mail/mu: fix musl build

Closes: https://bugs.gentoo.org/928361
Signed-off-by: Matthew Smith <matthew <AT> gentoo.org>

 net-mail/mu/files/mu-1.12.2-musl.patch | 31 +++++++++++++++++++++++++++++++
 net-mail/mu/mu-1.12.2.ebuild           |  3 +++
 2 files changed, 34 insertions(+)

diff --git a/net-mail/mu/files/mu-1.12.2-musl.patch 
b/net-mail/mu/files/mu-1.12.2-musl.patch
new file mode 100644
index 000000000000..35f6017e56f3
--- /dev/null
+++ b/net-mail/mu/files/mu-1.12.2-musl.patch
@@ -0,0 +1,31 @@
+From: https://github.com/djcb/mu/pull/2677
+From: Matthew Smith <[email protected]>
+Date: Mon, 1 Apr 2024 11:23:39 +0000
+Subject: [PATCH] mu-utils: Fix build with musl
+
+In musl, `stdout` is a macro that expands to `(stdout)`, and
+`::(stdout)` is not valid C++.
+
+../mu-1.12.2/lib/utils/mu-utils.hh:268:32: error: expected
+  id-expression before '(' token
+ 268 |                              ::stdout);
+     |                                ^~~~~~
+
+Nothing in the Mu namespace is named stdout, so it is safe to drop
+the `::`.
+
+Bug: https://bugs.gentoo.org/928361
+--- a/lib/utils/mu-utils.hh
++++ b/lib/utils/mu-utils.hh
+@@ -265,7 +265,7 @@ bool fputs_encoded (const std::string& str, FILE *stream);
+ template<typename...T>
+ static inline bool mu_print_encoded(fmt::format_string<T...> frm, T&&... 
args) noexcept {
+       return fputs_encoded(fmt::format(frm, std::forward<T>(args)...),
+-                           ::stdout);
++                           stdout);
+ }
+ 
+ /**
+-- 
+2.44.0
+

diff --git a/net-mail/mu/mu-1.12.2.ebuild b/net-mail/mu/mu-1.12.2.ebuild
index 04c44da48677..f4e55a3d9779 100644
--- a/net-mail/mu/mu-1.12.2.ebuild
+++ b/net-mail/mu/mu-1.12.2.ebuild
@@ -29,6 +29,9 @@ BDEPEND="
 PATCHES=(
        # https://bugs.gentoo.org/925503
        "${FILESDIR}"/${PN}-1.12.0-no-python.patch
+
+       # https://bugs.gentoo.org/928361
+       "${FILESDIR}"/${PN}-1.12.2-musl.patch
 )
 
 SITEFILE="70mu-gentoo-autoload.el"

Reply via email to