diff mbox series

[meta-gnome,11/26] evolution-data-server: define _GNU_SOURCE for strcasestr in imapx test

Message ID 20260929225723.1046705-11-khem.raj@oss.qualcomm.com
State New
Headers show
Series [meta-oe,01/26] canvenient: include <sys/time.h> for struct timeval on musl | expand

Commit Message

Khem Raj Sept. 29, 2026, 10:57 p.m. UTC
The camel-provider-imapx test uses strcasestr(), a GNU extension that
needs _GNU_SOURCE defined before <string.h> is included to be
declared.

AI-Generated: Uses Claude Code

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 .../evolution-data-server.bb                  |  1 +
 ...vider-imapx-define-_GNU_SOURCE-for-s.patch | 33 +++++++++++++++++++
 2 files changed, 34 insertions(+)
 create mode 100644 meta-gnome/recipes-gnome/evolution-data-server/evolution-data-server/0005-tests-camel-provider-imapx-define-_GNU_SOURCE-for-s.patch
diff mbox series

Patch

diff --git a/meta-gnome/recipes-gnome/evolution-data-server/evolution-data-server.bb b/meta-gnome/recipes-gnome/evolution-data-server/evolution-data-server.bb
index 8ed111b334..d1108b6b93 100644
--- a/meta-gnome/recipes-gnome/evolution-data-server/evolution-data-server.bb
+++ b/meta-gnome/recipes-gnome/evolution-data-server/evolution-data-server.bb
@@ -17,6 +17,7 @@  SRC_URI += "file://0001-cmake-Do-not-export-CC-into-gir-compiler.patch \
            file://0003-contact-Replace-the-Novell-sample-contact-with-somet.patch \
            file://0004-call-native-helpers.patch \
            file://0001-data-CMakeLists.txt-dont-create-automatic-google-log.patch \
+           file://0005-tests-camel-provider-imapx-define-_GNU_SOURCE-for-s.patch \
            file://iconv-detect.h \
            "

diff --git a/meta-gnome/recipes-gnome/evolution-data-server/evolution-data-server/0005-tests-camel-provider-imapx-define-_GNU_SOURCE-for-s.patch b/meta-gnome/recipes-gnome/evolution-data-server/evolution-data-server/0005-tests-camel-provider-imapx-define-_GNU_SOURCE-for-s.patch
new file mode 100644
index 0000000000..133932fb04
--- /dev/null
+++ b/meta-gnome/recipes-gnome/evolution-data-server/evolution-data-server/0005-tests-camel-provider-imapx-define-_GNU_SOURCE-for-s.patch
@@ -0,0 +1,33 @@ 
+From: Khem Raj <khem.raj@oss.qualcomm.com>
+Date: Tue, 29 Sep 2026 01:56:54 +0000
+Subject: [PATCH] tests: camel: provider-imapx: define _GNU_SOURCE for
+ strcasestr
+
+musl libc only declares strcasestr() in <string.h> when _GNU_SOURCE (or
+_BSD_SOURCE/_DEFAULT_SOURCE) is defined before the header is included,
+whereas glibc exposes this GNU extension unconditionally by default.
+Define _GNU_SOURCE as the first thing in the file, before any
+includes, so the prototype is visible on musl too.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
+---
+ src/camel/tests/test-camel-provider-imapx.c | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/camel/tests/test-camel-provider-imapx.c b/src/camel/tests/test-camel-provider-imapx.c
+index 1111111..2222222 100644
+--- a/src/camel/tests/test-camel-provider-imapx.c
++++ b/src/camel/tests/test-camel-provider-imapx.c
+@@ -3,6 +3,11 @@
+  * SPDX-License-Identifier: LGPL-2.0-or-later
+  */
+
++/* Needed for strcasestr(), which musl only declares in <string.h>
++ * when a GNU/BSD feature-test macro is defined; glibc exposes it
++ * unconditionally by default. */
++#define _GNU_SOURCE
++
+ #include "evolution-data-server-config.h"
+
+ #include <string.h>