Re: update: wayland/wayland and wayland/wayland-protocols

2022-08-13 Thread Rafael Sadowski
On Sat Jul 30, 2022 at 09:03:28PM +0200, Sebastien Marie wrote:
> Hi,
> 
> The following diff updates wayland/wayland to 1.21.0 and 
> wayland/wayland-protocols to 1.26.
> 
> wayland-protocols is simple.
> 
> wayland is more complex.
> 
> - I bumped SHARED_LIBS for wayland-client and wayland-server (new symbols 
>   added). For the comment with the upstream version, I looked at meson.build 
>   file, but I am a bit unsure (wayland-client seems to have switched from 3.0 
> to 
>   0.21.0 ?!)
> 
> - Regarding the code, I sent a MR request to upstream. The current patches 
>   permits to build wayland on OpenBSD (and still on Linux), all tests are 
>   passing.
> 
>   - define _BSD_SOURCE to get SOCK_CLOEXEC and mkostemp (there is a 
> _POSIX_C_SOURCE on command-line which hide it else)
>   - in tests, use llvm-nm(1) instead of nm(1) (BSD nm has incompatible 
> options with GNU)
>   - provide a compat layer for waitid()
>   - epoll(7) has userspace wrapper around kqueue(2) is upstreamed: use it for 
> OpenBSD
>   - when using SO_PEERCRED, the struct to use onOpenBSD is `struct 
> sockpeercred`
>   - provide a compat layer for count_open_fds() (for tests)
> 
> Comments or OK ?
> -- 
> Sebastien Marie
> 
> 
> 

Merci Sebastien! OK with two tweaks:

- Fix / Change MASTER_SITES (Upstream switch to gitlab.freedesktop.org)
- Wayland protocols depends on >=1.20.0:

-BUILD_DEPENDS =wayland/wayland
-RUN_DEPENDS =  wayland/wayland
+BUILD_DEPENDS =wayland/wayland>=1.20.0
+RUN_DEPENDS =  wayland/wayland>=1.20.0

Qt5 and Qt6 wayland are happy with the update.

Rafael

Index: wayland/Makefile
===
RCS file: /cvs/ports/wayland/wayland/Makefile,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile
--- wayland/Makefile11 Mar 2022 20:04:05 -  1.3
+++ wayland/Makefile13 Aug 2022 07:16:03 -
@@ -1,23 +1,23 @@
 COMMENT =  Display server protocol
 
-DISTNAME = wayland-1.19.0
-REVISION = 0
+V =1.21.0
+DISTNAME = wayland-${V}
 
 CATEGORIES =   wayland
 
 HOMEPAGE = https://wayland.freedesktop.org/
 
-SHARED_LIBS +=  wayland-client  0.0 # 3.0
-SHARED_LIBS +=  wayland-cursor  0.0 # 0.0
+SHARED_LIBS +=  wayland-client  0.1 # 0.21.0
+SHARED_LIBS +=  wayland-cursor  0.0 # 0.21.0
 SHARED_LIBS +=  wayland-egl 0.0 # 1.0
-SHARED_LIBS +=  wayland-server  0.0 # 1.0
+SHARED_LIBS +=  wayland-server  0.1 # 0.21.0
 
 WANTLIB += c epoll-shim expat ffi xml2
 
 # MIT
 PERMIT_PACKAGE =   Yes
 
-MASTER_SITES = https://wayland.freedesktop.org/releases/
+MASTER_SITES = 
https://gitlab.freedesktop.org/wayland/wayland/-/releases/${V}/downloads/
 EXTRACT_SUFX = .tar.xz
 
 MODULES =  devel/meson
@@ -30,8 +30,8 @@ LIB_DEPENDS = devel/libffi \
textproc/libxml \
devel/epoll-shim
 
-CFLAGS+=   "-I${LOCALBASE}/include/libepoll-shim"
-
 MODMESON_CONFIGURE_ARGS += -Ddocumentation=false
+
+TEST_DEPENDS = devel/llvm,-main
 
 .include 
Index: wayland/distinfo
===
RCS file: /cvs/ports/wayland/wayland/distinfo,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 distinfo
--- wayland/distinfo6 Nov 2021 18:58:28 -   1.1.1.1
+++ wayland/distinfo13 Aug 2022 07:16:03 -
@@ -1,2 +1,2 @@
-SHA256 (wayland-1.19.0.tar.xz) = uszZAjANNUWBzVrTzEnapJIdVftBaliD4hh1D+8WbRU=
-SIZE (wayland-1.19.0.tar.xz) = 456380
+SHA256 (wayland-1.21.0.tar.xz) = bcZNf8FoN6aTpRz9suVo21OL/cn0V9RlYoW7lZTvEaw=
+SIZE (wayland-1.21.0.tar.xz) = 225936
Index: wayland/patches/patch-cursor_os-compatibility_c
===
RCS file: wayland/patches/patch-cursor_os-compatibility_c
diff -N wayland/patches/patch-cursor_os-compatibility_c
--- /dev/null   1 Jan 1970 00:00:00 -
+++ wayland/patches/patch-cursor_os-compatibility_c 13 Aug 2022 07:16:03 
-
@@ -0,0 +1,14 @@
+https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/256
+
+Index: cursor/os-compatibility.c
+--- cursor/os-compatibility.c.orig
 cursor/os-compatibility.c
+@@ -23,6 +23,8 @@
+  * SOFTWARE.
+  */
+ 
++#define _BSD_SOURCE
++#define _DEFAULT_SOURCE
+ #define _GNU_SOURCE
+ 
+ #include "config.h"
Index: wayland/patches/patch-egl_meson_build
===
RCS file: wayland/patches/patch-egl_meson_build
diff -N wayland/patches/patch-egl_meson_build
--- /dev/null   1 Jan 1970 00:00:00 -
+++ wayland/patches/patch-egl_meson_build   13 Aug 2022 07:16:03 -
@@ -0,0 +1,14 @@
+https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/256
+
+Index: egl/meson.build
+--- egl/meson.build.orig
 egl/meson.build
+@@ -11,7 +11,7 @@ wayland_egl = library(
+ 
+ executable('wayland-egl-abi-check', 

Re: update: wayland/wayland and wayland/wayland-protocols

2022-07-31 Thread Sebastien Marie
On Sun, Jul 31, 2022 at 01:35:22PM +0100, Chris Narkiewicz wrote:
> On Sat, Jul 30, 2022 at 09:03:28PM +0200, Sebastien Marie wrote:
> > Comments or OK ?
> 
> I'm curious what is the general state of wayland on OpenBSD? Is it
> usable by ordinary users? I looked in the ports but I don't see any
> window manager such as sway that I could run to play with wayland.

Wayland compositors usually depends on libinput (and libevdev or udev), which 
is 
a blocker for us actually for running wayland natively (it might be other 
problems).

The reason I am upgrading wayland is that some ports are expecting wayland 
libraries >=1.20.0 (and we have only 1.19.0).

These wayland libraries are clients libraries. The fact we don't have a 
compositor (the server part) doesn't mean we shouldn't do work.

For the server approch, one thing I am currently testing is arcan (see 
graphics/arcan) which is development framework, which is able to run over 
egl-dri (directly using /dev/dri vnodes, permitting graphical output starting 
from the console) or on SDl (via X11). arcan has basic wayland support (see 
arcan-wayland). With more work, it should be possible to run wayland clients on 
arcan.

Thanks.
-- 
Sebastien Marie



Re: update: wayland/wayland and wayland/wayland-protocols

2022-07-31 Thread Stuart Henderson
On 2022/07/31 13:35, Chris Narkiewicz wrote:
> I'm curious what is the general state of wayland on OpenBSD?

There are some small pieces in ports to satisfy dependencies of certain
ports, that's all.



update: wayland/wayland and wayland/wayland-protocols

2022-07-30 Thread Sebastien Marie
Hi,

The following diff updates wayland/wayland to 1.21.0 and 
wayland/wayland-protocols to 1.26.

wayland-protocols is simple.

wayland is more complex.

- I bumped SHARED_LIBS for wayland-client and wayland-server (new symbols 
  added). For the comment with the upstream version, I looked at meson.build 
  file, but I am a bit unsure (wayland-client seems to have switched from 3.0 
to 
  0.21.0 ?!)

- Regarding the code, I sent a MR request to upstream. The current patches 
  permits to build wayland on OpenBSD (and still on Linux), all tests are 
  passing.

  - define _BSD_SOURCE to get SOCK_CLOEXEC and mkostemp (there is a 
_POSIX_C_SOURCE on command-line which hide it else)
  - in tests, use llvm-nm(1) instead of nm(1) (BSD nm has incompatible options 
with GNU)
  - provide a compat layer for waitid()
  - epoll(7) has userspace wrapper around kqueue(2) is upstreamed: use it for 
OpenBSD
  - when using SO_PEERCRED, the struct to use onOpenBSD is `struct sockpeercred`
  - provide a compat layer for count_open_fds() (for tests)

Comments or OK ?
-- 
Sebastien Marie



diff /data/semarie/repos/openbsd/ports
commit - 0150291b1a3b6581d1519c18d130d81b43e52d16
path + /data/semarie/repos/openbsd/ports
blob - 2bf739823fadd261a14b1dae72d53626f6a73983
file + wayland/wayland/Makefile
--- wayland/wayland/Makefile
+++ wayland/wayland/Makefile
@@ -1,16 +1,15 @@
 COMMENT =  Display server protocol
 
-DISTNAME = wayland-1.19.0
-REVISION = 0
+DISTNAME = wayland-1.21.0
 
 CATEGORIES =   wayland
 
 HOMEPAGE = https://wayland.freedesktop.org/
 
-SHARED_LIBS +=  wayland-client  0.0 # 3.0
-SHARED_LIBS +=  wayland-cursor  0.0 # 0.0
+SHARED_LIBS +=  wayland-client  0.1 # 0.21.0
+SHARED_LIBS +=  wayland-cursor  0.0 # 0.21.0
 SHARED_LIBS +=  wayland-egl 0.0 # 1.0
-SHARED_LIBS +=  wayland-server  0.0 # 1.0
+SHARED_LIBS +=  wayland-server  0.1 # 0.21.0
 
 WANTLIB += c epoll-shim expat ffi xml2
 
@@ -30,8 +29,8 @@ LIB_DEPENDS = devel/libffi \
textproc/libxml \
devel/epoll-shim
 
-CFLAGS+=   "-I${LOCALBASE}/include/libepoll-shim"
-
 MODMESON_CONFIGURE_ARGS += -Ddocumentation=false
 
+TEST_DEPENDS = devel/llvm,-main
+
 .include 
blob - c6681ae77df3d933cb641234e3c341b7a979dbc6
file + wayland/wayland/distinfo
--- wayland/wayland/distinfo
+++ wayland/wayland/distinfo
@@ -1,2 +1,2 @@
-SHA256 (wayland-1.19.0.tar.xz) = uszZAjANNUWBzVrTzEnapJIdVftBaliD4hh1D+8WbRU=
-SIZE (wayland-1.19.0.tar.xz) = 456380
+SHA256 (wayland-1.21.0.tar.xz) = bcZNf8FoN6aTpRz9suVo21OL/cn0V9RlYoW7lZTvEaw=
+SIZE (wayland-1.21.0.tar.xz) = 225936
blob - /dev/null
file + wayland/wayland/patches/patch-cursor_os-compatibility_c
--- /dev/null
+++ wayland/wayland/patches/patch-cursor_os-compatibility_c
@@ -0,0 +1,14 @@
+https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/256
+
+Index: cursor/os-compatibility.c
+--- cursor/os-compatibility.c.orig
 cursor/os-compatibility.c
+@@ -23,6 +23,8 @@
+  * SOFTWARE.
+  */
+ 
++#define _BSD_SOURCE
++#define _DEFAULT_SOURCE
+ #define _GNU_SOURCE
+ 
+ #include "config.h"
blob - /dev/null
file + wayland/wayland/patches/patch-egl_meson_build
--- /dev/null
+++ wayland/wayland/patches/patch-egl_meson_build
@@ -0,0 +1,14 @@
+https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/256
+
+Index: egl/meson.build
+--- egl/meson.build.orig
 egl/meson.build
+@@ -11,7 +11,7 @@ wayland_egl = library(
+ 
+ executable('wayland-egl-abi-check', 'wayland-egl-abi-check.c')
+ 
+-nm_path = find_program('nm').full_path()
++nm_path = find_program(['llvm-nm', 'nm']).full_path()
+ 
+ test(
+   'wayland-egl symbols check',
blob - 5dec069d72a7e55f745948e7da377dd53f3ffbd9
file + wayland/wayland/patches/patch-meson_build
--- wayland/wayland/patches/patch-meson_build
+++ wayland/wayland/patches/patch-meson_build
@@ -1,34 +1,36 @@
+https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/256
+
 Index: meson.build
 --- meson.build.orig
 +++ meson.build
-@@ -26,7 +26,14 @@ add_project_arguments(
+@@ -34,7 +34,12 @@ add_project_arguments(
language: 'c'
  )
  
--foreach h: [ 'sys/prctl.h' ]
+-foreach h: [ 'sys/prctl.h', 'sys/procctl.h', 'sys/ucred.h' ]
 +have_headers = [
-+   'signal.h',
-+   'sys/epoll.h',
-+   'sys/prctl.h',
-+   'sys/ucred.h',
-+  ]
-+
++  'sys/prctl.h',
++  'sys/procctl.h',
++  'sys/ucred.h',
++]
 +foreach h: have_headers
config_h.set('HAVE_' + h.underscorify().to_upper(), cc.has_header(h))
  endforeach
  
-@@ -37,12 +44,14 @@ have_funcs = [
-   'prctl',
+@@ -46,6 +51,7 @@ have_funcs = [
'memfd_create',
+   'mremap',
'strndup',
 +  'waitid',
  ]
  foreach f: have_funcs
config_h.set('HAVE_' + f.underscorify().to_upper(), cc.has_function(f))
- endforeach
+@@ -69,7 +75,7 @@ endif
+ config_h.set10('HAVE_BROKEN_MSG_CMSG_CLOEXEC', have_broken_msg_cmsg_cloexec)
  
  if