1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-02-07 11:49:40 +00:00

graphics/wayland: update to 1.19.0

- Fix wl_client_get_credentials [1]

Changes:	https://gitlab.freedesktop.org/wayland/wayland/compare/1.18.0...1.19.0
PR:		246189 [1]
Submitted by:	Greg V [1]
Approved by:	manu
Differential Revision:	https://reviews.freebsd.org/D28399
This commit is contained in:
Jan Beich 2021-01-29 11:02:58 +00:00
parent 6c562c69e9
commit 4a64fcf2f9
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=563194
4 changed files with 33 additions and 35 deletions

View File

@ -2,17 +2,10 @@
# $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"

View File

@ -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

View File

@ -1,15 +1,15 @@
--- 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: [
@ -17,7 +17,7 @@
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('.') ],
@ -26,7 +26,7 @@
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: [

View File

@ -1,4 +1,4 @@
--- 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 @@
@ -9,13 +9,17 @@
#include <stdbool.h>
#include <stdlib.h>
#include <stdint.h>
@@ -44,6 +46,11 @@
@@ -44,6 +46,15 @@
#include <sys/file.h>
#include <sys/stat.h>
+#ifdef HAVE_SYS_UCRED_H
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/ucred.h>
+#ifndef SOL_LOCAL
+/* DragonFly or FreeBSD < 12.2 */
+#define SOL_LOCAL 0
+#endif
+#endif
+
#include "wayland-util.h"
@ -35,13 +39,17 @@
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);
@ -49,7 +57,7 @@
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;
@ -62,7 +70,7 @@
+#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;
@ -70,14 +78,19 @@
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)