weston: fix musl build

This commit is contained in:
Michael Gehring 2016-03-16 13:38:59 +01:00
parent 13fe74691e
commit a5944c8be9
2 changed files with 52 additions and 3 deletions

View file

@ -0,0 +1,52 @@
--- src/weston-launch.c.orig 2016-03-16 13:34:33.118723324 +0100
+++ src/weston-launch.c 2016-03-16 13:35:30.332722300 +0100
@@ -33,7 +33,6 @@
#include <poll.h>
#include <errno.h>
-#include <error.h>
#include <getopt.h>
#include <sys/types.h>
@@ -72,6 +71,41 @@
#define MAX_ARGV_SIZE 256
+#ifdef __GLIBC__
+# include <error.h>
+#else
+# include <stdio.h>
+# include <stdarg.h>
+# include <stdlib.h>
+# include <string.h>
+static void error_at_line(int status, int errnum, const char *filename,
+ unsigned int linenum, const char *format, ...)
+{
+ va_list ap;
+
+ fflush(stdout);
+
+ if (filename != NULL)
+ fprintf(stderr, "%s:%u: ", filename, linenum);
+
+ va_start(ap, format);
+ vfprintf(stderr, format, ap);
+ va_end(ap);
+
+ if (errnum != 0)
+ fprintf(stderr, ": %s", strerror(errnum));
+
+ fprintf(stderr, "\n");
+
+ if (status != 0)
+ exit(status);
+}
+
+#define error(status, errnum, format...) \
+ error_at_line(status, errnum, NULL, 0, format)
+
+#endif /* __GLIBC__ */
+
#ifdef HAVE_LIBDRM
#include <xf86drm.h>

View file

@ -30,9 +30,6 @@ build_options="backtrace dbus vaapi"
build_options_default="dbus"
case "$XBPS_TARGET_MACHINE" in
*-musl)
broken="https://travis-ci.org/ebfe/void-packages/jobs/116354779"
;;
armv[67]l*) # Assume RPi for now.
CFLAGS="-I${XBPS_CROSS_BASE}/opt/vc/include"
LDFLAGS="-Wl,-R/opt/vc/lib"