Skip to content

Commit

Permalink
graphics/wayland : first attempt at using FreeBSD port as base
Browse files Browse the repository at this point in the history
  • Loading branch information
daftaupe committed Nov 1, 2022
1 parent 73415e8 commit aa030f5
Show file tree
Hide file tree
Showing 21 changed files with 293 additions and 559 deletions.
42 changes: 42 additions & 0 deletions ports/graphics/wayland/dragonfly/patch-meson.build
@@ -0,0 +1,42 @@
--- meson.build.orig 2022-10-22 10:59:58.476779000 +0200
+++ meson.build 2022-10-31 16:12:58.994390000 +0100
@@ -16,7 +16,7 @@
config_h.set_quoted('PACKAGE_VERSION', meson.project_version())

cc_args = []
-if host_machine.system() != 'freebsd'
+if host_machine.system() != 'dragonfly'
cc_args += ['-D_POSIX_C_SOURCE=200809L']
endif
add_project_arguments(cc_args, language: 'c')
@@ -43,7 +43,6 @@
'mkostemp',
'posix_fallocate',
'prctl',
- 'memfd_create',
'mremap',
'strndup',
]
@@ -52,11 +51,11 @@
endforeach
config_h.set10('HAVE_XUCRED_CR_PID', cc.has_member('struct xucred', 'cr_pid', prefix : '#include <sys/ucred.h>'))
have_broken_msg_cmsg_cloexec = false
-if host_machine.system() == 'freebsd'
+if host_machine.system() == 'freebsd' or host_machine.system() == 'dragonfly'
have_broken_msg_cmsg_cloexec = not cc.compiles('''
#include <sys/param.h> /* To get __FreeBSD_version. */
#if __FreeBSD_version < 1300502 || \
- (__FreeBSD_version >= 1400000 && __FreeBSD_version < 1400006)
+ (__FreeBSD_version >= 1400000 && __FreeBSD_version < 1400006) || defined(__DragonFly__)
/*
* FreeBSD had a broken implementation of MSG_CMSG_CLOEXEC between 2015 and
* 2021. Check if we are compiling against a version that includes the fix
@@ -80,8 +79,6 @@
ffi_dep = dependency('libffi')

decls = [
- { 'header': 'sys/signalfd.h', 'symbol': 'SFD_CLOEXEC' },
- { 'header': 'sys/timerfd.h', 'symbol': 'TFD_CLOEXEC' },
{ 'header': 'time.h', 'symbol': 'CLOCK_MONOTONIC' },
]

@@ -1,5 +1,5 @@
--- src/connection.c.orig 2018-07-20 17:20:22.749299000 +0300
+++ src/connection.c 2018-07-20 17:27:23.761642000 +0300
--- src/connection.c.orig 2022-10-22 10:58:12.859174000 +0200
+++ src/connection.c 2022-11-01 18:50:36.315356000 +0100
@@ -38,6 +38,7 @@
#include <sys/types.h>
#include <sys/socket.h>
Expand All @@ -8,8 +8,8 @@
#include <ffi.h>

#include "wayland-util.h"
@@ -299,7 +300,10 @@
msg.msg_namelen = 0;
@@ -306,7 +307,10 @@

msg.msg_iov = iov;
msg.msg_iovlen = count;
- msg.msg_control = (clen > 0) ? cmsg : NULL;
Expand All @@ -18,9 +18,9 @@
+ else
+ msg.msg_control = cmsg;
msg.msg_controllen = clen;
msg.msg_flags = 0;

@@ -370,11 +374,25 @@
do {
@@ -376,11 +380,25 @@
wl_connection_write(struct wl_connection *connection,
const void *data, size_t count)
{
Expand Down Expand Up @@ -49,4 +49,4 @@
+ }
}

if (wl_buffer_put(&connection->out, data, count) < 0)
if (ring_buffer_put(&connection->out, data, count) < 0)

0 comments on commit aa030f5

Please sign in to comment.