Index: head/graphics/wayland/Makefile =================================================================== --- head/graphics/wayland/Makefile (revision 524472) +++ head/graphics/wayland/Makefile (revision 524473) @@ -1,30 +1,29 @@ # Created by: kwm@FreeBSD.org # $FreeBSD$ PORTNAME= wayland -PORTVERSION= 1.16.0 -PORTREVISION= 1 +PORTVERSION= 1.17.0 CATEGORIES= graphics wayland MASTER_SITES= https://wayland.freedesktop.org/releases/ MAINTAINER= x11@FreeBSD.org COMMENT= Wayland composite "server" LICENSE= MIT LICENSE_FILE= ${WRKSRC}/COPYING LIB_DEPENDS= libexpat.so:textproc/expat2 \ libffi.so:devel/libffi \ libepoll-shim.so:devel/libepoll-shim CFLAGS+= "-I${LOCALBASE}/include/libepoll-shim" USES= autoreconf gmake gnome libtool localbase pathfix pkgconfig tar:xz USE_GNOME= libxslt:build USE_LDCONFIG= yes GNU_CONFIGURE= yes CONFIGURE_ARGS= --disable-documentation CONFIGURE_ENV= ac_cv_func_posix_fallocate=no # EINVAL for many FS on 12.0 INSTALL_TARGET= install-strip .include Index: head/graphics/wayland/distinfo =================================================================== --- head/graphics/wayland/distinfo (revision 524472) +++ head/graphics/wayland/distinfo (revision 524473) @@ -1,3 +1,3 @@ -TIMESTAMP = 1539381179 -SHA256 (wayland-1.16.0.tar.xz) = 4e72c2b56109ccfb6610d776e465f4ca0af2280c9c2f7d5cc23f0ed2548752f5 -SIZE (wayland-1.16.0.tar.xz) = 435216 +TIMESTAMP = 1553129725 +SHA256 (wayland-1.17.0.tar.xz) = 72aa11b8ac6e22f4777302c9251e8fec7655dc22f9d94ee676c6b276f95f91a4 +SIZE (wayland-1.17.0.tar.xz) = 437680 Index: head/graphics/wayland/files/patch-tests_sanity-test.c =================================================================== --- head/graphics/wayland/files/patch-tests_sanity-test.c (revision 524472) +++ head/graphics/wayland/files/patch-tests_sanity-test.c (nonexistent) @@ -1,22 +0,0 @@ ---- tests/sanity-test.c.orig 2018-04-09 17:19:26 UTC -+++ tests/sanity-test.c -@@ -97,7 +97,8 @@ FAIL_TEST(sanity_malloc_direct) - TEST(disable_leak_checks) - { - volatile void *mem; -- assert(leak_check_enabled); -+// XXX FreeBSD disables leak checks... -+// assert(leak_check_enabled); - /* normally this should be on the beginning of the test. - * Here we need to be sure, that the leak checks are - * turned on */ -@@ -183,7 +184,8 @@ sanity_fd_no_leak(void) - { - int fd[2]; - -- assert(leak_check_enabled); -+// XXX FreeBSD leak checks are disabled -+// assert(leak_check_enabled); - - /* leak 2 file descriptors */ - if (pipe(fd) < 0) Property changes on: head/graphics/wayland/files/patch-tests_sanity-test.c ___________________________________________________________________ Deleted: fbsd:nokeywords ## -1 +0,0 ## -yes \ No newline at end of property Deleted: svn:eol-style ## -1 +0,0 ## -native \ No newline at end of property Deleted: svn:mime-type ## -1 +0,0 ## -text/plain \ No newline at end of property Index: head/graphics/wayland/files/patch-Makefile.am =================================================================== --- head/graphics/wayland/files/patch-Makefile.am (revision 524472) +++ head/graphics/wayland/files/patch-Makefile.am (revision 524473) @@ -1,29 +1,29 @@ ---- Makefile.am.orig 2018-04-10 14:53:32 UTC +--- Makefile.am.orig 2019-03-21 00:55:25 UTC +++ Makefile.am @@ -71,7 +71,7 @@ nodist_include_HEADERS = \ protocol/wayland-client-protocol.h libwayland_server_la_CFLAGS = $(FFI_CFLAGS) $(AM_CFLAGS) -pthread -libwayland_server_la_LIBADD = $(FFI_LIBS) libwayland-private.la libwayland-util.la -lrt -lm +libwayland_server_la_LIBADD = $(FFI_LIBS) $(EPOLLSHIM_LIBS) libwayland-private.la libwayland-util.la -lrt -lm libwayland_server_la_LDFLAGS = -version-info 1:0:1 libwayland_server_la_SOURCES = \ src/wayland-server.c \ @@ -83,7 +83,7 @@ nodist_libwayland_server_la_SOURCES = \ protocol/wayland-protocol.c libwayland_client_la_CFLAGS = $(FFI_CFLAGS) $(AM_CFLAGS) -pthread -libwayland_client_la_LIBADD = $(FFI_LIBS) libwayland-private.la libwayland-util.la -lrt -lm +libwayland_client_la_LIBADD = $(FFI_LIBS) $(EPOLLSHIM_LIBS) libwayland-private.la libwayland-util.la -lrt -lm libwayland_client_la_LDFLAGS = -version-info 3:0:3 libwayland_client_la_SOURCES = \ src/wayland-client.c -@@ -223,7 +223,7 @@ libtest_runner_la_LIBADD = \ - libwayland-util.la \ +@@ -227,7 +227,7 @@ libtest_runner_la_LIBADD = \ libwayland-client.la \ libwayland-server.la \ + libtest-helpers.la \ - -lrt -ldl $(FFI_LIBS) + -lrt $(DL_LIBS) $(FFI_LIBS) $(EPOLLSHIM_LIBS) - array_test_SOURCES = tests/array-test.c + array_test_LDADD = libtest-runner.la Index: head/graphics/wayland/files/patch-cursor_os-compatibility.c =================================================================== --- head/graphics/wayland/files/patch-cursor_os-compatibility.c (nonexistent) +++ head/graphics/wayland/files/patch-cursor_os-compatibility.c (revision 524473) @@ -0,0 +1,60 @@ +--- cursor/os-compatibility.c.orig 2019-03-21 00:55:25 UTC ++++ cursor/os-compatibility.c +@@ -23,6 +23,10 @@ + * SOFTWARE. + */ + ++#ifdef __FreeBSD__ ++#include ++#endif ++ + #define _GNU_SOURCE + + #include +@@ -59,6 +63,7 @@ err: + } + #endif + ++#ifndef __FreeBSD__ + static int + create_tmpfile_cloexec(char *tmpname) + { +@@ -78,6 +83,7 @@ create_tmpfile_cloexec(char *tmpname) + + return fd; + } ++#endif + + /* + * Create a new, unique, anonymous file of the given size, and +@@ -103,11 +109,14 @@ create_tmpfile_cloexec(char *tmpname) + int + os_create_anonymous_file(off_t size) + { ++ int fd; ++ int ret; ++#ifdef __FreeBSD__ ++ fd = shm_open(SHM_ANON, O_CREAT | O_RDWR | O_CLOEXEC, 0600); // shm_open is always CLOEXEC ++#else + static const char template[] = "/wayland-cursor-shared-XXXXXX"; + const char *path; + char *name; +- int fd; +- int ret; + + path = getenv("XDG_RUNTIME_DIR"); + if (!path) { +@@ -125,11 +134,12 @@ os_create_anonymous_file(off_t size) + fd = create_tmpfile_cloexec(name); + + free(name); ++#endif /* __FreeBSD__ */ + + if (fd < 0) + return -1; + +-#ifdef HAVE_POSIX_FALLOCATE ++#if defined(HAVE_POSIX_FALLOCATE) && !defined(__FreeBSD__) + ret = posix_fallocate(fd, 0, size); + if (ret != 0) { + close(fd); Property changes on: head/graphics/wayland/files/patch-cursor_os-compatibility.c ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/graphics/wayland/files/patch-tests_test-runner.c =================================================================== --- head/graphics/wayland/files/patch-tests_test-runner.c (revision 524472) +++ head/graphics/wayland/files/patch-tests_test-runner.c (revision 524473) @@ -1,190 +1,132 @@ ---- tests/test-runner.c.orig 2018-08-24 18:04:36 UTC +--- tests/test-runner.c.orig 2019-03-21 00:55:25 UTC +++ tests/test-runner.c @@ -25,6 +25,12 @@ #define _GNU_SOURCE +#include "../config.h" + +#ifdef HAVE_SYS_PARAM_H +#include +#endif + #include #include #include -@@ -37,19 +43,36 @@ +@@ -37,13 +43,23 @@ #include #include #include +#ifdef HAVE_SYS_PRCTL_H #include +#endif #ifndef PR_SET_PTRACER # define PR_SET_PTRACER 0x59616d61 #endif +#include #include "test-runner.h" - static int num_alloc; -+ -+extern const struct test __start_test_section, __stop_test_section; -+ -+/* This is all disabled for FreeBSD because it gives "can't allocate initial -+ * thread" aborts otherwise. */ -+#ifndef __FreeBSD__ - static void* (*sys_malloc)(size_t); - static void (*sys_free)(void*); - static void* (*sys_realloc)(void*, size_t); - static void* (*sys_calloc)(size_t, size_t); -+#endif - +#ifdef __FreeBSD__ +/* XXX review ptrace() usage */ +#define PTRACE_ATTACH PT_ATTACH +#define PTRACE_CONT PT_CONTINUE +#define PTRACE_DETACH PT_DETACH +#endif + - /* when set to 1, check if tests are not leaking memory and opened files. + /* when set to 1, check if tests are not leaking opened files. * It is turned on by default. It can be turned off by * WAYLAND_TEST_NO_LEAK_CHECK environment variable. */ -@@ -57,7 +80,7 @@ int leak_check_enabled; +@@ -51,7 +67,7 @@ int fd_leak_check_enabled; /* when this var is set to 0, every call to test_set_timeout() is * suppressed - handy when debugging the test. Can be set by - * WAYLAND_TEST_NO_TIMEOUTS environment variable. */ + * WAYLAND_TESTS_NO_TIMEOUTS evnironment var */ static int timeouts_enabled = 1; /* set to one if the output goes to the terminal */ -@@ -65,6 +88,7 @@ static int is_atty = 0; - - extern const struct test __start_test_section, __stop_test_section; - -+#ifndef __FreeBSD__ - __attribute__ ((visibility("default"))) void * - malloc(size_t size) - { -@@ -98,6 +122,7 @@ calloc(size_t nmemb, size_t size) - - return sys_calloc(nmemb, size); - } -+#endif - - static const struct test * - find_test(const char *name) -@@ -292,6 +317,8 @@ is_debugger_attached(void) +@@ -239,6 +255,8 @@ is_debugger_attached(void) return 0; } + +// xxx start here pid = fork(); if (pid == -1) { perror("fork"); -@@ -312,13 +339,14 @@ is_debugger_attached(void) +@@ -259,13 +277,14 @@ is_debugger_attached(void) _exit(1); if (!waitpid(-1, NULL, 0)) _exit(1); - ptrace(PTRACE_CONT, NULL, NULL); + ptrace(PTRACE_CONT, ppid, NULL, NULL); ptrace(PTRACE_DETACH, ppid, NULL, NULL); _exit(0); } else { close(pipefd[0]); /* Enable child to ptrace the parent process */ +#if defined(HAVE_PRCTL) rc = prctl(PR_SET_PTRACER, pid); if (rc != 0 && errno != EINVAL) { /* An error prevents us from telling if a debugger is attached. -@@ -328,7 +356,9 @@ is_debugger_attached(void) +@@ -275,7 +294,9 @@ is_debugger_attached(void) */ perror("prctl"); write(pipefd[1], "-", 1); - } else { + } else +#endif + { /* Signal to client that parent is ready by passing '+' */ write(pipefd[1], "+", 1); } -@@ -346,17 +376,19 @@ int main(int argc, char *argv[]) +@@ -293,7 +314,11 @@ int main(int argc, char *argv[]) const struct test *t; pid_t pid; int total, pass; +#ifdef HAVE_WAITID siginfo_t info; +#else + int status; +#endif -+#ifndef __FreeBSD__ - /* Load system malloc, free, and realloc */ - sys_calloc = dlsym(RTLD_NEXT, "calloc"); - sys_realloc = dlsym(RTLD_NEXT, "realloc"); - sys_malloc = dlsym(RTLD_NEXT, "malloc"); - sys_free = dlsym(RTLD_NEXT, "free"); - -- if (isatty(fileno(stderr))) -- is_atty = 1; -- - if (is_debugger_attached()) { - leak_check_enabled = 0; - timeouts_enabled = 0; -@@ -364,7 +396,17 @@ int main(int argc, char *argv[]) - leak_check_enabled = !getenv("WAYLAND_TEST_NO_LEAK_CHECK"); - timeouts_enabled = !getenv("WAYLAND_TEST_NO_TIMEOUTS"); - } -+#else -+ /* Disable leak checking on FreeBSD since we can't override malloc(). */ -+ leak_check_enabled = 0; -+ /* XXX review later */ -+ timeouts_enabled = 0; -+#endif - -+ if (isatty(fileno(stderr))) -+ is_atty = 1; -+ -+ - if (argc == 2 && strcmp(argv[1], "--help") == 0) - usage(argv[0], EXIT_SUCCESS); - -@@ -395,7 +437,8 @@ int main(int argc, char *argv[]) + if (isatty(fileno(stderr))) + is_atty = 1; +@@ -336,7 +361,8 @@ int main(int argc, char *argv[]) if (pid == 0) run_test(t); /* never returns */ - if (waitid(P_PID, pid, &info, WEXITED)) { +#ifdef HAVE_WAITID + if (waitid(P_PID, 0, &info, WEXITED)) { stderr_set_color(RED); fprintf(stderr, "waitid failed: %m\n"); stderr_reset_color(); -@@ -426,6 +469,25 @@ int main(int argc, char *argv[]) +@@ -367,6 +393,25 @@ int main(int argc, char *argv[]) break; } +#else + if (waitpid(-1, &status, 0) == -1) { + fprintf(stderr, "waitpid failed: %s\n", + strerror(errno)); + abort(); + } + + fprintf(stderr, "test \"%s\":\t", t->name); + if (WIFEXITED(status)) { + fprintf(stderr, "exit status %d", WEXITSTATUS(status)); + if (WEXITSTATUS(status) == EXIT_SUCCESS) + success = 1; + } else if (WIFSIGNALED(status)) { + fprintf(stderr, "signal %d", WTERMSIG(status)); + } +#endif + + if (t->must_fail) + success = !success; if (success) { pass++;