diff options
Diffstat (limited to 'dev-libs/weston/files/weston-1.9.0-make-error-portable.patch')
-rw-r--r-- | dev-libs/weston/files/weston-1.9.0-make-error-portable.patch | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/dev-libs/weston/files/weston-1.9.0-make-error-portable.patch b/dev-libs/weston/files/weston-1.9.0-make-error-portable.patch new file mode 100644 index 0000000..508ddbd --- /dev/null +++ b/dev-libs/weston/files/weston-1.9.0-make-error-portable.patch @@ -0,0 +1,62 @@ +# Eliminate calls to error()/error.h, which are GNU extensions, not POSIX in order to compile with musl +# See https://patchwork.freedesktop.org/patch/50793/ + +diff -Naur weston-1.9.0.orig/configure.ac weston-1.9.0/configure.ac +--- weston-1.9.0.orig/configure.ac 2015-09-22 01:11:26.000000000 +0000 ++++ weston-1.9.0/configure.ac 2016-01-01 21:20:54.097472570 +0000 +@@ -57,6 +57,8 @@ + [[#include <time.h>]]) + AC_CHECK_HEADERS([execinfo.h]) + ++AC_CHECK_HEADERS([error.h]) ++ + AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate]) + + COMPOSITOR_MODULES="wayland-server >= 1.9.0 pixman-1 >= 0.25.2" +diff -Naur weston-1.9.0.orig/src/weston-error.h weston-1.9.0/src/weston-error.h +--- weston-1.9.0.orig/src/weston-error.h 1970-01-01 00:00:00.000000000 +0000 ++++ weston-1.9.0/src/weston-error.h 2016-01-01 21:20:54.097472570 +0000 +@@ -0,0 +1,24 @@ ++/* TODO ++ If S is zero error() will not exit so this macro should call warnx() in those cases ++ or just add a plain replacement function for error() to weston-launch.c */ ++ ++#ifndef WESTON_ERROR_H ++#define WESTON_ERROR_H ++ ++#if HAVE_ERROR_H ++#include <error.h> ++#else ++#include <err.h> ++#include <string.h> ++#define weston_error(s, e, f, ...) do { \ ++ if (e) \ ++ errx((s), (f), ##__VA_ARGS__, strerror(e)); \ ++ else \ ++ errx((s), (f), ##__VA_ARGS__); \ ++} while(0) ++ ++#define error weston_error ++#endif ++ ++#endif ++ +diff -Naur weston-1.9.0.orig/src/weston-launch.c weston-1.9.0/src/weston-launch.c +--- weston-1.9.0.orig/src/weston-launch.c 2015-08-10 22:28:46.000000000 +0000 ++++ weston-1.9.0/src/weston-launch.c 2016-01-01 21:20:54.098472589 +0000 +@@ -33,7 +33,6 @@ + #include <poll.h> + #include <errno.h> + +-#include <error.h> + #include <getopt.h> + + #include <sys/types.h> +@@ -59,6 +58,7 @@ + #endif + + #include "weston-launch.h" ++#include "weston-error.h" + + #define DRM_MAJOR 226 + |