wayland: Fix wayland-scanner build for MinGW
PATCH 1/1 wayland: Fix wayland-scanner build for MinGW
Applies 2 patches to fix the wayland-scanner build for MinGW (e.g. nativesdk-wayland)
Signed-off-by Joshua Watt <[email protected]>
--- ...nner-Add-configure-check-for-strndup.patch | 50 ++++++ ...v_signal-to-wayland-server-private.h.patch | 166 ++++++++++++++++++ .../wayland/wayland_1.17.0.bb | 2 + 3 files changed, 218 insertions(+) create mode 100644 meta/recipes-graphics/wayland/wayland/0001-scanner-Add-configure-check-for-strndup.patch create mode 100644 meta/recipes-graphics/wayland/wayland/0002-Move-wl_priv_signal-to-wayland-server-private.h.patch
meta/recipes-graphics/wayland/wayland/0001-scanner-Add-configure-check-for-strndup.patch new file +50 -0
@@ -0,0 +1,50 @@ +From 3c8b4467a1ca229e72fb5223787ed400a19c65c0 Mon Sep 17 00:00:00 2001 +From: Joshua Watt <[email protected]> +Date: Fri, 25 Oct 2019 21:03:23 -0500 +Subject: [PATCH] scanner: Add configure check for strndup + +Some platforms may not have strndup() (e.g. MinGW), so provide a +equivalent implementation if it's not found. + +Upstream-Status: Accepted [4a1f348c20157db7bd7c759fdeb23fbe8729c571] +Signed-off-by: Joshua Watt <[email protected]> +--- + configure.ac | 2 +- + src/scanner.c | 11 +++++++++++ + 2 files changed, 12 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index 8d56f2b..1c99e21 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -63,7 +63,7 @@ fi + AC_SUBST(GCC_CFLAGS) + + AC_CHECK_HEADERS([sys/prctl.h]) +-AC_CHECK_FUNCS([accept4 mkostemp posix_fallocate prctl]) ++AC_CHECK_FUNCS([accept4 mkostemp posix_fallocate prctl strndup]) + + AC_ARG_ENABLE([libraries], + [AC_HELP_STRING([--disable-libraries], +diff --git a/src/scanner.c b/src/scanner.c +index a94be5d..27004bc 100644 +--- a/src/scanner.c ++++ b/src/scanner.c +@@ -916,6 +916,17 @@ verify_arguments(struct parse_context *ctx, + + } + ++#ifndef HAVE_STRNDUP ++char * ++strndup(const char *s, size_t size) ++{ ++ char *r = malloc(size + 1); ++ strncpy(r, s, size); ++ r[size] = '\0'; ++ return r; ++} ++#endif ++ + static void + end_element(void *data, const XML_Char *name) + {
meta/recipes-graphics/wayland/wayland/0002-Move-wl_priv_signal-to-wayland-server-private.h.patch new file +166 -0
166 lines not on this page · raw message
meta/recipes-graphics/wayland/wayland_1.17.0.bb +2 -0
@@ -14,6 +14,8 @@ DEPENDS = "expat libxml2 libffi wayland-native" SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ file://fixpathinpcfiles.patch \ + file://0001-scanner-Add-configure-check-for-strndup.patch \ + file://0002-Move-wl_priv_signal-to-wayland-server-private.h.patch \ " SRC_URI[md5sum] = "d91f970aea11fd549eae023d06f91af3" SRC_URI[sha256sum] = "72aa11b8ac6e22f4777302c9251e8fec7655dc22f9d94ee676c6b276f95f91a4"
Signature · 1 line
2.23.0