Index: head/graphics/wayland/Makefile =================================================================== --- head/graphics/wayland/Makefile (revision 563193) +++ head/graphics/wayland/Makefile (revision 563194) @@ -1,33 +1,26 @@ # Created by: kwm@FreeBSD.org # $FreeBSD$ PORTNAME= wayland -PORTVERSION= 1.18.0 -PORTREVISION= 4 +PORTVERSION= 1.19.0 CATEGORIES= graphics wayland MASTER_SITES= https://wayland.freedesktop.org/releases/ - -PATCH_SITES= https://gitlab.freedesktop.org/${PORTNAME}/${PORTNAME}/-/commit/ -PATCHFILES+= 0fc00fff3015.diff:-p1 # https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/60 -PATCHFILES+= 1283d54dac97.diff:-p1 # https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/61 -PATCHFILES+= 3a3dd0820de3.diff:-p1 # https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/61 -PATCHFILES+= 230885ebb40b.diff:-p1 # https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/61 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= meson pkgconfig tar:xz USE_GNOME= libxslt:build USE_LDCONFIG= yes MESON_ARGS= -Ddocumentation=false .include Index: head/graphics/wayland/distinfo =================================================================== --- head/graphics/wayland/distinfo (revision 563193) +++ head/graphics/wayland/distinfo (revision 563194) @@ -1,11 +1,3 @@ -TIMESTAMP = 1581464763 -SHA256 (wayland-1.18.0.tar.xz) = 4675a79f091020817a98fd0484e7208c8762242266967f55a67776936c2e294d -SIZE (wayland-1.18.0.tar.xz) = 453968 -SHA256 (0fc00fff3015.diff) = dc8f664d9caa14916eb1fee231eb268eccf988cc03fdde191d18ab3b2860240d -SIZE (0fc00fff3015.diff) = 1998 -SHA256 (1283d54dac97.diff) = 3fe0d7e4811c2114683b10b9dfa99552f896dc4b8873278bcef2db3e7221a4af -SIZE (1283d54dac97.diff) = 776 -SHA256 (3a3dd0820de3.diff) = f24073844535cbaa4e217c5ad6354a506b8d0340122c9a96f0326b94394619eb -SIZE (3a3dd0820de3.diff) = 811 -SHA256 (230885ebb40b.diff) = 451a1c269f19db787fa4667106dd77b1d8b254359b7b892dfa1517fe5cfbb7da -SIZE (230885ebb40b.diff) = 2415 +TIMESTAMP = 1611766143 +SHA256 (wayland-1.19.0.tar.xz) = baccd902300d354581cd5ad3cc49daa4921d55fb416a5883e218750fef166d15 +SIZE (wayland-1.19.0.tar.xz) = 456380 Index: head/graphics/wayland/files/patch-src_meson.build =================================================================== --- head/graphics/wayland/files/patch-src_meson.build (revision 563193) +++ head/graphics/wayland/files/patch-src_meson.build (revision 563194) @@ -1,36 +1,36 @@ ---- src/meson.build.orig 2020-02-11 23:46:03 UTC +--- src/meson.build.orig 2021-01-06 19:25:15 UTC +++ src/meson.build -@@ -71,7 +71,7 @@ if get_option('libraries') +@@ -77,7 +77,7 @@ if get_option('libraries') 'connection.c', 'wayland-os.c' ], -- dependencies: [ ffi_dep, ] -+ dependencies: [ epoll_dep, ffi_dep, ] +- dependencies: [ ffi_dep, rt_dep ] ++ dependencies: [ epoll_dep, ffi_dep, rt_dep ] ) wayland_private_dep = declare_dependency( -@@ -145,6 +145,7 @@ if get_option('libraries') +@@ -151,6 +151,7 @@ if get_option('libraries') ], version: '0.1.0', dependencies: [ + epoll_dep, ffi_dep, wayland_private_dep, wayland_util_dep, -@@ -158,7 +159,7 @@ if get_option('libraries') +@@ -165,7 +166,7 @@ if get_option('libraries') wayland_server_dep = declare_dependency( link_with: wayland_server, include_directories: [ root_inc, include_directories('.') ], - dependencies: [ ffi_dep, mathlib_dep, threads_dep ], + dependencies: [ epoll_dep, ffi_dep, mathlib_dep, threads_dep ], sources: [ wayland_server_protocol_core_h, wayland_server_protocol_h -@@ -187,6 +188,7 @@ if get_option('libraries') +@@ -194,6 +195,7 @@ if get_option('libraries') ], version: '0.3.0', dependencies: [ + epoll_dep, ffi_dep, wayland_private_dep, wayland_util_dep, Index: head/graphics/wayland/files/patch-src_wayland-server.c =================================================================== --- head/graphics/wayland/files/patch-src_wayland-server.c (revision 563193) +++ head/graphics/wayland/files/patch-src_wayland-server.c (revision 563194) @@ -1,96 +1,109 @@ ---- src/wayland-server.c.orig 2020-02-11 23:46:03 UTC +--- src/wayland-server.c.orig 2020-12-21 10:17:10 UTC +++ src/wayland-server.c @@ -25,6 +25,8 @@ #define _GNU_SOURCE +#include "../config.h" + #include #include #include -@@ -44,6 +46,11 @@ +@@ -44,6 +46,15 @@ #include #include +#ifdef HAVE_SYS_UCRED_H -+#include ++#include +#include ++#ifndef SOL_LOCAL ++/* DragonFly or FreeBSD < 12.2 */ ++#define SOL_LOCAL 0 +#endif ++#endif + #include "wayland-util.h" #include "wayland-private.h" #include "wayland-server-private.h" @@ -79,7 +86,13 @@ struct wl_client { struct wl_list link; struct wl_map objects; struct wl_priv_signal destroy_signal; +#ifdef HAVE_SYS_UCRED_H + /* FreeBSD */ + struct xucred xucred; +#else + /* Linux */ struct ucred ucred; +#endif int error; struct wl_priv_signal resource_created_signal; }; -@@ -315,7 +328,13 @@ wl_resource_post_error(struct wl_resource *resource, +@@ -315,7 +328,17 @@ wl_resource_post_error(struct wl_resource *resource, static void destroy_client_with_error(struct wl_client *client, const char *reason) { +#ifdef HAVE_SYS_UCRED_H + /* FreeBSD */ ++#if defined(__FreeBSD__) && __FreeBSD_version >= 1300030 ++ wl_log("%s (pid %u)\n", reason, client->xucred.cr_pid); ++#else + wl_log("%s\n", reason); ++#endif +#else + /* Linux */ wl_log("%s (pid %u)\n", reason, client->ucred.pid); +#endif wl_client_destroy(client); } -@@ -529,10 +548,20 @@ wl_client_create(struct wl_display *display, int fd) +@@ -529,10 +552,20 @@ wl_client_create(struct wl_display *display, int fd) if (!client->source) goto err_client; +#if defined(SO_PEERCRED) + /* Linux */ len = sizeof client->ucred; if (getsockopt(fd, SOL_SOCKET, SO_PEERCRED, &client->ucred, &len) < 0) goto err_source; +#elif defined(LOCAL_PEERCRED) + /* FreeBSD */ + len = sizeof client->xucred; -+ if (getsockopt(fd, SOL_SOCKET, LOCAL_PEERCRED, ++ if (getsockopt(fd, SOL_LOCAL, LOCAL_PEERCRED, + &client->xucred, &len) < 0 || + client->xucred.cr_version != XUCRED_VERSION) + goto err_source; +#endif client->connection = wl_connection_create(fd); if (client->connection == NULL) -@@ -586,12 +615,23 @@ WL_EXPORT void +@@ -586,12 +619,28 @@ WL_EXPORT void wl_client_get_credentials(struct wl_client *client, pid_t *pid, uid_t *uid, gid_t *gid) { +#ifdef HAVE_SYS_UCRED_H -+ /* FreeBSD */ ++ /* DragonFly or FreeBSD */ if (pid) -+ *pid = 0; /* FIXME: not defined on FreeBSD */ ++#if defined(__FreeBSD__) && __FreeBSD_version >= 1300030 ++ /* Since https://cgit.freebsd.org/src/commit/?id=c5afec6e895a */ ++ *pid = client->xucred.cr_pid; ++#else ++ *pid = 0; ++#endif + if (uid) + *uid = client->xucred.cr_uid; + if (gid) + *gid = client->xucred.cr_gid; +#else + /* Linux */ + if (pid) *pid = client->ucred.pid; if (uid) *uid = client->ucred.uid; if (gid) *gid = client->ucred.gid; +#endif } /** Get the file descriptor for the client