commit:     de6ab90cff20bd9c5ff9724e4304de98de09562d
Author:     Eray Aslan <eras <AT> gentoo <DOT> org>
AuthorDate: Mon Jun  2 17:29:46 2025 +0000
Commit:     Eray Aslan <eras <AT> gentoo <DOT> org>
CommitDate: Mon Jun  2 17:29:46 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=de6ab90c

net-mail/dovecot: lib: cpu-count - fix compilation using musl

The macros, types and symbols CPU_* and cpuset_t are not exposed in
musl's sched.h unless _GNU_SOURCE is set.

Closes: https://bugs.gentoo.org/956960
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
Signed-off-by: Eray Aslan <eras <AT> gentoo.org>

 net-mail/dovecot/dovecot-2.4.1-r2.ebuild           |  1 +
 .../files/dovecot-2.4.1-fix-musl-build.patch       | 26 ++++++++++++++++++++++
 2 files changed, 27 insertions(+)

diff --git a/net-mail/dovecot/dovecot-2.4.1-r2.ebuild 
b/net-mail/dovecot/dovecot-2.4.1-r2.ebuild
index e08cbe9b65a0..c3189f78c53a 100644
--- a/net-mail/dovecot/dovecot-2.4.1-r2.ebuild
+++ b/net-mail/dovecot/dovecot-2.4.1-r2.ebuild
@@ -85,6 +85,7 @@ PATCHES=(
        "${FILESDIR}/${PN}-autoconf-lua-version-v3.patch"
        "${FILESDIR}/${PN}-2.4.1-gssapi-regression.patch"
        "${FILESDIR}/${PN}-2.4.1-fix-hardened-crash.patch"
+       "${FILESDIR}/${PN}-2.4.1-fix-musl-build.patch"
 )
 
 pkg_setup() {

diff --git a/net-mail/dovecot/files/dovecot-2.4.1-fix-musl-build.patch 
b/net-mail/dovecot/files/dovecot-2.4.1-fix-musl-build.patch
new file mode 100644
index 000000000000..7444d0008b2a
--- /dev/null
+++ b/net-mail/dovecot/files/dovecot-2.4.1-fix-musl-build.patch
@@ -0,0 +1,26 @@
+From 75fa589cb292133c4b5f47566c1b4de4b7bc4e35 Mon Sep 17 00:00:00 2001
+From: Fabian Groffen <[email protected]>
+Date: Sat, 31 May 2025 10:49:28 +0200
+Subject: [PATCH] lib: cpu-count - fix compilation using musl
+
+The macros, types and symbols CPU_* and cpuset_t are not exposed in
+musl's sched.h unless _GNU_SOURCE is set.
+
+Signed-off-by: Fabian Groffen <[email protected]>
+---
+ src/lib/cpu-count.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/src/lib/cpu-count.c b/src/lib/cpu-count.c
+index 3eb38fa47d..a3e80e6c15 100644
+--- a/src/lib/cpu-count.c
++++ b/src/lib/cpu-count.c
+@@ -3,6 +3,8 @@
+ 
+ #ifdef HAVE_SCHED_H
+ #  define __USE_GNU
++/* _GNU_SOURCE: for musl's sched.h to expose cpuset/CPU_* */
++#  define _GNU_SOURCE
+ #  include <sched.h>
+ #  ifdef HAVE_SYS_CPUSET_H
+ #    include <sys/cpuset.h>

Reply via email to