pkgsrc-WIP-changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
wayland: add upgrade candidate
Module Name: pkgsrc-wip
Committed By: Thomas Klausner <wiz%NetBSD.org@localhost>
Pushed By: wiz
Date: Mon Jul 7 21:49:31 2025 +0200
Changeset: d033d7182c027443037d160dad440402fc7390ea
Modified Files:
Makefile
Added Files:
wayland/DESCR
wayland/Makefile
wayland/PLIST
wayland/TODO
wayland/buildlink3.mk
wayland/distinfo
wayland/patches/patch-meson.build
wayland/patches/patch-meson__options.txt
wayland/patches/patch-scanner.c
wayland/patches/patch-src_meson.build
wayland/platform.mk
Log Message:
wayland: add upgrade candidate
Doesn't compile on NetBSD
To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=d033d7182c027443037d160dad440402fc7390ea
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
diffstat:
Makefile | 1 +
wayland/DESCR | 5 ++++
wayland/Makefile | 47 ++++++++++++++++++++++++++++++++
wayland/PLIST | 36 ++++++++++++++++++++++++
wayland/TODO | 8 ++++++
wayland/buildlink3.mk | 18 ++++++++++++
wayland/distinfo | 9 ++++++
wayland/patches/patch-meson.build | 44 ++++++++++++++++++++++++++++++
wayland/patches/patch-meson__options.txt | 15 ++++++++++
wayland/patches/patch-scanner.c | 33 ++++++++++++++++++++++
wayland/patches/patch-src_meson.build | 18 ++++++++++++
wayland/platform.mk | 25 +++++++++++++++++
12 files changed, 259 insertions(+)
diffs:
diff --git a/Makefile b/Makefile
index cc36f2cb0e..e2f4aa173e 100644
--- a/Makefile
+++ b/Makefile
@@ -5932,6 +5932,7 @@ SUBDIR+= wasi-libc-git
SUBDIR+= wasi-libcxx
SUBDIR+= watch
SUBDIR+= watchman
+SUBDIR+= wayland
SUBDIR+= wcstools
SUBDIR+= weatherman
SUBDIR+= web-mode
diff --git a/wayland/DESCR b/wayland/DESCR
new file mode 100644
index 0000000000..a5a2a630a9
--- /dev/null
+++ b/wayland/DESCR
@@ -0,0 +1,5 @@
+Wayland is a protocol for a compositor to talk to its clients as
+well as a C library implementation of that protocol.
+
+Wayland is intended to be simpler replacement for the X window
+system, easier to develop and maintain.
diff --git a/wayland/Makefile b/wayland/Makefile
new file mode 100644
index 0000000000..580751259b
--- /dev/null
+++ b/wayland/Makefile
@@ -0,0 +1,47 @@
+# $NetBSD: Makefile,v 1.29 2025/04/17 21:50:33 wiz Exp $
+
+DISTNAME= wayland-1.24.0
+CATEGORIES= devel
+MASTER_SITES= https://gitlab.freedesktop.org/wayland/wayland/-/releases/${PKGVERSION_NOREV}/downloads/
+EXTRACT_SUFX= .tar.xz
+
+MAINTAINER= pkgsrc-users%NetBSD.org@localhost
+HOMEPAGE= https://wayland.freedesktop.org/
+COMMENT= Display server protocol - development libraries
+LICENSE= mit
+
+USE_TOOLS+= pkg-config
+
+USE_LANGUAGES= c c++
+
+MESON_ARGS+= -Ddocumentation=false
+MESON_ARGS+= -Dtests=false
+
+CFLAGS.NetBSD+= -D_NETBSD_SOURCE
+
+PKGCONFIG_OVERRIDE_STAGE= pre-install
+PKGCONFIG_OVERRIDE+= output/meson-private/wayland-client.pc
+PKGCONFIG_OVERRIDE+= output/meson-private/wayland-cursor.pc
+PKGCONFIG_OVERRIDE+= output/meson-private/wayland-egl-backend.pc
+PKGCONFIG_OVERRIDE+= output/meson-private/wayland-egl.pc
+PKGCONFIG_OVERRIDE+= output/meson-private/wayland-scanner.pc
+PKGCONFIG_OVERRIDE+= output/meson-private/wayland-server.pc
+
+.include "../../mk/bsd.fast.prefs.mk"
+
+.if ${USE_CROSS_COMPILE:tl} == "yes"
+# wayland runs wayland-scanner at build-time.
+TOOL_DEPENDS+= ${PKGNAME}:../../${PKGPATH}
+MESON_ARGS+= -Dcross_scanner=${TOOLBASE:Q}/bin/wayland-scanner
+.endif
+
+.include "platform.mk"
+.include "../../devel/meson/build.mk"
+.if ${OPSYS} != "Linux"
+. include "../../devel/libepoll-shim/buildlink3.mk"
+CPPFLAGS+= -I${BUILDLINK_PREFIX.libepoll-shim}/include/libepoll-shim
+.endif
+.include "../../devel/libffi/buildlink3.mk"
+.include "../../textproc/expat/buildlink3.mk"
+.include "../../textproc/libxslt/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/wayland/PLIST b/wayland/PLIST
new file mode 100644
index 0000000000..9e651a541a
--- /dev/null
+++ b/wayland/PLIST
@@ -0,0 +1,36 @@
+@comment $NetBSD: PLIST,v 1.3 2024/06/09 14:29:27 wiz Exp $
+bin/wayland-scanner
+include/wayland-client-core.h
+include/wayland-client-protocol.h
+include/wayland-client.h
+include/wayland-cursor.h
+include/wayland-egl-backend.h
+include/wayland-egl-core.h
+include/wayland-egl.h
+include/wayland-server-core.h
+include/wayland-server-protocol.h
+include/wayland-server.h
+include/wayland-util.h
+include/wayland-version.h
+lib/libwayland-client.so
+lib/libwayland-client.so.0
+lib/libwayland-client.so.0.23.0
+lib/libwayland-cursor.so
+lib/libwayland-cursor.so.0
+lib/libwayland-cursor.so.0.23.0
+lib/libwayland-egl.so
+lib/libwayland-egl.so.1
+lib/libwayland-egl.so.${PKGVERSION}
+lib/libwayland-server.so
+lib/libwayland-server.so.0
+lib/libwayland-server.so.0.23.0
+lib/pkgconfig/wayland-client.pc
+lib/pkgconfig/wayland-cursor.pc
+lib/pkgconfig/wayland-egl-backend.pc
+lib/pkgconfig/wayland-egl.pc
+lib/pkgconfig/wayland-scanner.pc
+lib/pkgconfig/wayland-server.pc
+share/aclocal/wayland-scanner.m4
+share/wayland/wayland-scanner.mk
+share/wayland/wayland.dtd
+share/wayland/wayland.xml
diff --git a/wayland/TODO b/wayland/TODO
new file mode 100644
index 0000000000..ec537380d6
--- /dev/null
+++ b/wayland/TODO
@@ -0,0 +1,8 @@
+NetBSD doesn't provide neither SO_PEERCRED nor LOCAL_PEERCRED
+but wayland 1.24.0 would like to get the socket peer credentials,
+leading to
+
+../src/wayland-os.c:129:2: error: #error "Don't know how to read ucred on this platform"
+ 129 | #error "Don't know how to read ucred on this platform"
+ | ^~~~~
+
diff --git a/wayland/buildlink3.mk b/wayland/buildlink3.mk
new file mode 100644
index 0000000000..60055b51de
--- /dev/null
+++ b/wayland/buildlink3.mk
@@ -0,0 +1,18 @@
+# $NetBSD: buildlink3.mk,v 1.5 2022/08/11 05:08:14 gutteridge Exp $
+
+BUILDLINK_TREE+= wayland
+
+.if !defined(WAYLAND_BUILDLINK3_MK)
+WAYLAND_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.wayland+= wayland>=1.21.0
+BUILDLINK_PKGSRCDIR.wayland?= ../../devel/wayland
+
+.include "../../mk/bsd.fast.prefs.mk"
+.if ${OPSYS} != "Linux"
+. include "../../devel/libepoll-shim/buildlink3.mk"
+.endif
+.include "../../devel/libffi/buildlink3.mk"
+.endif # WAYLAND_BUILDLINK3_MK
+
+BUILDLINK_TREE+= -wayland
diff --git a/wayland/distinfo b/wayland/distinfo
new file mode 100644
index 0000000000..76e4be54d5
--- /dev/null
+++ b/wayland/distinfo
@@ -0,0 +1,9 @@
+$NetBSD: distinfo,v 1.15 2025/04/07 17:33:30 prlw1 Exp $
+
+BLAKE2s (wayland-1.24.0.tar.xz) = 12e12e8cd76dffa4112943fc46d2a1a1a51b092ab0ee6e038c579ab24736339d
+SHA512 (wayland-1.24.0.tar.xz) = 60216602cffd1473ae15381f9e9a6f3829e742cac83843ca65360ba78bcff8d9442f15eb6a6d5d29c8f74dd920762ca1605f51658d22a1d3c18e338505b9f974
+Size (wayland-1.24.0.tar.xz) = 241764 bytes
+SHA1 (patch-meson.build) = de540a3d1f72d258b377a1e41325064f425e7534
+SHA1 (patch-meson__options.txt) = af930cd03994d7a2202af97b17939555c3aa7409
+SHA1 (patch-scanner.c) = 68629112c5518aeaecbf831d14bea53168c1bc95
+SHA1 (patch-src_meson.build) = 47bb46d9af0ab428667bebbed36b09f0b0b9c414
diff --git a/wayland/patches/patch-meson.build b/wayland/patches/patch-meson.build
new file mode 100644
index 0000000000..86f1ad7d7a
--- /dev/null
+++ b/wayland/patches/patch-meson.build
@@ -0,0 +1,44 @@
+$NetBSD: patch-meson.build,v 1.2 2024/06/09 14:29:27 wiz Exp $
+
+Support for NetBSD.
+
+--- meson.build.orig 2024-05-30 18:59:51.000000000 +0000
++++ meson.build
+@@ -38,6 +38,18 @@ foreach h: [ 'sys/prctl.h', 'sys/procctl
+ config_h.set('HAVE_' + h.underscorify().to_upper(), cc.has_header(h))
+ endforeach
+
++# NetBSD defines posix_fallocate(), but it always returns failure.
++# Cleanly fall back to ftruncate.
++if host_machine.system() == 'netbsd'
++have_funcs = [
++ 'accept4',
++ 'mkostemp',
++ 'prctl',
++ 'memfd_create',
++ 'mremap',
++ 'strndup',
++]
++else
+ have_funcs = [
+ 'accept4',
+ 'mkostemp',
+@@ -47,6 +59,7 @@ have_funcs = [
+ 'mremap',
+ 'strndup',
+ ]
++endif
+ foreach f: have_funcs
+ config_h.set('HAVE_' + f.underscorify().to_upper(), cc.has_function(f))
+ endforeach
+@@ -69,8 +82,8 @@ endif
+ config_h.set10('HAVE_BROKEN_MSG_CMSG_CLOEXEC', have_broken_msg_cmsg_cloexec)
+
+ if get_option('libraries')
+- if host_machine.system() in ['freebsd', 'openbsd']
+- # When building for FreeBSD, epoll(7) is provided by a userspace
++ if host_machine.system() in ['freebsd', 'netbsd', 'openbsd']
++ # When building for *BSD, epoll(7) is provided by a userspace
+ # wrapper around kqueue(2).
+ epoll_dep = dependency('epoll-shim')
+ else
diff --git a/wayland/patches/patch-meson__options.txt b/wayland/patches/patch-meson__options.txt
new file mode 100644
index 0000000000..7b4537e96f
--- /dev/null
+++ b/wayland/patches/patch-meson__options.txt
@@ -0,0 +1,15 @@
+$NetBSD: patch-meson__options.txt,v 1.1 2023/06/27 10:42:07 riastradh Exp $
+
+New cross_scanner option so we can pass the exact path to the
+build-time wayland-scanner tool through when cross-compiling.
+
+--- meson_options.txt.orig 2022-06-30 21:59:11.000000000 +0000
++++ meson_options.txt
+@@ -22,3 +22,7 @@ option('icon_directory',
+ description: 'Location used to look for cursors (defaults to ${datadir}/icons if unset)',
+ type: 'string',
+ value: '')
++option('cross_scanner',
++ description: 'Path to build-time wayland-scanner binary',
++ type: 'string',
++ value: 'wayland-scanner')
diff --git a/wayland/patches/patch-scanner.c b/wayland/patches/patch-scanner.c
new file mode 100644
index 0000000000..5e23ee274e
--- /dev/null
+++ b/wayland/patches/patch-scanner.c
@@ -0,0 +1,33 @@
+$NetBSD: patch-scanner.c,v 1.1 2025/04/07 17:33:30 prlw1 Exp $
+
+Avoid segmentation fault when building wayland-protocols
+
+--- src/scanner.c.orig 2024-05-30 18:59:51.000000000 +0000
++++ src/scanner.c
+@@ -294,7 +294,7 @@ uppercase_dup(const char *src)
+
+ u = xstrdup(src);
+ for (i = 0; u[i]; i++)
+- u[i] = toupper(u[i]);
++ u[i] = toupper((unsigned char)u[i]);
+ u[i] = '\0';
+
+ return u;
+@@ -354,7 +354,7 @@ desc_dump(char *desc, const char *fmt, .
+ for (i = 0; desc[i]; ) {
+ k = i;
+ newlines = 0;
+- while (desc[i] && isspace(desc[i])) {
++ while (desc[i] && isspace((unsigned char)desc[i])) {
+ if (desc[i] == '\n')
+ newlines++;
+ i++;
+@@ -363,7 +363,7 @@ desc_dump(char *desc, const char *fmt, .
+ break;
+
+ j = i;
+- while (desc[i] && !isspace(desc[i]))
++ while (desc[i] && !isspace((unsigned char)desc[i]))
+ i++;
+
+ if (newlines > 1)
diff --git a/wayland/patches/patch-src_meson.build b/wayland/patches/patch-src_meson.build
new file mode 100644
index 0000000000..38cfdc8867
--- /dev/null
+++ b/wayland/patches/patch-src_meson.build
@@ -0,0 +1,18 @@
+$NetBSD: patch-src_meson.build,v 1.1 2023/06/27 10:42:07 riastradh Exp $
+
+When cross-compiling, let the caller (the pkgsrc Makefile) specify the
+exact path to wayland-scanner rather than flailing around with
+pkgconfig or cmake to (not) find it.
+
+--- src/meson.build.orig 2022-06-30 21:59:11.000000000 +0000
++++ src/meson.build
+@@ -78,8 +78,7 @@ if get_option('scanner')
+ endif
+
+ if meson.is_cross_build() or not get_option('scanner')
+- scanner_dep = dependency('wayland-scanner', native: true, version: meson.project_version())
+- wayland_scanner_for_build = find_program(scanner_dep.get_variable(pkgconfig: 'wayland_scanner'))
++ wayland_scanner_for_build = find_program(get_option('cross_scanner'))
+ else
+ wayland_scanner_for_build = wayland_scanner
+ endif
diff --git a/wayland/platform.mk b/wayland/platform.mk
new file mode 100644
index 0000000000..9c46b3f997
--- /dev/null
+++ b/wayland/platform.mk
@@ -0,0 +1,25 @@
+# $NetBSD: platform.mk,v 1.8 2024/06/09 14:30:28 wiz Exp $
+
+.if !defined(PLATFORM_SUPPORTS_WAYLAND)
+.include "../../mk/bsd.fast.prefs.mk"
+
+.include "../../graphics/MesaLib/features.mk"
+
+# Please only add operating systems here after verifying that both
+# devel/wayland and devel/wayland-protocols build.
+WAYLAND_PLATFORMS+= Linux-*-*
+
+# We can have Wayland without EGL, but a lot of things expect
+# wayland and EGL support together.
+.if ${OPSYS} == "NetBSD" && !empty(MESALIB_SUPPORTS_EGL:M[Yy][Ee][Ss])
+PLATFORM_SUPPORTS_WAYLAND= yes
+.endif
+
+.for _wayland_platform in ${WAYLAND_PLATFORMS}
+. if !empty(MACHINE_PLATFORM:M${_wayland_platform})
+PLATFORM_SUPPORTS_WAYLAND= yes
+. endif
+.endfor
+PLATFORM_SUPPORTS_WAYLAND?= no
+
+.endif # !defined(PLATFORM_SUPPORTS_WAYLAND)
Home |
Main Index |
Thread Index |
Old Index