summaryrefslogtreecommitdiffstats
path: root/meta/recipes-graphics/wayland
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-graphics/wayland')
-rw-r--r--meta/recipes-graphics/wayland/files/0001-wayland-info-Fix-build-without-libdrm.patch42
-rw-r--r--meta/recipes-graphics/wayland/libinput/determinism.patch21
-rw-r--r--meta/recipes-graphics/wayland/libinput/libinput-configure.ac-add-arg-with-libunwind.patch50
-rw-r--r--meta/recipes-graphics/wayland/libinput/run-ptest9
-rw-r--r--meta/recipes-graphics/wayland/libinput/touchpad-serial-synaptics-need-to-fake-new-touches-on-TRIPLETAP.patch72
-rw-r--r--meta/recipes-graphics/wayland/libinput_0.21.0.bb24
-rw-r--r--meta/recipes-graphics/wayland/libinput_1.22.1.bb50
-rw-r--r--meta/recipes-graphics/wayland/mtdev_1.1.6.bb (renamed from meta/recipes-graphics/wayland/mtdev_1.1.5.bb)4
-rw-r--r--meta/recipes-graphics/wayland/required-distro-features.inc8
-rw-r--r--meta/recipes-graphics/wayland/wayland-protocols_1.31.bb25
-rw-r--r--meta/recipes-graphics/wayland/wayland-utils_1.1.0.bb21
-rw-r--r--meta/recipes-graphics/wayland/wayland/0001-build-Fix-strndup-detection-on-MinGW.patch41
-rw-r--r--meta/recipes-graphics/wayland/wayland/always-build-scanner.patch105
-rw-r--r--meta/recipes-graphics/wayland/wayland/disable-macro-checks-not-used-for-scanner.patch50
-rw-r--r--meta/recipes-graphics/wayland/wayland/run-ptest17
-rw-r--r--meta/recipes-graphics/wayland/wayland_1.21.0.bb61
-rw-r--r--meta/recipes-graphics/wayland/wayland_1.8.1.bb45
-rw-r--r--meta/recipes-graphics/wayland/weston-init.bb92
-rw-r--r--meta/recipes-graphics/wayland/weston-init/init10
-rw-r--r--meta/recipes-graphics/wayland/weston-init/weston-autologin11
-rwxr-xr-xmeta/recipes-graphics/wayland/weston-init/weston-start71
-rw-r--r--meta/recipes-graphics/wayland/weston-init/weston.env0
-rw-r--r--meta/recipes-graphics/wayland/weston-init/weston.ini75
-rw-r--r--meta/recipes-graphics/wayland/weston-init/weston.service71
-rw-r--r--meta/recipes-graphics/wayland/weston-init/weston.socket14
-rw-r--r--meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch80
-rw-r--r--meta/recipes-graphics/wayland/weston/explicit-enable-disable-systemd.patch70
-rw-r--r--meta/recipes-graphics/wayland/weston/libsystemd.patch53
-rw-r--r--meta/recipes-graphics/wayland/weston/make-lcms-explicitly-configurable.patch43
-rw-r--r--meta/recipes-graphics/wayland/weston/make-libwebp-explicitly-configurable.patch37
-rw-r--r--meta/recipes-graphics/wayland/weston/parallelmake.patch40
-rw-r--r--meta/recipes-graphics/wayland/weston/systemd-notify.weston-start9
-rw-r--r--meta/recipes-graphics/wayland/weston/xwayland.weston-start6
-rw-r--r--meta/recipes-graphics/wayland/weston_1.8.0.bb104
-rw-r--r--meta/recipes-graphics/wayland/weston_11.0.1.bb139
35 files changed, 779 insertions, 791 deletions
diff --git a/meta/recipes-graphics/wayland/files/0001-wayland-info-Fix-build-without-libdrm.patch b/meta/recipes-graphics/wayland/files/0001-wayland-info-Fix-build-without-libdrm.patch
new file mode 100644
index 0000000000..86c44d4480
--- /dev/null
+++ b/meta/recipes-graphics/wayland/files/0001-wayland-info-Fix-build-without-libdrm.patch
@@ -0,0 +1,42 @@
+From c79a3fb51718c4286b74edf0f758df9219994844 Mon Sep 17 00:00:00 2001
+From: Olivier Fourdan <ofourdan@redhat.com>
+Date: Wed, 14 Sep 2022 09:07:10 +0200
+Subject: [PATCH] wayland-info: Fix build without libdrm
+
+wayland-info can optionally use libdrm to provide a description of the
+dmabuf format modifiers.
+
+When not using libdrm however, the build fails because "dev_t" is not
+defined.
+
+The definition of "dev_t" comes from <sys/types.h> which is included
+from <libdrm.h>, which is not included without libdrm support, hence the
+build failure.
+
+Simply include <sys/types.h> unconditionally to make sure "dev_t" is
+defined regardless of libdrm support, to fix the build failure.
+
+Closes: https://gitlab.freedesktop.org/wayland/wayland-utils/-/issues/6
+Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
+Fixes: 240cb739 - "Add support for linux_dmabuf version 4"
+Reviewed-by: Simon Ser <contact@emersion.fr>
+Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.com>
+
+Upstream-Status: Backport [https://gitlab.freedesktop.org/wayland/wayland-utils/-/commit/baa65ba9f62e6a05c32b9202b524158a21f24245]
+Signed-off-by: Alexander Kanavin <alex@linutronix.de>
+---
+ wayland-info/wayland-info.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/wayland-info/wayland-info.c b/wayland-info/wayland-info.c
+index 53cd04b..98ff205 100644
+--- a/wayland-info/wayland-info.c
++++ b/wayland-info/wayland-info.c
+@@ -34,6 +34,7 @@
+ #include <ctype.h>
+ #include <unistd.h>
+ #include <sys/mman.h>
++#include <sys/types.h>
+
+ #include <wayland-client.h>
+ #if HAVE_HUMAN_FORMAT_MODIFIER
diff --git a/meta/recipes-graphics/wayland/libinput/determinism.patch b/meta/recipes-graphics/wayland/libinput/determinism.patch
new file mode 100644
index 0000000000..cb554030cf
--- /dev/null
+++ b/meta/recipes-graphics/wayland/libinput/determinism.patch
@@ -0,0 +1,21 @@
+This finds our outer git tree and that version information breaks
+determinism of this recipe. Disable it.
+
+RP 2020/2/6
+
+Upstream-Status: Pending
+Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
+
+Index: libinput-1.14.3/meson.build
+===================================================================
+--- libinput-1.14.3.orig/meson.build
++++ libinput-1.14.3/meson.build
+@@ -387,7 +387,7 @@ pkgconfig.generate(
+ libraries : lib_libinput
+ )
+
+-git_version_h = vcs_tag(command : ['git', 'describe'],
++git_version_h = vcs_tag(command : ['false'],
+ fallback : 'unknown',
+ input : 'src/libinput-git-version.h.in',
+ output :'libinput-git-version.h')
diff --git a/meta/recipes-graphics/wayland/libinput/libinput-configure.ac-add-arg-with-libunwind.patch b/meta/recipes-graphics/wayland/libinput/libinput-configure.ac-add-arg-with-libunwind.patch
deleted file mode 100644
index df5ebcca05..0000000000
--- a/meta/recipes-graphics/wayland/libinput/libinput-configure.ac-add-arg-with-libunwind.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From cc6fce587f2628c8b342764e06fb0fc27c1e8274 Mon Sep 17 00:00:00 2001
-From: Jackie Huang <jackie.huang@windriver.com>
-Date: Mon, 3 Aug 2015 20:33:44 -0700
-Subject: [PATCH] configure.ac: add arg --with-libunwind
-
-Add arg --with-libunwind for configure so it's optional to check
-libunwind, which is helpfull to make deterministic builds.
-
-Upstream-Status: Submitted [wayland-devel]
-
-Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
----
- configure.ac | 19 ++++++++++++++-----
- 1 file changed, 14 insertions(+), 5 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
-index 314b0d4..242d251 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -60,13 +60,22 @@ PKG_PROG_PKG_CONFIG()
- PKG_CHECK_MODULES(MTDEV, [mtdev >= 1.1.0])
- PKG_CHECK_MODULES(LIBUDEV, [libudev])
- PKG_CHECK_MODULES(LIBEVDEV, [libevdev >= 0.4])
--PKG_CHECK_MODULES(LIBUNWIND,
-+
-+AC_ARG_WITH(libunwind,
-+ AS_HELP_STRING([--without-libunwind],[Do not use libunwind]))
-+
-+AS_IF([test "x$with_libunwind" != "xno"],
-+ [PKG_CHECK_MODULES(LIBUNWIND,
- [libunwind],
- [HAVE_LIBUNWIND=yes],
-- [HAVE_LIBUNWIND=no])
--if test "x$HAVE_LIBUNWIND" = "xyes"; then
-- AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])
--fi
-+ [HAVE_LIBUNWIND=no])],
-+ [HAVE_LIBUNWIND=no])
-+
-+AS_IF([test "x$HAVE_LIBUNWIND" = "xyes"],
-+ [AC_DEFINE(HAVE_LIBUNWIND, 1, [Have libunwind support])],
-+ [AS_IF([test "x$with_libunwind" = "xyes"],
-+ [AC_MSG_ERROR([libunwind requested but not found])])])
-+
- AM_CONDITIONAL(HAVE_LIBUNWIND, [test "x$HAVE_LIBUNWIND" = xyes])
- AC_PATH_PROG(ADDR2LINE, [addr2line])
- if test "x$ADDR2LINE" != "x"; then
---
-2.3.5
-
diff --git a/meta/recipes-graphics/wayland/libinput/run-ptest b/meta/recipes-graphics/wayland/libinput/run-ptest
new file mode 100644
index 0000000000..d11e6eb25b
--- /dev/null
+++ b/meta/recipes-graphics/wayland/libinput/run-ptest
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+/usr/libexec/libinput/libinput-test-suite -j1
+if [ $? -eq 0 ]; then
+ echo 'PASS: libinput-test-suite'
+else
+ echo 'FAIL: libinput-test-suite'
+fi
+
diff --git a/meta/recipes-graphics/wayland/libinput/touchpad-serial-synaptics-need-to-fake-new-touches-on-TRIPLETAP.patch b/meta/recipes-graphics/wayland/libinput/touchpad-serial-synaptics-need-to-fake-new-touches-on-TRIPLETAP.patch
deleted file mode 100644
index 97c63bd377..0000000000
--- a/meta/recipes-graphics/wayland/libinput/touchpad-serial-synaptics-need-to-fake-new-touches-on-TRIPLETAP.patch
+++ /dev/null
@@ -1,72 +0,0 @@
-This is a workaround upstream suggests for use with kernel 4.1.
-
-Upstream-Status: Inappropriate [temporary work-around]
-Signed-Off-By: Jussi Kukkonen <jussi.kukkonen@intel.com>
-
-
-
-From: Peter Hutterer <peter.hutterer@who-t.net>
-Date: Mon Aug 3 18:23:12 PDT 2015
-Subject: [PATCH v3 libinput] touchpad: serial synaptics need to fake new touches on TRIPLETAP
-
-On the 4.1 kernels synaptics pretends to have 3 slots (the serial fw only does
-2). This was added to avoid cursor jumps but has since been reverted for 4.2
-(kernel commit dbf3c37086, 4.1.3 is still buggy). In some cases a TRIPLETAP
-may be triggered without slot 2 ever activating.
-
-While there are still those kernels out there, work around this bug by opening
-a new touch point where none exists if the fake finger count exceeds the slot
-count.
-
-Reported-by: Jan Alexander Steffens <jan.steffens at gmail.com>
-Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
-Tested-by: Jan Alexander Steffens <jan.steffens at gmail.com>
-Reviewed-by: Hans de Goede <hdegoede at redhat.com>
----
-Changes to v2:
-- split out the handling instead of having a tmp state variable, see Hans'
- comments from v2
-
-Mainly sending this to the list again so I have a link to point people to.
-If you're on 4.1.x add this patch to your distribution package.
-
- src/evdev-mt-touchpad.c | 22 ++++++++++++++++------
- 1 file changed, 16 insertions(+), 6 deletions(-)
-
-diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
-index a683d9a..5ef03d5 100644
---- a/src/evdev-mt-touchpad.c
-+++ b/src/evdev-mt-touchpad.c
-@@ -369,13 +369,23 @@ tp_restore_synaptics_touches(struct tp_dispatch *tp,
- for (i = 0; i < tp->num_slots; i++) {
- struct tp_touch *t = tp_get_touch(tp, i);
-
-- if (t->state != TOUCH_END)
-+ switch(t->state) {
-+ case TOUCH_HOVERING:
-+ case TOUCH_BEGIN:
-+ case TOUCH_UPDATE:
- continue;
--
-- /* new touch, move it through begin to update immediately */
-- tp_new_touch(tp, t, time);
-- tp_begin_touch(tp, t, time);
-- t->state = TOUCH_UPDATE;
-+ case TOUCH_NONE:
-+ /* new touch, move it through to begin immediately */
-+ tp_new_touch(tp, t, time);
-+ tp_begin_touch(tp, t, time);
-+ break;
-+ case TOUCH_END:
-+ /* touch just ended ,we need need to restore it to update */
-+ tp_new_touch(tp, t, time);
-+ tp_begin_touch(tp, t, time);
-+ t->state = TOUCH_UPDATE;
-+ break;
-+ }
- }
- }
-
---
-2.4.3
-
diff --git a/meta/recipes-graphics/wayland/libinput_0.21.0.bb b/meta/recipes-graphics/wayland/libinput_0.21.0.bb
deleted file mode 100644
index ac5a249825..0000000000
--- a/meta/recipes-graphics/wayland/libinput_0.21.0.bb
+++ /dev/null
@@ -1,24 +0,0 @@
-SUMMARY = "Library to handle input devices in Wayland compositors"
-HOMEPAGE = "http://www.freedesktop.org/wiki/Software/libinput/"
-SECTION = "libs"
-
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://COPYING;md5=2184aef38ff137ed33ce9a63b9d1eb8f"
-
-DEPENDS = "libevdev udev mtdev"
-
-SRC_URI = "http://www.freedesktop.org/software/${BPN}/${BP}.tar.xz \
- file://libinput-configure.ac-add-arg-with-libunwind.patch \
- file://touchpad-serial-synaptics-need-to-fake-new-touches-on-TRIPLETAP.patch \
-"
-SRC_URI[md5sum] = "f91d8f4ced986f1ae16d52ea02bc7837"
-SRC_URI[sha256sum] = "7cce7a9e510dfe5c4a19ad00e9350808d4f59f8611fd2b5e87213c507283f550"
-
-inherit autotools pkgconfig
-
-PACKAGECONFIG ??= ""
-PACKAGECONFIG[libunwind] = "--with-libunwind,--without-libunwind,libunwind"
-PACKAGECONFIG[gui] = "--enable-event-gui,--disable-event-gui,cairo gtk+3"
-
-FILES_${PN} += "${libdir}/udev/"
-FILES_${PN}-dbg += "${libdir}/udev/.debug"
diff --git a/meta/recipes-graphics/wayland/libinput_1.22.1.bb b/meta/recipes-graphics/wayland/libinput_1.22.1.bb
new file mode 100644
index 0000000000..f86885d3e3
--- /dev/null
+++ b/meta/recipes-graphics/wayland/libinput_1.22.1.bb
@@ -0,0 +1,50 @@
+SUMMARY = "Library to handle input devices in Wayland compositors"
+DESCRIPTION = "libinput is a library to handle input devices in Wayland \
+compositors and to provide a generic X.Org input driver. It provides \
+device detection, device handling, input device event processing and \
+abstraction so minimize the amount of custom input code compositors need to \
+provide the common set of functionality that users expect."
+HOMEPAGE = "http://www.freedesktop.org/wiki/Software/libinput/"
+SECTION = "libs"
+
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=bab4ac7dc1c10bc0fb037dc76c46ef8a"
+
+DEPENDS = "libevdev udev mtdev libcheck"
+
+SRC_URI = "git://gitlab.freedesktop.org/libinput/libinput.git;protocol=https;branch=1.22-branch \
+ file://run-ptest \
+ file://determinism.patch \
+ "
+SRCREV = "d9f45fd1261da85b4eb44f8aa82e1500b99f303b"
+S = "${WORKDIR}/git"
+
+UPSTREAM_CHECK_REGEX = "libinput-(?P<pver>\d+\.\d+\.(?!9\d+)\d+)"
+
+inherit meson pkgconfig lib_package ptest
+
+# Patch out build directory, otherwise it leaks into ptest binary
+do_configure:append() {
+ sed -i -e "s,${WORKDIR},,g" config.h
+ if [ -e "litest-config.h" ]; then
+ sed -i -e "s,${WORKDIR},,g" litest-config.h
+ fi
+}
+
+PACKAGECONFIG ??= ""
+PACKAGECONFIG[libwacom] = "-Dlibwacom=true,-Dlibwacom=false,libwacom"
+PACKAGECONFIG[gui] = "-Ddebug-gui=true,-Ddebug-gui=false,cairo gtk+3"
+
+UDEVDIR = "`pkg-config --variable=udevdir udev`"
+
+EXTRA_OEMESON += "-Dudev-dir=${UDEVDIR} \
+ -Ddocumentation=false \
+ ${@bb.utils.contains('PTEST_ENABLED', '1', '-Dtests=true -Dinstall-tests=true', '-Dtests=false -Dinstall-tests=false', d)} \
+ -Dzshcompletiondir=no"
+
+# package name changed in 1.8.1 upgrade: make sure package upgrades work
+RPROVIDES:${PN} = "libinput"
+RREPLACES:${PN} = "libinput"
+RCONFLICTS:${PN} = "libinput"
+
+FILES:${PN}-ptest += "${libexecdir}/libinput/libinput-test-suite"
diff --git a/meta/recipes-graphics/wayland/mtdev_1.1.5.bb b/meta/recipes-graphics/wayland/mtdev_1.1.6.bb
index ccd0ebbfce..7c1cb5e4ec 100644
--- a/meta/recipes-graphics/wayland/mtdev_1.1.5.bb
+++ b/meta/recipes-graphics/wayland/mtdev_1.1.6.bb
@@ -12,7 +12,7 @@ LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://COPYING;md5=ea6bd0268bb0fcd6b27698616ceee5d6"
SRC_URI = "http://bitmath.org/code/${BPN}/${BP}.tar.bz2"
-SRC_URI[md5sum] = "52c9610b6002f71d1642dc1a1cca5ec1"
-SRC_URI[sha256sum] = "6677d5708a7948840de734d8b4675d5980d4561171c5a8e89e54adf7a13eba7f"
+SRC_URI[md5sum] = "bf8ef2482e84a00b5db8fbd3ce00e249"
+SRC_URI[sha256sum] = "15d7b28da8ac71d8bc8c9287c2045fd174267bc740bec10cfda332dc1204e0e0"
inherit autotools pkgconfig
diff --git a/meta/recipes-graphics/wayland/required-distro-features.inc b/meta/recipes-graphics/wayland/required-distro-features.inc
new file mode 100644
index 0000000000..bb4a0e8ebd
--- /dev/null
+++ b/meta/recipes-graphics/wayland/required-distro-features.inc
@@ -0,0 +1,8 @@
+# distro features required by weston recipes
+
+inherit features_check
+
+# requires pam enabled if started via systemd
+#
+REQUIRED_DISTRO_FEATURES = "wayland opengl ${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', 'pam', '', d)}"
+
diff --git a/meta/recipes-graphics/wayland/wayland-protocols_1.31.bb b/meta/recipes-graphics/wayland/wayland-protocols_1.31.bb
new file mode 100644
index 0000000000..afde995fd4
--- /dev/null
+++ b/meta/recipes-graphics/wayland/wayland-protocols_1.31.bb
@@ -0,0 +1,25 @@
+SUMMARY = "Collection of additional Wayland protocols"
+DESCRIPTION = "Wayland protocols that add functionality not \
+available in the Wayland core protocol. Such protocols either add \
+completely new functionality, or extend the functionality of some other \
+protocol either in Wayland core, or some other protocol in \
+wayland-protocols."
+HOMEPAGE = "http://wayland.freedesktop.org"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=c7b12b6702da38ca028ace54aae3d484 \
+ file://stable/presentation-time/presentation-time.xml;endline=26;md5=4646cd7d9edc9fa55db941f2d3a7dc53"
+
+SRC_URI = "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/${PV}/downloads/wayland-protocols-${PV}.tar.xz"
+SRC_URI[sha256sum] = "a07fa722ed87676ec020d867714bc9a2f24c464da73912f39706eeef5219e238"
+
+UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html"
+
+inherit meson pkgconfig allarch
+
+EXTRA_OEMESON += "-Dtests=false"
+
+PACKAGES = "${PN}"
+FILES:${PN} += "${datadir}/pkgconfig/wayland-protocols.pc"
+
+BBCLASSEXTEND = "native nativesdk"
+
diff --git a/meta/recipes-graphics/wayland/wayland-utils_1.1.0.bb b/meta/recipes-graphics/wayland/wayland-utils_1.1.0.bb
new file mode 100644
index 0000000000..dcee87e2cd
--- /dev/null
+++ b/meta/recipes-graphics/wayland/wayland-utils_1.1.0.bb
@@ -0,0 +1,21 @@
+SUMMARY = "Wayland utilities"
+DESCRIPTION = "Wayland-utils contains (for now) \
+wayland-info, a utility for displaying information about the Wayland \
+protocols supported by a Wayland compositor. \
+wayland-info is basically a standalone version of weston-info as found \
+in weston repository. "
+HOMEPAGE = "http://wayland.freedesktop.org"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=548a66038a77415e1df51118625e832f \
+ "
+
+SRC_URI = "https://gitlab.freedesktop.org/wayland/wayland-utils/-/releases/${PV}/downloads/${BPN}-${PV}.tar.xz \
+ file://0001-wayland-info-Fix-build-without-libdrm.patch \
+ "
+SRC_URI[sha256sum] = "9e685863025b4feade36d53bbc8e31b43e26498be743dea84c7a84912959410a"
+
+UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html"
+
+inherit meson pkgconfig
+
+DEPENDS += "wayland wayland-native wayland-protocols"
diff --git a/meta/recipes-graphics/wayland/wayland/0001-build-Fix-strndup-detection-on-MinGW.patch b/meta/recipes-graphics/wayland/wayland/0001-build-Fix-strndup-detection-on-MinGW.patch
new file mode 100644
index 0000000000..bc753de113
--- /dev/null
+++ b/meta/recipes-graphics/wayland/wayland/0001-build-Fix-strndup-detection-on-MinGW.patch
@@ -0,0 +1,41 @@
+From b4c64b6f07743e3fb63ce52359bc664ab7d60df0 Mon Sep 17 00:00:00 2001
+From: Joshua Watt <JPEWhacker@gmail.com>
+Date: Thu, 20 Feb 2020 15:20:45 -0600
+Subject: [PATCH] build: Fix strndup detection on MinGW
+
+GCC and meson conspire together to incorrectly detect that strndup()
+exists on MinGW as __builtin_strndup, when no such function exists. As a
+work around, meson will skip looking for __builtin functions if an
+'#include' is in the prefix, so add '#include <string.h>' when looking
+for strndup().
+
+See: https://github.com/mesonbuild/meson/issues/3672
+
+Upstream-Status: Submitted [https://gitlab.freedesktop.org/wayland/wayland/merge_requests/63]
+
+Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
+Signed-off-by: Denys Dmytriyenko <denis@denix.org>
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 3bc25c9..adde7b9 100644
+--- a/meson.build
++++ b/meson.build
+@@ -38,11 +38,11 @@ have_funcs = [
+ 'prctl',
+ 'memfd_create',
+ 'mremap',
+- 'strndup',
+ ]
+ foreach f: have_funcs
+ config_h.set('HAVE_' + f.underscorify().to_upper(), cc.has_function(f))
+ endforeach
++config_h.set('HAVE_STRNDUP', cc.has_function('strndup') and cc.has_header_symbol('string.h', 'strndup'))
+ 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'
+--
+2.7.4
+
diff --git a/meta/recipes-graphics/wayland/wayland/always-build-scanner.patch b/meta/recipes-graphics/wayland/wayland/always-build-scanner.patch
deleted file mode 100644
index 5e0e6bf12a..0000000000
--- a/meta/recipes-graphics/wayland/wayland/always-build-scanner.patch
+++ /dev/null
@@ -1,105 +0,0 @@
-build: always build wayland-scanner
-
-The previous idiom for building a cross-compiled Wayland is to build once for
-the build host (with --enable-scanner --disable-libraries) to get a
-wayland-scanner binary that can then be used in a cross-compile (with
---disable-scanner). The problem with this is that the cross wayland is missing
-a wayland-scanner binary, which means you then can't do any Wayland development
-on the target.
-
-Instead, always build wayland-scanner for the target and change
---enable/disable-scanner to --with/without-host-scanner. Normal builds use the
-default of --without-host-scanner and run the wayland-scanner it just built, and
-cross-compiled builds pass --with-host-scanner to use a previously built host
-scanner but still get a wayland-scanner to install.
-
-(a theoretically neater solution would be to build two scanners if required (one
-to run and one to install), but automake makes this overly complicated)
-
-Signed-off-by: Ross Burton <ross.burton@intel.com>
-Upstream-Status: Submitted
-
-diff --git a/Makefile.am b/Makefile.am
-index c19494f..c2d929b 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -64,16 +64,17 @@ nodist_libwayland_client_la_SOURCES = \
-
- pkgconfig_DATA += src/wayland-client.pc src/wayland-server.pc
-
--if ENABLE_SCANNER
--wayland_scanner = $(top_builddir)/wayland-scanner
- bin_PROGRAMS = wayland-scanner
- wayland_scanner_SOURCES = src/scanner.c
- wayland_scanner_CFLAGS = $(EXPAT_CFLAGS) $(AM_CFLAGS)
- wayland_scanner_LDADD = $(EXPAT_LIBS) libwayland-util.la
--$(BUILT_SOURCES) : wayland-scanner
- pkgconfig_DATA += src/wayland-scanner.pc
--else
-+
-+if HOST_SCANNER
- wayland_scanner = wayland-scanner
-+else
-+$(BUILT_SOURCES) : wayland-scanner
-+wayland_scanner = $(top_builddir)/wayland-scanner
- endif
-
- protocol/%-protocol.c : $(top_srcdir)/protocol/%.xml
-diff --git a/configure.ac b/configure.ac
-index c2a804e..de0b02f 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -65,11 +65,11 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[],
- [[#include <time.h>]])
- AC_CHECK_HEADERS([execinfo.h])
-
--AC_ARG_ENABLE([scanner],
-- [AC_HELP_STRING([--disable-scanner],
-- [Disable compilation of wayland-scanner])],
-- [],
-- [enable_scanner=yes])
-+AC_ARG_WITH([host-scanner],
-+ [AC_HELP_STRING([--with-host-scanner],
-+ [Use a host wayland-scanner])],
-+ [],
-+ [with_host_scanner=no])
-
- AC_ARG_ENABLE([documentation],
- [AC_HELP_STRING([--disable-documentation],
-@@ -77,25 +77,23 @@ AC_ARG_ENABLE([documentation],
- [],
- [enable_documentation=yes])
-
--AM_CONDITIONAL(ENABLE_SCANNER, test "x$enable_scanner" = xyes)
-+AM_CONDITIONAL(HOST_SCANNER, test "x$with_host_scanner" = xyes)
-
- AC_ARG_WITH(icondir, [ --with-icondir=<dir> Look for cursor icons here],
- [ ICONDIR=$withval],
- [ ICONDIR=${datadir}/icons])
- AC_SUBST([ICONDIR])
-
--if test "x$enable_scanner" = "xyes"; then
-- PKG_CHECK_MODULES(EXPAT, [expat], [],
-- [AC_CHECK_HEADERS(expat.h, [],
-- [AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
-- SAVE_LIBS="$LIBS"
-- AC_SEARCH_LIBS(XML_ParserCreate, expat, [],
-- [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
-- EXPAT_LIBS="$LIBS"
-- LIBS="$SAVE_LIBS"
-- AC_SUBST(EXPAT_LIBS)
-- ])
--fi
-+PKG_CHECK_MODULES(EXPAT, [expat], [],
-+ [AC_CHECK_HEADERS(expat.h, [],
-+ [AC_MSG_ERROR([Can't find expat.h. Please install expat.])])
-+ SAVE_LIBS="$LIBS"
-+ AC_SEARCH_LIBS(XML_ParserCreate, expat, [],
-+ [AC_MSG_ERROR([Can't find expat library. Please install expat.])])
-+ EXPAT_LIBS="$LIBS"
-+ LIBS="$SAVE_LIBS"
-+ AC_SUBST(EXPAT_LIBS)
-+ ])
-
- AC_PATH_PROG(XSLTPROC, xsltproc)
- AM_CONDITIONAL([HAVE_XSLTPROC], [test "x$XSLTPROC" != "x"])
diff --git a/meta/recipes-graphics/wayland/wayland/disable-macro-checks-not-used-for-scanner.patch b/meta/recipes-graphics/wayland/wayland/disable-macro-checks-not-used-for-scanner.patch
deleted file mode 100644
index cd8bc55842..0000000000
--- a/meta/recipes-graphics/wayland/wayland/disable-macro-checks-not-used-for-scanner.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-disable macro checks not used for scanner
-
-We only build wayland-native for the scanner, so disable the bits we don't
-actually need. This avoid build issue on older distro such as Centos 5.x:
-| error: 'O_CLOEXEC' undeclared (first use in this function)
-| error: sys/timerfd.h: No such file or directory
-| error: 'CLOCK_MONOTONIC' undeclared (first use in this function)
-| error: 'TFD_CLOEXEC' undeclared (first use in this function)
-| error: 'SFD_CLOEXEC' undeclared (first use in this function)
-
-Upstream-Status: Pending
-
-Signed-off-by: Ting Liu <b28495@freescale.com>
----
- configure.ac | 20 ++++++++++----------
- 1 file changed, 10 insertions(+), 10 deletions(-)
-
-diff --git a/configure.ac b/configure.ac
---- a/configure.ac
-+++ b/configure.ac
-@@ -41,16 +41,16 @@ AC_SUBST(GCC_CFLAGS)
-
- AC_CHECK_FUNCS([accept4 mkostemp posix_fallocate])
-
--AC_CHECK_DECL(SFD_CLOEXEC,[],
-- [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile wayland")],
-- [[#include <sys/signalfd.h>]])
--AC_CHECK_DECL(TFD_CLOEXEC,[],
-- [AC_MSG_ERROR("TFD_CLOEXEC is needed to compile wayland")],
-- [[#include <sys/timerfd.h>]])
--AC_CHECK_DECL(CLOCK_MONOTONIC,[],
-- [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile wayland")],
-- [[#include <time.h>]])
--AC_CHECK_HEADERS([execinfo.h])
-+##AC_CHECK_DECL(SFD_CLOEXEC,[],
-+# [AC_MSG_ERROR("SFD_CLOEXEC is needed to compile wayland")],
-+# [[#include <sys/signalfd.h>]])
-+#AC_CHECK_DECL(TFD_CLOEXEC,[],
-+# [AC_MSG_ERROR("TFD_CLOEXEC is needed to compile wayland")],
-+# [[#include <sys/timerfd.h>]])
-+#AC_CHECK_DECL(CLOCK_MONOTONIC,[],
-+# [AC_MSG_ERROR("CLOCK_MONOTONIC is needed to compile wayland")],
-+# [[#include <time.h>]])
-+#AC_CHECK_HEADERS([execinfo.h])
-
- AC_ARG_ENABLE([scanner],
- [AC_HELP_STRING([--disable-scanner],
---
-1.8.3.2
-
diff --git a/meta/recipes-graphics/wayland/wayland/run-ptest b/meta/recipes-graphics/wayland/wayland/run-ptest
new file mode 100644
index 0000000000..7e8d9de046
--- /dev/null
+++ b/meta/recipes-graphics/wayland/wayland/run-ptest
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+export WAYLAND_SCANNER=wayland-scanner
+export TEST_DATA_DIR=tests/data
+export TEST_OUTPUT_DIR=tests/output
+export SED=sed
+export WAYLAND_EGL_LIB=/usr/lib/libwayland-egl.so.1
+export NM=nm
+
+for i in `ls tests/*-test tests/wayland-egl-symbols-check tests/scanner-test.sh`; do
+ $i
+ if [ $? -eq 0 ]; then
+ echo "PASS: $i"
+ else
+ echo "FAIL: $i"
+ fi
+done
diff --git a/meta/recipes-graphics/wayland/wayland_1.21.0.bb b/meta/recipes-graphics/wayland/wayland_1.21.0.bb
new file mode 100644
index 0000000000..ce59e601d2
--- /dev/null
+++ b/meta/recipes-graphics/wayland/wayland_1.21.0.bb
@@ -0,0 +1,61 @@
+SUMMARY = "Wayland, a protocol between a compositor and clients"
+DESCRIPTION = "Wayland is a protocol for a compositor to talk to its clients \
+as well as a C library implementation of that protocol. The compositor can be \
+a standalone display server running on Linux kernel modesetting and evdev \
+input devices, an X application, or a wayland client itself. The clients can \
+be traditional applications, X servers (rootless or fullscreen) or other \
+display servers."
+HOMEPAGE = "http://wayland.freedesktop.org"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=b31d8f53b6aaf2b4985d7dd7810a70d1 \
+ file://src/wayland-server.c;endline=24;md5=b8e046164a766bb1ede8ba38e9dcd7ce"
+
+DEPENDS = "expat libffi wayland-native"
+
+SRC_URI = "https://gitlab.freedesktop.org/wayland/wayland/-/releases/${PV}/downloads/${BPN}-${PV}.tar.xz \
+ file://run-ptest \
+ file://0001-build-Fix-strndup-detection-on-MinGW.patch \
+ "
+SRC_URI[sha256sum] = "6dc64d7fc16837a693a51cfdb2e568db538bfdc9f457d4656285bb9594ef11ac"
+
+UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html"
+UPSTREAM_CHECK_REGEX = "wayland-(?P<pver>\d+\.\d+\.(?!9\d+)\d+)"
+
+inherit meson pkgconfig ptest
+
+PACKAGECONFIG ??= "dtd-validation"
+PACKAGECONFIG[dtd-validation] = "-Ddtd_validation=true,-Ddtd_validation=false,libxml2,,"
+
+EXTRA_OEMESON = "-Ddocumentation=false"
+EXTRA_OEMESON:class-native = "-Ddocumentation=false"
+
+# Wayland installs a M4 macro for other projects to use, which uses the target
+# pkg-config to find files. Replace pkg-config with pkg-config-native.
+do_install:append:class-native() {
+ sed -e 's,PKG_CHECK_MODULES(.*),,g' \
+ -e 's,$PKG_CONFIG,pkg-config-native,g' \
+ -i ${D}/${datadir}/aclocal/wayland-scanner.m4
+}
+
+do_install_ptest() {
+ mkdir -p ${D}${PTEST_PATH}/tests/data
+ cp -rf ${B}/tests/*-test ${B}/tests/*-checker ${D}${PTEST_PATH}/tests
+ cp -rf ${B}/tests/*-checker ${D}${PTEST_PATH}
+ cp -rf ${S}/tests/scanner-test.sh ${D}${PTEST_PATH}/tests
+ cp -rf ${S}/tests/data/* ${D}${PTEST_PATH}/tests/data/
+ cp -rf ${S}/egl/wayland-egl-symbols-check ${D}${PTEST_PATH}/tests/
+}
+
+sysroot_stage_all:append:class-target () {
+ rm ${SYSROOT_DESTDIR}/${datadir}/aclocal/wayland-scanner.m4
+ cp ${STAGING_DATADIR_NATIVE}/aclocal/wayland-scanner.m4 ${SYSROOT_DESTDIR}/${datadir}/aclocal/
+}
+
+PACKAGES =+ "${PN}-tools"
+
+FILES:${PN}-tools = "${bindir}/wayland-scanner"
+FILES:${PN}-dev += "${datadir}/${BPN}/wayland-scanner.mk"
+
+BBCLASSEXTEND = "native nativesdk"
+
+RDEPENDS:${PN}-ptest += "binutils sed ${PN}-tools"
diff --git a/meta/recipes-graphics/wayland/wayland_1.8.1.bb b/meta/recipes-graphics/wayland/wayland_1.8.1.bb
deleted file mode 100644
index 0f9a0aa02e..0000000000
--- a/meta/recipes-graphics/wayland/wayland_1.8.1.bb
+++ /dev/null
@@ -1,45 +0,0 @@
-SUMMARY = "Wayland, a protocol between a compositor and clients"
-DESCRIPTION = "Wayland is a protocol for a compositor to talk to its clients \
-as well as a C library implementation of that protocol. The compositor can be \
-a standalone display server running on Linux kernel modesetting and evdev \
-input devices, an X application, or a wayland client itself. The clients can \
-be traditional applications, X servers (rootless or fullscreen) or other \
-display servers."
-HOMEPAGE = "http://wayland.freedesktop.org"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://COPYING;md5=1d4476a7d98dd5691c53d4d43a510c72 \
- file://src/wayland-server.c;endline=21;md5=079ae21dbf98ada52ec23744851b0a5c"
-
-SRC_URI = "http://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
- file://always-build-scanner.patch"
-SRC_URI[md5sum] = "6e877877c3e04cfb865cfcd0733c9ab1"
-SRC_URI[sha256sum] = "f17c938d1c24fd0a10f650a623a2775d329db3168b5732e498b08388ec776fc8"
-
-SRC_URI_append_class-native = " \
- file://disable-macro-checks-not-used-for-scanner.patch \
- "
-EXTRA_OECONF_class-native = "--disable-documentation"
-
-inherit autotools pkgconfig
-
-BBCLASSEXTEND = "native nativesdk"
-
-DEPENDS = "expat libffi wayland-native"
-
-EXTRA_OECONF = "--disable-documentation --with-host-scanner"
-
-# Wayland installs a M4 macro for other projects to use, which uses the target
-# pkg-config to find files. Replace pkg-config with pkg-config-native.
-do_install_append_class-native() {
- sed -e 's,PKG_CHECK_MODULES(.*),,g' \
- -e 's,$PKG_CONFIG,pkg-config-native,g' \
- -i ${D}/${datadir}/aclocal/wayland-scanner.m4
-}
-
-sysroot_stage_all_append_class-target () {
- rm ${SYSROOT_DESTDIR}/${datadir}/aclocal/wayland-scanner.m4
- cp ${STAGING_DATADIR_NATIVE}/aclocal/wayland-scanner.m4 ${SYSROOT_DESTDIR}/${datadir}/aclocal/
-}
-
-FILES_${PN} = "${libdir}/*${SOLIBS}"
-FILES_${PN}-dev += "${bindir} ${datadir}/wayland"
diff --git a/meta/recipes-graphics/wayland/weston-init.bb b/meta/recipes-graphics/wayland/weston-init.bb
index fc2e4f80ee..77dda03cf5 100644
--- a/meta/recipes-graphics/wayland/weston-init.bb
+++ b/meta/recipes-graphics/wayland/weston-init.bb
@@ -1,21 +1,97 @@
-SUMMARY = "Startup script for the Weston Wayland compositor"
+SUMMARY = "Startup script and systemd unit file for the Weston Wayland compositor"
LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
-SRC_URI = "file://init"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+SRC_URI = "file://init \
+ file://weston.env \
+ file://weston.ini \
+ file://weston.service \
+ file://weston.socket \
+ file://weston-autologin \
+ file://weston-start"
S = "${WORKDIR}"
+PACKAGECONFIG ??= ""
+PACKAGECONFIG:append:qemuriscv64 = " use-pixman"
+PACKAGECONFIG:append:qemuppc64 = " use-pixman"
+
+PACKAGECONFIG[no-idle-timeout] = ",,"
+PACKAGECONFIG[use-pixman] = ",,"
+
+DEFAULTBACKEND ??= ""
+DEFAULTBACKEND:qemuall ?= "drm"
+
do_install() {
- install -d ${D}/${sysconfdir}/init.d
- install -m755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston
+ if [ "${VIRTUAL-RUNTIME_init_manager}" != "systemd" ]; then
+ install -Dm755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston
+ sed -i 's#ROOTHOME#${ROOT_HOME}#' ${D}/${sysconfdir}/init.d/weston
+ fi
+ install -D -p -m0644 ${WORKDIR}/weston.ini ${D}${sysconfdir}/xdg/weston/weston.ini
+ install -Dm644 ${WORKDIR}/weston.env ${D}${sysconfdir}/default/weston
+
+ # Install Weston systemd service and accompanying udev rule
+ install -D -p -m0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}/weston.service
+ install -D -p -m0644 ${WORKDIR}/weston.socket ${D}${systemd_system_unitdir}/weston.socket
+ if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
+ install -D -p -m0644 ${WORKDIR}/weston-autologin ${D}${sysconfdir}/pam.d/weston-autologin
+ fi
+ sed -i -e s:/etc:${sysconfdir}:g \
+ -e s:/usr/bin:${bindir}:g \
+ -e s:/var:${localstatedir}:g \
+ ${D}${systemd_system_unitdir}/weston.service
+ # Install weston-start script
+ install -Dm755 ${WORKDIR}/weston-start ${D}${bindir}/weston-start
+ sed -i 's,@DATADIR@,${datadir},g' ${D}${bindir}/weston-start
+ sed -i 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${bindir}/weston-start
+ if [ -n "${DEFAULTBACKEND}" ]; then
+ sed -i -e "/^\[core\]/a backend=${DEFAULTBACKEND}-backend.so" ${D}${sysconfdir}/xdg/weston/weston.ini
+ fi
+
+ if [ "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'yes', 'no', d)}" = "yes" ]; then
+ sed -i -e "/^\[core\]/a xwayland=true" ${D}${sysconfdir}/xdg/weston/weston.ini
+ fi
+
+ if [ "${@bb.utils.contains('PACKAGECONFIG', 'no-idle-timeout', 'yes', 'no', d)}" = "yes" ]; then
+ sed -i -e "/^\[core\]/a idle-time=0" ${D}${sysconfdir}/xdg/weston/weston.ini
+ fi
+
+ if [ "${@bb.utils.contains('PACKAGECONFIG', 'use-pixman', 'yes', 'no', d)}" = "yes" ]; then
+ sed -i -e "/^\[core\]/a use-pixman=true" ${D}${sysconfdir}/xdg/weston/weston.ini
+ fi
+
+ install -dm 755 -o weston -g weston ${D}/home/weston
}
-inherit allarch update-rc.d distro_features_check
+INHIBIT_UPDATERCD_BBCLASS = "${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', '1', '', d)}"
+
+inherit update-rc.d systemd useradd
+
+USERADD_PACKAGES = "${PN}"
+
# rdepends on weston which depends on virtual/egl
-REQUIRED_DISTRO_FEATURES = "opengl"
+#
+require ${THISDIR}/required-distro-features.inc
-RDEPENDS_${PN} = "weston kbd"
+RDEPENDS:${PN} = "weston kbd"
INITSCRIPT_NAME = "weston"
INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ."
+
+FILES:${PN} += "\
+ ${sysconfdir}/xdg/weston/weston.ini \
+ ${systemd_system_unitdir}/weston.service \
+ ${systemd_system_unitdir}/weston.socket \
+ ${sysconfdir}/default/weston \
+ ${sysconfdir}/pam.d/ \
+ /home/weston \
+ "
+
+CONFFILES:${PN} += "${sysconfdir}/xdg/weston/weston.ini ${sysconfdir}/default/weston"
+
+SYSTEMD_SERVICE:${PN} = "weston.service weston.socket"
+USERADD_PARAM:${PN} = "--home /home/weston --shell /bin/sh --user-group -G video,input weston"
+GROUPADD_PARAM:${PN} = "-r wayland"
+
diff --git a/meta/recipes-graphics/wayland/weston-init/init b/meta/recipes-graphics/wayland/weston-init/init
index 2e938f4307..d3b0d1873e 100644
--- a/meta/recipes-graphics/wayland/weston-init/init
+++ b/meta/recipes-graphics/wayland/weston-init/init
@@ -30,15 +30,9 @@ done
case "$1" in
start)
. /etc/profile
+ export HOME=ROOTHOME
- # This is all a nasty hack
- if test -z "$XDG_RUNTIME_DIR"; then
- export XDG_RUNTIME_DIR=/run/user/root
- mkdir --parents $XDG_RUNTIME_DIR
- chmod 0700 $XDG_RUNTIME_DIR
- fi
-
- openvt -s weston -- $OPTARGS
+ WESTON_USER=weston weston-start $OPTARGS &
;;
stop)
diff --git a/meta/recipes-graphics/wayland/weston-init/weston-autologin b/meta/recipes-graphics/wayland/weston-init/weston-autologin
new file mode 100644
index 0000000000..f6e6d106de
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston-init/weston-autologin
@@ -0,0 +1,11 @@
+auth required pam_nologin.so
+auth required pam_unix.so try_first_pass nullok
+
+account required pam_nologin.so
+account required pam_unix.so
+
+session required pam_env.so
+session required pam_unix.so
+-session optional pam_systemd.so type=wayland class=user desktop=weston
+-session optional pam_loginuid.so
+
diff --git a/meta/recipes-graphics/wayland/weston-init/weston-start b/meta/recipes-graphics/wayland/weston-init/weston-start
new file mode 100755
index 0000000000..01670cd4f5
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston-init/weston-start
@@ -0,0 +1,71 @@
+#!/bin/sh
+# Copyright (C) 2016 O.S. Systems Software LTDA.
+# Copyright (C) 2016 Freescale Semiconductor
+
+export PATH="/sbin:/usr/sbin:/bin:/usr/bin"
+
+usage() {
+ cat <<EOF
+ $0 [<weston options>]
+EOF
+}
+
+## Module support
+modules_dir=@DATADIR@/weston-start
+
+# Add weston extra argument
+add_weston_argument() {
+ weston_args="$weston_args $1"
+}
+
+## Add module to --modules argument
+add_weston_module() {
+ if [[ "x${weston_modules}" == "x" ]]; then
+ weston_modules="--modules "
+ fi;
+ weston_modules+="${1},"
+}
+
+if [ -n "$WAYLAND_DISPLAY" ]; then
+ echo "ERROR: A Wayland compositor is already running, nested Weston instance is not supported yet."
+ exit 1
+fi
+
+if [ -n "$WESTON_USER" ]; then
+ if [ -z "$WESTON_GROUP" ]; then
+ # no explicit WESTON_GROUP given, therefore use WESTON_USER
+ export WESTON_GROUP="${WESTON_USER}"
+ fi
+fi
+
+weston_args=$*
+
+# Load and run modules
+if [ -d "$modules_dir" ]; then
+ for m in "$modules_dir"/*; do
+ # Skip backup files
+ if [ "`echo $m | sed -e 's/\~$//'`" != "$m" ]; then
+ continue
+ fi
+
+ # process module
+ . $m
+ if [[ x"{$weston_modules}" != "x" ]]; then
+ add_weston_argument "${weston_modules}"
+ fi;
+ done
+fi
+
+if test -z "$XDG_RUNTIME_DIR"; then
+ export XDG_RUNTIME_DIR=/run/user/`id -u ${WESTON_USER}`
+ if ! test -d "$XDG_RUNTIME_DIR"; then
+ mkdir --parents $XDG_RUNTIME_DIR
+ chmod 0700 $XDG_RUNTIME_DIR
+ fi
+ if [ -n "$WESTON_USER" ]
+ then
+ chown $WESTON_USER:$WESTON_GROUP $XDG_RUNTIME_DIR
+ fi
+fi
+
+su -c "XDG_RUNTIME_DIR=/run/user/`id -u ${WESTON_USER}` weston $weston_args --log=/tmp/weston.log" $WESTON_USER
diff --git a/meta/recipes-graphics/wayland/weston-init/weston.env b/meta/recipes-graphics/wayland/weston-init/weston.env
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston-init/weston.env
diff --git a/meta/recipes-graphics/wayland/weston-init/weston.ini b/meta/recipes-graphics/wayland/weston-init/weston.ini
new file mode 100644
index 0000000000..6bd5aef55a
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston-init/weston.ini
@@ -0,0 +1,75 @@
+# configuration file for Weston
+
+[core]
+#modules=xwayland.so,cms-colord.so
+#shell=desktop-shell.so
+#gbm-format=xrgb2101010
+require-input=false
+
+#[shell]
+#background-image=/usr/share/backgrounds/gnome/Aqua.jpg
+#background-color=0xff002244
+#background-type=tile
+#clock-format=minutes
+#panel-color=0x90ff0000
+#locking=true
+#animation=zoom
+#startup-animation=fade
+#binding-modifier=ctrl
+#num-workspaces=6
+#cursor-theme=whiteglass
+#cursor-size=24
+
+#lockscreen-icon=/usr/share/icons/gnome/256x256/actions/lock.png
+#lockscreen=/usr/share/backgrounds/gnome/Garden.jpg
+#homescreen=/usr/share/backgrounds/gnome/Blinds.jpg
+#animation=fade
+
+#[launcher]
+#icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
+#path=/usr/bin/gnome-terminal
+
+#[launcher]
+#icon=/usr/share/icons/gnome/24x24/apps/utilities-terminal.png
+#path=/usr/bin/weston-terminal
+
+#[launcher]
+#icon=/usr/share/icons/hicolor/24x24/apps/google-chrome.png
+#path=/usr/bin/google-chrome
+
+#[launcher]
+#icon=/usr/share/icons/gnome/24x24/apps/arts.png
+#path=/build/weston-0lEgCh/weston-1.11.0/weston-flower
+
+#[input-method]
+#path=/usr/libexec/weston-keyboard
+
+#[output]
+#name=LVDS1
+#mode=1680x1050
+#transform=90
+#icc_profile=/usr/share/color/icc/colord/Bluish.icc
+
+#[output]
+#name=VGA1
+#mode=173.00 1920 2048 2248 2576 1080 1083 1088 1120 -hsync +vsync
+#transform=flipped
+
+#[output]
+#name=X1
+#mode=1024x768
+#transform=flipped-90
+
+#[libinput]
+#enable_tap=true
+
+#[touchpad]
+#constant_accel_factor = 50
+#min_accel_factor = 0.16
+#max_accel_factor = 1.0
+
+[screen-share]
+command=/usr/bin/weston --backend=rdp-backend.so --shell=fullscreen-shell.so --no-clients-resize
+
+#[xwayland]
+#path=/usr/bin/Xwayland
diff --git a/meta/recipes-graphics/wayland/weston-init/weston.service b/meta/recipes-graphics/wayland/weston-init/weston.service
new file mode 100644
index 0000000000..80745998ed
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston-init/weston.service
@@ -0,0 +1,71 @@
+# This is a system unit for launching Weston with auto-login as the
+# user configured here.
+#
+# Weston must be built with systemd support, and your weston.ini must load
+# the plugin systemd-notify.so.
+[Unit]
+Description=Weston, a Wayland compositor, as a system service
+Documentation=man:weston(1) man:weston.ini(5)
+Documentation=http://wayland.freedesktop.org/
+
+# Make sure we are started after logins are permitted.
+Requires=systemd-user-sessions.service
+After=systemd-user-sessions.service
+
+# If Plymouth is used, we want to start when it is on its way out.
+After=plymouth-quit-wait.service
+
+# D-Bus is necessary for contacting logind. Logind is required.
+Wants=dbus.socket
+After=dbus.socket
+
+# Ensure the socket is present
+Requires=weston.socket
+
+# Since we are part of the graphical session, make sure we are started before
+# it is complete.
+Before=graphical.target
+
+# Prevent starting on systems without virtual consoles, Weston requires one
+# for now.
+ConditionPathExists=/dev/tty0
+
+[Service]
+# Requires systemd-notify.so Weston plugin.
+Type=notify
+EnvironmentFile=/etc/default/weston
+ExecStart=/usr/bin/weston --modules=systemd-notify.so
+
+# Optional watchdog setup
+#TimeoutStartSec=60
+#WatchdogSec=20
+
+# The user to run Weston as.
+User=weston
+Group=weston
+
+# Make sure the working directory is the users home directory
+WorkingDirectory=/home/weston
+
+# Set up a full user session for the user, required by Weston.
+PAMName=weston-autologin
+
+# A virtual terminal is needed.
+TTYPath=/dev/tty7
+TTYReset=yes
+TTYVHangup=yes
+TTYVTDisallocate=yes
+
+# Fail to start if not controlling the tty.
+StandardInput=tty-fail
+StandardOutput=journal
+StandardError=journal
+
+# Log this user with utmp, letting it show up with commands 'w' and 'who'.
+UtmpIdentifier=tty7
+UtmpMode=user
+
+[Install]
+# Note: If you only want weston to start on-demand, remove this line with a
+# service drop file
+WantedBy=graphical.target
diff --git a/meta/recipes-graphics/wayland/weston-init/weston.socket b/meta/recipes-graphics/wayland/weston-init/weston.socket
new file mode 100644
index 0000000000..c1bdc83c05
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston-init/weston.socket
@@ -0,0 +1,14 @@
+[Unit]
+Description=Weston socket
+RequiresMountsFor=/run
+
+[Socket]
+ListenStream=/run/wayland-0
+SocketMode=0775
+SocketUser=weston
+SocketGroup=wayland
+RemoveOnStop=yes
+
+[Install]
+WantedBy=sockets.target
+
diff --git a/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch b/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch
deleted file mode 100644
index 148848d8d2..0000000000
--- a/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-From c22e90365d89346258394833cbcad03ff32b2e27 Mon Sep 17 00:00:00 2001
-From: Khem Raj <raj.khem@gmail.com>
-Date: Fri, 29 May 2015 20:56:00 -0700
-Subject: [PATCH weston] make error() portable
-
-error() is not posix but gnu extension so may not be available on all
-kind of systemsi e.g. musl.
-
-Signed-off-by: Khem Raj <raj.khem@gmail.com>
----
-Upstream-Status: Submitted
-
- configure.ac | 2 ++
- src/weston-error.h | 20 ++++++++++++++++++++
- src/weston-launch.c | 2 +-
- 3 files changed, 23 insertions(+), 1 deletion(-)
- create mode 100644 src/weston-error.h
-
-diff --git a/configure.ac b/configure.ac
-index 263fc22..f52cd62 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -57,6 +57,8 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[],
- [[#include <time.h>]])
- AC_CHECK_HEADERS([execinfo.h])
-
-+AC_CHECK_HEADERS([error.h])
-+
- AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate])
-
- COMPOSITOR_MODULES="wayland-server >= 1.7.93 pixman-1 >= 0.25.2"
-diff --git a/src/weston-error.h b/src/weston-error.h
-new file mode 100644
-index 0000000..2089d02
---- /dev/null
-+++ b/src/weston-error.h
-@@ -0,0 +1,20 @@
-+#ifndef _WESTON_ERROR_H
-+#define _WESTON_ERROR_H
-+
-+#if defined(HAVE_ERROR_H)
-+#include <error.h>
-+#else
-+#include <err.h>
-+#include <string.h>
-+#define _weston_error(S, E, F, ...) do { \
-+ if (E) \
-+ err(S, F ": %s", ##__VA_ARGS__, strerror(E)); \
-+ else \
-+ err(S, F, ##__VA_ARGS__); \
-+} while(0)
-+
-+#define error _weston_error
-+#endif
-+
-+#endif
-+
-diff --git a/src/weston-launch.c b/src/weston-launch.c
-index 10c66de..3e6d30a 100644
---- a/src/weston-launch.c
-+++ b/src/weston-launch.c
-@@ -30,7 +30,6 @@
- #include <poll.h>
- #include <errno.h>
-
--#include <error.h>
- #include <getopt.h>
-
- #include <sys/types.h>
-@@ -56,6 +55,7 @@
- #endif
-
- #include "weston-launch.h"
-+#include "weston-error.h"
-
- #define DRM_MAJOR 226
-
---
-2.1.4
-
diff --git a/meta/recipes-graphics/wayland/weston/explicit-enable-disable-systemd.patch b/meta/recipes-graphics/wayland/weston/explicit-enable-disable-systemd.patch
deleted file mode 100644
index a40eaf186e..0000000000
--- a/meta/recipes-graphics/wayland/weston/explicit-enable-disable-systemd.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-From 8e1efcd40b3bad81c83744e2e120d70c2b567ef2 Mon Sep 17 00:00:00 2001
-From: Frederico Cadete <frederico@cadete.eu>
-Date: Mon, 28 Sep 2015 00:30:10 +0200
-Subject: configure.ac: add explicit enable/disable for systemd-login support
-
-Otherwise, auto-enable depending on whether the system has the necessary
-libraries.
-
-[Updated help text as per pq suggestion -- bwh]
-
-Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
-Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-Tested-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
-
-Upstream-Status: Backport
-Backported from Weston git:
-http://cgit.freedesktop.org/wayland/weston/commit/?id=8e1efc
-
-Signed-off-by: Joshua Lock <joshua.lock@collabora.co.uk>
-
-diff --git a/configure.ac b/configure.ac
-index a9cd429..67e80d0 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -380,18 +380,30 @@ AC_ARG_ENABLE(resize-optimization,
- AS_IF([test "x$enable_resize_optimization" = "xyes"],
- [AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a performance optimization])])
-
--PKG_CHECK_MODULES(SYSTEMD_LOGIN,
-- [libsystemd >= 209],
-- [have_systemd_login_209=yes;have_systemd_login=yes],
-- [have_systemd_login_209=no;have_systemd_login=no])
--
--# Older versions of systemd package systemd-login separately. Fall back on that
--AS_IF([test x$have_systemd_login != xyes],[
-- PKG_CHECK_MODULES(SYSTEMD_LOGIN,
-- [libsystemd-login >= 198],
-- [have_systemd_login=yes],
-- [have_systemd_login=no])
-- ])
-+AC_ARG_ENABLE(systemd-login,
-+ AS_HELP_STRING([--enable-systemd-login],
-+ [Enable logind support]),,
-+ enable_systemd_login=auto)
-+if test x$enable_systemd_login != xno; then
-+ PKG_CHECK_MODULES(SYSTEMD_LOGIN,
-+ [libsystemd >= 209],
-+ [have_systemd_login_209=yes;have_systemd_login=yes],
-+ [have_systemd_login_209=no;have_systemd_login=no])
-+
-+ # Older versions of systemd package systemd-login separately. Fall back on that
-+ AS_IF([test x$have_systemd_login != xyes],[
-+ PKG_CHECK_MODULES(SYSTEMD_LOGIN,
-+ [libsystemd-login >= 198],
-+ [have_systemd_login=yes],
-+ [have_systemd_login=no])
-+ ])
-+else
-+ have_systemd_login=no
-+fi
-+
-+if test "x$have_systemd_login" = "xno" -a "x$enable_systemd_login" = "xyes"; then
-+ AC_MSG_ERROR([systemd-login support explicitly enabled, but can't find libsystemd>=209 or libsystemd-login])
-+fi
-
- AS_IF([test "x$have_systemd_login" = "xyes"],
- [AC_DEFINE([HAVE_SYSTEMD_LOGIN], [1], [Have systemd-login])])
---
-cgit v0.10.2
-
diff --git a/meta/recipes-graphics/wayland/weston/libsystemd.patch b/meta/recipes-graphics/wayland/weston/libsystemd.patch
deleted file mode 100644
index 2d28d5689a..0000000000
--- a/meta/recipes-graphics/wayland/weston/libsystemd.patch
+++ /dev/null
@@ -1,53 +0,0 @@
-From 5eb025a867b42f8bc7bc73279eac8de58e51a13e Mon Sep 17 00:00:00 2001
-From: Frederico Cadete <frederico@cadete.eu>
-Date: Mon, 28 Sep 2015 00:30:09 +0200
-Subject: configure.ac: add support for new versions of systemd
-
-Starting from systemd version 209, a single libsystemd.pc is provided.
-For previous versions, fall back on libsystemd-login.pc.
-
-Signed-off-by: Frederico Cadete <frederico@cadete.eu>
-Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
-Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
-
-Upstream-Status: Backport
-Backported from Weston git:
-http://cgit.freedesktop.org/wayland/weston/commit/?id=5eb025
-
-Signed-off-by: Joshua Lock <joshua.lock@collabora.co.uk>
-
-diff --git a/configure.ac b/configure.ac
-index 045291c..a9cd429 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -380,14 +380,23 @@ AC_ARG_ENABLE(resize-optimization,
- AS_IF([test "x$enable_resize_optimization" = "xyes"],
- [AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a performance optimization])])
-
--PKG_CHECK_MODULES(SYSTEMD_LOGIN, [libsystemd-login >= 198],
-- [have_systemd_login=yes], [have_systemd_login=no])
-+PKG_CHECK_MODULES(SYSTEMD_LOGIN,
-+ [libsystemd >= 209],
-+ [have_systemd_login_209=yes;have_systemd_login=yes],
-+ [have_systemd_login_209=no;have_systemd_login=no])
-+
-+# Older versions of systemd package systemd-login separately. Fall back on that
-+AS_IF([test x$have_systemd_login != xyes],[
-+ PKG_CHECK_MODULES(SYSTEMD_LOGIN,
-+ [libsystemd-login >= 198],
-+ [have_systemd_login=yes],
-+ [have_systemd_login=no])
-+ ])
-+
- AS_IF([test "x$have_systemd_login" = "xyes"],
- [AC_DEFINE([HAVE_SYSTEMD_LOGIN], [1], [Have systemd-login])])
- AM_CONDITIONAL(HAVE_SYSTEMD_LOGIN, test "x$have_systemd_login" = "xyes")
-
--PKG_CHECK_MODULES(SYSTEMD_LOGIN_209, [libsystemd-login >= 209],
-- [have_systemd_login_209=yes], [have_systemd_login_209=no])
- AS_IF([test "x$have_systemd_login_209" = "xyes"],
- [AC_DEFINE([HAVE_SYSTEMD_LOGIN_209], [1], [Have systemd-login >= 209])])
-
---
-cgit v0.10.2
-
diff --git a/meta/recipes-graphics/wayland/weston/make-lcms-explicitly-configurable.patch b/meta/recipes-graphics/wayland/weston/make-lcms-explicitly-configurable.patch
deleted file mode 100644
index 35e6d6ff58..0000000000
--- a/meta/recipes-graphics/wayland/weston/make-lcms-explicitly-configurable.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-weston-1.5.0/configure.ac: make lcms explicitly configurable
-
-The lcms package is outside of openembedded-core, so make it
-explicitly configurable. Make it deterministic, so that if lcms
-dependencies are missing, autoconf throws a fatal error. Follow
-upstream style to make it more likely to be merged.
-
-Upstream-Status: Pending
-
-Index: weston-1.5.0/configure.ac
-===================================================================
---- weston-1.5.0.orig/configure.ac
-+++ weston-1.5.0/configure.ac
-@@ -491,12 +491,24 @@ AC_ARG_ENABLE(demo-clients-install,
- enable_demo_clients_install=no)
- AM_CONDITIONAL(INSTALL_DEMO_CLIENTS, [test "x$enable_demo_clients_install" = "xyes"])
-
--PKG_CHECK_MODULES(LCMS, lcms2,
-- [have_lcms=yes], [have_lcms=no])
--if test "x$have_lcms" = xyes; then
-- AC_DEFINE(HAVE_LCMS, 1, [Have lcms support])
-+AC_ARG_ENABLE(lcms,
-+ AS_HELP_STRING([--disable-lcms],
-+ [Disable lcms support]),,
-+ enable_lcms=auto)
-+AM_CONDITIONAL(HAVE_LCMS, [test "x$enable_lcms" = xyes])
-+if test "x$enable_lcms" != "xno"; then
-+ PKG_CHECK_MODULES(LCMS,
-+ lcms2,
-+ [have_lcms=yes],
-+ [have_lcms=no])
-+ if test "x$have_lcms" = "xno" -a "x$enable_lcms" = "xyes"; then
-+ AC_MSG_ERROR([lcms support explicitly requested, but lcms couldn't be found])
-+ fi
-+ if test "x$have_lcms" = "xyes"; then
-+ enable_lcms=yes
-+ AC_DEFINE(HAVE_LCMS, 1, [Have lcms support])
-+ fi
- fi
--AM_CONDITIONAL(HAVE_LCMS, [test "x$have_lcms" = xyes])
-
- AC_PATH_PROG([wayland_scanner], [wayland-scanner])
- if test x$wayland_scanner = x; then
diff --git a/meta/recipes-graphics/wayland/weston/make-libwebp-explicitly-configurable.patch b/meta/recipes-graphics/wayland/weston/make-libwebp-explicitly-configurable.patch
deleted file mode 100644
index ad07d4fc2d..0000000000
--- a/meta/recipes-graphics/wayland/weston/make-libwebp-explicitly-configurable.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-
-The libwebp package is outside of openembedded-core, so make it
-explicitly configurable. Make it deterministic, so that if libwebp
-dependencies are missing, autoconf throws a fatal error.
-
-Upstream-Status: Pending
-
-Index: weston-1.5.0/configure.ac
-===================================================================
---- weston-1.5.0.orig/configure.ac
-+++ weston-1.5.0/configure.ac
-@@ -268,9 +268,22 @@ fi
-
- PKG_CHECK_MODULES(PIXMAN, [pixman-1])
- PKG_CHECK_MODULES(PNG, [libpng])
--PKG_CHECK_MODULES(WEBP, [libwebp], [have_webp=yes], [have_webp=no])
--AS_IF([test "x$have_webp" = "xyes"],
-- [AC_DEFINE([HAVE_WEBP], [1], [Have webp])])
-+AC_ARG_ENABLE(webp,
-+ AS_HELP_STRING([--disable-webp],
-+ [Disable libwebp support]),,
-+ enable_webp=auto)
-+AM_CONDITIONAL(HAVE_WEBP, [test "x$enable_webp" = xyes])
-+AS_IF([test "x$enable_webp" != "xno"],
-+ PKG_CHECK_MODULES(WEBP,
-+ [libwebp],
-+ [have_webp=yes],
-+ [have_webp=no])
-+ AS_IF([test "x$have_webp" = "xno" -a "x$enable_webp" = "xyes"],
-+ AC_MSG_ERROR([libwebp support explicitly request, but lipwebp could not be found]))
-+ AS_IF([test "x$have_webp" = "xyes"],
-+ [enable_webp=yes]
-+ [AC_DEFINE([HAVE_WEBP], [1], [Have webp])])
-+)
-
- AC_ARG_ENABLE(vaapi-recorder, [ --enable-vaapi-recorder],,
- enable_vaapi_recorder=auto)
diff --git a/meta/recipes-graphics/wayland/weston/parallelmake.patch b/meta/recipes-graphics/wayland/weston/parallelmake.patch
deleted file mode 100644
index 42b5efbc3a..0000000000
--- a/meta/recipes-graphics/wayland/weston/parallelmake.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-Backport two patches from upstream to fix parallel builds
-
-- mkdir races (2eff22b8e6f6e5255a1915c33dfd91cecf02cbbc)
-- weston.desktop race (315476fa7b1f1c44c1b35116036df54ac5cb9a03)
-
-Upstream-Status: Backport
-Signed-off-by: Ross Burton <ross.burton@intel.com>
-
-diff --git a/Makefile.am b/Makefile.am
-index 5819b19..ff13b19 100644
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -20,7 +20,7 @@ weston.ini : $(srcdir)/weston.ini.in
- $< > $@
-
- ivi-shell/weston.ini : $(srcdir)/ivi-shell/weston.ini.in
-- $(AM_V_GEN)$(SED) \
-+ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
- -e 's|@bindir[@]|$(bindir)|g' \
- -e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \
- -e 's|@abs_top_srcdir[@]|$(abs_top_srcdir)|g' \
-@@ -29,7 +29,7 @@ ivi-shell/weston.ini : $(srcdir)/ivi-shell/weston.ini.in
- $< > $@
-
- tests/weston-ivi.ini : $(srcdir)/ivi-shell/weston.ini.in
-- $(AM_V_GEN)$(SED) \
-+ $(AM_V_GEN)$(MKDIR_P) $(dir $@) && $(SED) \
- -e 's|@bindir[@]|$(bindir)|g' \
- -e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \
- -e 's|@abs_top_srcdir[@]|$(abs_top_srcdir)|g' \
-@@ -179,8 +179,7 @@ pkgconfigdir = $(libdir)/pkgconfig
- pkgconfig_DATA = src/weston.pc
-
- wayland_sessiondir = $(datadir)/wayland-sessions
--wayland_session_DATA = src/weston.desktop
--dist_wayland_session_DATA = $(wayland_session_DATA)
-+dist_wayland_session_DATA = src/weston.desktop
-
- westonincludedir = $(includedir)/weston
- westoninclude_HEADERS = \
diff --git a/meta/recipes-graphics/wayland/weston/systemd-notify.weston-start b/meta/recipes-graphics/wayland/weston/systemd-notify.weston-start
new file mode 100644
index 0000000000..a97e7b38d9
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston/systemd-notify.weston-start
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# SPDX-FileCopyrightText: Huawei Inc.
+# SPDX-License-Identifier: Apache-2.0
+
+
+if [[ -x "/usr/lib/weston/systemd-notify.so" ]]; then
+ add_weston_module "systemd-notify.so"
+fi
diff --git a/meta/recipes-graphics/wayland/weston/xwayland.weston-start b/meta/recipes-graphics/wayland/weston/xwayland.weston-start
new file mode 100644
index 0000000000..342ac8d129
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston/xwayland.weston-start
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+if type Xwayland >/dev/null 2>/dev/null; then
+ mkdir -m 775 -p /tmp/.X11-unix
+ chown root:video /tmp/.X11-unix
+fi
diff --git a/meta/recipes-graphics/wayland/weston_1.8.0.bb b/meta/recipes-graphics/wayland/weston_1.8.0.bb
deleted file mode 100644
index aff9a12fdd..0000000000
--- a/meta/recipes-graphics/wayland/weston_1.8.0.bb
+++ /dev/null
@@ -1,104 +0,0 @@
-SUMMARY = "Weston, a Wayland compositor"
-DESCRIPTION = "Weston is the reference implementation of a Wayland compositor"
-HOMEPAGE = "http://wayland.freedesktop.org"
-LICENSE = "MIT"
-LIC_FILES_CHKSUM = "file://COPYING;md5=275efac2559a224527bd4fd593d38466 \
- file://src/compositor.c;endline=23;md5=a9793f1edc8d1a4c344ca8ae252352fb"
-
-SRC_URI = "http://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
- file://weston.png \
- file://weston.desktop \
- file://make-lcms-explicitly-configurable.patch \
- file://make-libwebp-explicitly-configurable.patch \
- file://0001-make-error-portable.patch \
- file://parallelmake.patch \
- file://libsystemd.patch \
- file://explicit-enable-disable-systemd.patch \
-"
-SRC_URI[md5sum] = "24cb8a7ed0535b4fc3642643988dab36"
-SRC_URI[sha256sum] = "8963e69f328e815cec42c58046c4af721476c7541bb7d9edc71740fada5ad312"
-
-inherit autotools pkgconfig useradd distro_features_check
-# depends on virtual/egl
-REQUIRED_DISTRO_FEATURES = "opengl"
-
-DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0 jpeg"
-DEPENDS += "wayland libinput virtual/egl pango"
-
-EXTRA_OECONF = "--enable-setuid-install \
- --enable-simple-clients \
- --enable-clients \
- --enable-demo-clients-install \
- --disable-rpi-compositor \
- --disable-rdp-compositor \
- "
-
-EXTRA_OECONF_append_qemux86 = "\
- WESTON_NATIVE_BACKEND=fbdev-backend.so \
- "
-EXTRA_OECONF_append_qemux86-64 = "\
- WESTON_NATIVE_BACKEND=fbdev-backend.so \
- "
-PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl', '', d)} \
- ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)} \
- ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'launch', '', d)} \
- ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd', '', d)} \
- "
-#
-# Compositor choices
-#
-# Weston on KMS
-PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm udev virtual/mesa mtdev"
-# Weston on Wayland (nested Weston)
-PACKAGECONFIG[wayland] = "--enable-wayland-compositor,--disable-wayland-compositor,virtual/mesa"
-# Weston on X11
-PACKAGECONFIG[x11] = "--enable-x11-compositor,--disable-x11-compositor,virtual/libx11 libxcb libxcb libxcursor cairo"
-# Headless Weston
-PACKAGECONFIG[headless] = "--enable-headless-compositor,--disable-headless-compositor"
-# Weston on framebuffer
-PACKAGECONFIG[fbdev] = "--enable-fbdev-compositor,--disable-fbdev-compositor,udev mtdev"
-# weston-launch
-PACKAGECONFIG[launch] = "--enable-weston-launch,--disable-weston-launch,libpam drm"
-# VA-API desktop recorder
-PACKAGECONFIG[vaapi] = "--enable-vaapi-recorder,--disable-vaapi-recorder,libva"
-# Weston with EGL support
-PACKAGECONFIG[egl] = "--enable-egl --enable-simple-egl-clients,--disable-egl --disable-simple-egl-clients,virtual/egl"
-# Weston with cairo glesv2 support
-PACKAGECONFIG[cairo-glesv2] = "--with-cairo-glesv2,--with-cairo=image,cairo"
-# Weston with lcms support
-PACKAGECONFIG[lcms] = "--enable-lcms,--disable-lcms,lcms"
-# Weston with webp support
-PACKAGECONFIG[webp] = "--enable-webp,--disable-webp,libwebp"
-# Weston with unwinding support
-PACKAGECONFIG[libunwind] = "--enable-libunwind,--disable-libunwind,libunwind"
-# Weston with systemd-login support
-PACKAGECONFIG[systemd] = "--enable-systemd-login,--disable-systemd-login,systemd dbus"
-# Weston with Xwayland support
-PACKAGECONFIG[xwayland] = "--enable-xwayland,--disable-xwayland,libxcb libxcursor cairo"
-# colord CMS support
-PACKAGECONFIG[colord] = "--enable-colord,--disable-colord,colord"
-
-do_install_append() {
- # Weston doesn't need the .la files to load modules, so wipe them
- rm -f ${D}/${libdir}/weston/*.la
-
- # If X11, ship a desktop file to launch it
- if [ "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'x11', '', d)}" = "x11" ]; then
- install -d ${D}${datadir}/applications
- install ${WORKDIR}/weston.desktop ${D}${datadir}/applications
-
- install -d ${D}${datadir}/icons/hicolor/48x48/apps
- install ${WORKDIR}/weston.png ${D}${datadir}/icons/hicolor/48x48/apps
- fi
-}
-
-PACKAGES += "${PN}-examples"
-
-FILES_${PN} = "${bindir}/weston ${bindir}/weston-terminal ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode ${libexecdir} ${libdir}/${BPN}/*.so ${datadir}"
-FILES_${PN}-examples = "${bindir}/*"
-
-RDEPENDS_${PN} += "xkeyboard-config"
-RRECOMMENDS_${PN} = "liberation-fonts"
-
-USERADD_PACKAGES = "${PN}"
-GROUPADD_PARAM_${PN} = "--system weston-launch"
diff --git a/meta/recipes-graphics/wayland/weston_11.0.1.bb b/meta/recipes-graphics/wayland/weston_11.0.1.bb
new file mode 100644
index 0000000000..b943842bc4
--- /dev/null
+++ b/meta/recipes-graphics/wayland/weston_11.0.1.bb
@@ -0,0 +1,139 @@
+SUMMARY = "Weston, a Wayland compositor"
+DESCRIPTION = "Weston is the reference implementation of a Wayland compositor"
+HOMEPAGE = "http://wayland.freedesktop.org"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70 \
+ file://libweston/compositor.c;endline=27;md5=eb6d5297798cabe2ddc65e2af519bcf0 \
+ "
+
+SRC_URI = "https://gitlab.freedesktop.org/wayland/weston/uploads/f5648c818fba5432edc3ea63c4db4813/${BPN}-${PV}.tar.xz \
+ file://weston.png \
+ file://weston.desktop \
+ file://xwayland.weston-start \
+ file://systemd-notify.weston-start \
+ "
+
+SRC_URI[sha256sum] = "a413f68c252957fc3191c3650823ec356ae8c124ccc0cb440da5cdc4e2cb9e57"
+
+UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html"
+UPSTREAM_CHECK_REGEX = "weston-(?P<pver>\d+\.\d+\.(?!9\d+)\d+)"
+
+inherit meson pkgconfig useradd
+
+# depends on virtual/egl
+#
+require ${THISDIR}/required-distro-features.inc
+
+DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0"
+DEPENDS += "wayland wayland-protocols libinput virtual/egl pango wayland-native"
+
+LDFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'lto', '-Wl,-z,undefs', '', d)}"
+
+WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}"
+
+EXTRA_OEMESON += "-Dpipewire=false"
+
+PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms wayland egl clients', '', d)} \
+ ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \
+ ${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)} \
+ ${@bb.utils.contains_any('DISTRO_FEATURES', 'wayland x11', '', 'headless', d)} \
+ ${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'sysvinit', 'launcher-libseat', '', d)} \
+ image-jpeg \
+ screenshare \
+ shell-desktop \
+ shell-fullscreen \
+ shell-ivi"
+
+# Can be 'damage', 'im', 'egl', 'shm', 'touch', 'dmabuf-feedback', 'dmabuf-v4l', 'dmabuf-egl' or 'all'
+SIMPLECLIENTS ?= "all"
+
+#
+# Compositor choices
+#
+# Weston on KMS
+PACKAGECONFIG[kms] = "-Dbackend-drm=true,-Dbackend-drm=false,drm udev virtual/egl virtual/libgles2 virtual/libgbm mtdev"
+# Weston on Wayland (nested Weston)
+PACKAGECONFIG[wayland] = "-Dbackend-wayland=true,-Dbackend-wayland=false,virtual/egl virtual/libgles2"
+# Weston on X11
+PACKAGECONFIG[x11] = "-Dbackend-x11=true,-Dbackend-x11=false,virtual/libx11 libxcb libxcb libxcursor cairo"
+# Headless Weston
+PACKAGECONFIG[headless] = "-Dbackend-headless=true,-Dbackend-headless=false"
+# Weston on RDP
+PACKAGECONFIG[rdp] = "-Dbackend-rdp=true,-Dbackend-rdp=false,freerdp"
+# VA-API desktop recorder
+PACKAGECONFIG[vaapi] = "-Dbackend-drm-screencast-vaapi=true,-Dbackend-drm-screencast-vaapi=false,libva"
+# Weston with EGL support
+PACKAGECONFIG[egl] = "-Drenderer-gl=true,-Drenderer-gl=false,virtual/egl"
+# Weston with lcms support
+PACKAGECONFIG[lcms] = "-Dcolor-management-lcms=true,-Dcolor-management-lcms=false,lcms"
+# Weston with webp support
+PACKAGECONFIG[webp] = "-Dimage-webp=true,-Dimage-webp=false,libwebp"
+# Weston with systemd-login support
+PACKAGECONFIG[systemd] = "-Dsystemd=true -Dlauncher-logind=true,-Dsystemd=false -Dlauncher-logind=false,systemd dbus"
+# Weston with Xwayland support (requires X11 and Wayland)
+PACKAGECONFIG[xwayland] = "-Dxwayland=true,-Dxwayland=false"
+# colord CMS support
+PACKAGECONFIG[colord] = "-Ddeprecated-color-management-colord=true,-Ddeprecated-color-management-colord=false,colord"
+# Clients support
+PACKAGECONFIG[clients] = "-Dsimple-clients=${SIMPLECLIENTS} -Ddemo-clients=true,-Dsimple-clients= -Ddemo-clients=false"
+# Virtual remote output with GStreamer on DRM backend
+PACKAGECONFIG[remoting] = "-Dremoting=true,-Dremoting=false,gstreamer1.0 gstreamer1.0-plugins-base"
+# Weston with screen-share support
+PACKAGECONFIG[screenshare] = "-Dscreenshare=true,-Dscreenshare=false"
+# Traditional desktop shell
+PACKAGECONFIG[shell-desktop] = "-Dshell-desktop=true,-Dshell-desktop=false"
+# Fullscreen shell
+PACKAGECONFIG[shell-fullscreen] = "-Dshell-fullscreen=true,-Dshell-fullscreen=false"
+# In-Vehicle Infotainment (IVI) shell
+PACKAGECONFIG[shell-ivi] = "-Dshell-ivi=true,-Dshell-ivi=false"
+# JPEG image loading support
+PACKAGECONFIG[image-jpeg] = "-Dimage-jpeg=true,-Dimage-jpeg=false, jpeg"
+# support libseat based launch
+PACKAGECONFIG[launcher-libseat] = "-Dlauncher-libseat=true,-Dlauncher-libseat=false,seatd"
+
+do_install:append() {
+ # Weston doesn't need the .la files to load modules, so wipe them
+ rm -f ${D}/${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.la
+
+ # If X11, ship a desktop file to launch it
+ if [ "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" ]; then
+ install -d ${D}${datadir}/applications
+ install ${WORKDIR}/weston.desktop ${D}${datadir}/applications
+
+ install -d ${D}${datadir}/icons/hicolor/48x48/apps
+ install ${WORKDIR}/weston.png ${D}${datadir}/icons/hicolor/48x48/apps
+ fi
+
+ if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "yes" ]; then
+ install -Dm 644 ${WORKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland
+ fi
+
+ if [ "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'yes', 'no', d)}" = "yes" ]; then
+ install -Dm 644 ${WORKDIR}/systemd-notify.weston-start ${D}${datadir}/weston-start/systemd-notify
+ fi
+
+ if [ "${@bb.utils.contains('PACKAGECONFIG', 'launch', 'yes', 'no', d)}" = "yes" ]; then
+ chmod u+s ${D}${bindir}/weston-launch
+ fi
+}
+
+PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', '${PN}-xwayland', '', d)} \
+ libweston-${WESTON_MAJOR_VERSION} ${PN}-examples"
+
+FILES:${PN}-dev += "${libdir}/${BPN}/libexec_weston.so"
+FILES:${PN} = "${bindir}/weston ${bindir}/weston-terminal ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode ${libexecdir} ${libdir}/${BPN}/*.so* ${datadir}"
+
+FILES:libweston-${WESTON_MAJOR_VERSION} = "${libdir}/lib*${SOLIBS} ${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.so"
+SUMMARY:libweston-${WESTON_MAJOR_VERSION} = "Helper library for implementing 'wayland window managers'."
+
+FILES:${PN}-examples = "${bindir}/*"
+
+FILES:${PN}-xwayland = "${libdir}/libweston-${WESTON_MAJOR_VERSION}/xwayland.so"
+RDEPENDS:${PN}-xwayland += "xwayland"
+
+RDEPENDS:${PN} += "xkeyboard-config"
+RRECOMMENDS:${PN} = "weston-init liberation-fonts"
+RRECOMMENDS:${PN}-dev += "wayland-protocols"
+
+USERADD_PACKAGES = "${PN}"
+GROUPADD_PARAM:${PN} = "--system weston-launch"