diff options
Diffstat (limited to 'meta/recipes-graphics/wayland')
34 files changed, 614 insertions, 1197 deletions
diff --git a/meta/recipes-graphics/wayland/libinput/0001-adjust-for-64bit-time_t-for-32bit-architectures.patch b/meta/recipes-graphics/wayland/libinput/0001-adjust-for-64bit-time_t-for-32bit-architectures.patch deleted file mode 100644 index 344e6aaf8f..0000000000 --- a/meta/recipes-graphics/wayland/libinput/0001-adjust-for-64bit-time_t-for-32bit-architectures.patch +++ /dev/null @@ -1,386 +0,0 @@ -From ab6ce09bfb669177c90cc5c10155eec44e9fc34b Mon Sep 17 00:00:00 2001 -From: Peter Hutterer <peter.hutterer@who-t.net> -Date: Sat, 23 Nov 2019 17:23:56 -0800 -Subject: [PATCH] Adjust for 64bit time_t for 32bit architectures - -Upstream-Status: Submitted [https://gitlab.freedesktop.org/libinput/libinput/merge_requests/346] -Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> ---- - meson.build | 1 + - src/evdev-mt-touchpad-buttons.c | 15 ++++--- - src/evdev.c | 5 ++- - src/util-input-event.h | 69 +++++++++++++++++++++++++++++++++ - tools/libinput-record.c | 16 +++++--- - 5 files changed, 90 insertions(+), 16 deletions(-) - create mode 100644 src/util-input-event.h - ---- a/meson.build -+++ b/meson.build -@@ -220,7 +220,8 @@ endif - ############ libinput-util.a ############ - src_libinput_util = [ - 'src/libinput-util.c', -- 'src/libinput-util.h' -+ 'src/libinput-util.h', -+ 'src/util-input-event.h' - ] - libinput_util = static_library('libinput-util', - src_libinput_util, ---- a/src/evdev-mt-touchpad-buttons.c -+++ b/src/evdev-mt-touchpad-buttons.c -@@ -30,6 +30,7 @@ - #include <unistd.h> - #include "linux/input.h" - -+#include "util-input-event.h" - #include "evdev-mt-touchpad.h" - - #define DEFAULT_BUTTON_ENTER_TIMEOUT ms2us(100) -@@ -1145,14 +1146,12 @@ tp_notify_clickpadbutton(struct tp_dispa - if (tp->buttons.trackpoint) { - if (is_topbutton) { - struct evdev_dispatch *dispatch = tp->buttons.trackpoint->dispatch; -- struct input_event event; -- struct input_event syn_report = {{ 0, 0 }, EV_SYN, SYN_REPORT, 0 }; -+ struct input_event event, syn_report; -+ int value; - -- event.time = us2tv(time); -- event.type = EV_KEY; -- event.code = button; -- event.value = (state == LIBINPUT_BUTTON_STATE_PRESSED) ? 1 : 0; -- syn_report.time = event.time; -+ value = (state == LIBINPUT_BUTTON_STATE_PRESSED) ? 1 : 0; -+ event = input_event_init(time, EV_KEY, button, value); -+ syn_report = input_event_init(time, EV_SYN, SYN_REPORT, 0); - dispatch->interface->process(dispatch, - tp->buttons.trackpoint, - &event, ---- a/src/evdev.c -+++ b/src/evdev.c -@@ -44,6 +44,7 @@ - #include "filter.h" - #include "libinput-private.h" - #include "quirks.h" -+#include "util-input-event.h" - - #if HAVE_LIBWACOM - #include <libwacom/libwacom.h> -@@ -859,7 +860,7 @@ evdev_print_event(struct evdev_device *d - { - static uint32_t offset = 0; - static uint32_t last_time = 0; -- uint32_t time = us2ms(tv2us(&e->time)); -+ uint32_t time = us2ms(input_event_time(e)); - - if (offset == 0) { - offset = time; -@@ -891,7 +892,7 @@ static inline void - evdev_process_event(struct evdev_device *device, struct input_event *e) - { - struct evdev_dispatch *dispatch = device->dispatch; -- uint64_t time = tv2us(&e->time); -+ uint64_t time = input_event_time(e); - - #if 0 - evdev_print_event(device, e); ---- /dev/null -+++ b/src/util-input-event.h -@@ -0,0 +1,69 @@ -+/* -+ * Copyright © 2019 Red Hat, Inc. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the next -+ * paragraph) shall be included in all copies or substantial portions of the -+ * Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -+ * DEALINGS IN THE SOFTWARE. -+ */ -+ -+#pragma once -+ -+#include "config.h" -+ -+#include "util-time.h" -+#include <linux/input.h> -+ -+static inline struct input_event -+input_event_init(uint64_t time, -+ unsigned int code, -+ unsigned int type, -+ int value) -+{ -+ struct input_event ev; -+ struct timeval tval = us2tv(time); -+ -+ ev.input_event_sec = tval.tv_sec; -+ ev.input_event_usec = tval.tv_usec; -+ ev.type = type; -+ ev.code = code; -+ ev.value = value; -+ -+ return ev; -+} -+ -+static inline uint64_t -+input_event_time(const struct input_event *e) -+{ -+ struct timeval tval; -+ -+ tval.tv_sec = e->input_event_sec; -+ tval.tv_usec = e->input_event_usec; -+ -+ return tv2us(&tval); -+} -+ -+ -+static inline void -+input_event_set_time(struct input_event *e, -+ uint64_t time) -+{ -+ struct timeval tval = us2tv(time); -+ -+ e->input_event_sec = tval.tv_sec; -+ e->input_event_usec = tval.tv_usec; -+} ---- a/tools/libinput-record.c -+++ b/tools/libinput-record.c -@@ -41,6 +41,7 @@ - #include <stdbool.h> - - #include "libinput-versionsort.h" -+#include "util-input-event.h" - #include "libinput-util.h" - #include "libinput-version.h" - #include "libinput-git-version.h" -@@ -196,8 +197,9 @@ print_evdev_event(struct record_context - const char *cname; - bool was_modified = false; - char desc[1024]; -+ uint64_t time = input_event_time(ev) - ctx->offset; - -- ev->time = us2tv(tv2us(&ev->time) - ctx->offset); -+ input_event_set_time(ev, time); - - /* Don't leak passwords unless the user wants to */ - if (!ctx->show_keycodes) -@@ -215,7 +217,7 @@ print_evdev_event(struct record_context - static unsigned long last_ms = 0; - unsigned long time, dt; - -- time = us2ms(tv2us(&ev->time)); -+ time = us2ms(input_event_time(ev)); - dt = time - last_ms; - last_ms = time; - -@@ -239,8 +241,8 @@ print_evdev_event(struct record_context - - iprintf(ctx, - "- [%3lu, %6u, %3d, %3d, %6d] # %s\n", -- ev->time.tv_sec, -- (unsigned int)ev->time.tv_usec, -+ ev->input_event_sec, -+ (unsigned int)ev->input_event_usec, - ev->type, - ev->code, - ev->value, -@@ -268,16 +270,18 @@ handle_evdev_frame(struct record_context - while (libevdev_next_event(evdev, - LIBEVDEV_READ_FLAG_NORMAL, - &e) == LIBEVDEV_READ_STATUS_SUCCESS) { -+ uint64_t time; - - if (ctx->offset == 0) -- ctx->offset = tv2us(&e.time); -+ ctx->offset = input_event_time(&e); - - if (d->nevents == d->events_sz) - resize(d->events, d->events_sz); - - event = &d->events[d->nevents++]; - event->type = EVDEV; -- event->time = tv2us(&e.time) - ctx->offset; -+ time = input_event_time(&e); -+ input_event_set_time(&e, time - ctx->offset); - event->u.evdev = e; - count++; - ---- a/src/libinput-private.h -+++ b/src/libinput-private.h -@@ -39,6 +39,7 @@ - - #include "libinput.h" - #include "libinput-util.h" -+#include "util-time.h" - #include "libinput-version.h" - - #if LIBINPUT_VERSION_MICRO >= 90 ---- a/src/libinput-util.h -+++ b/src/libinput-util.h -@@ -206,12 +206,6 @@ clear_bit(unsigned char *array, int bit) - array[bit / 8] &= ~(1 << (bit % 8)); - } - --static inline void --msleep(unsigned int ms) --{ -- usleep(ms * 1000); --} -- - static inline bool - long_bit_is_set(const unsigned long *array, int bit) - { -@@ -453,53 +447,6 @@ bool - parse_switch_reliability_property(const char *prop, - enum switch_reliability *reliability); - --static inline uint64_t --us(uint64_t us) --{ -- return us; --} -- --static inline uint64_t --ns2us(uint64_t ns) --{ -- return us(ns / 1000); --} -- --static inline uint64_t --ms2us(uint64_t ms) --{ -- return us(ms * 1000); --} -- --static inline uint64_t --s2us(uint64_t s) --{ -- return ms2us(s * 1000); --} -- --static inline uint32_t --us2ms(uint64_t us) --{ -- return (uint32_t)(us / 1000); --} -- --static inline uint64_t --tv2us(const struct timeval *tv) --{ -- return s2us(tv->tv_sec) + tv->tv_usec; --} -- --static inline struct timeval --us2tv(uint64_t time) --{ -- struct timeval tv; -- -- tv.tv_sec = time / ms2us(1000); -- tv.tv_usec = time % ms2us(1000); -- -- return tv; --} -- - static inline bool - safe_atoi_base(const char *str, int *val, int base) - { ---- /dev/null -+++ b/src/util-time.h -@@ -0,0 +1,84 @@ -+/* -+ * Copyright © 2013-2019 Red Hat, Inc. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the "Software"), -+ * to deal in the Software without restriction, including without limitation -+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, -+ * and/or sell copies of the Software, and to permit persons to whom the -+ * Software is furnished to do so, subject to the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the next -+ * paragraph) shall be included in all copies or substantial portions of the -+ * Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -+ * DEALINGS IN THE SOFTWARE. -+ */ -+ -+#pragma once -+ -+#include "config.h" -+ -+#include <time.h> -+#include <stdint.h> -+#include <unistd.h> -+#include <linux/input.h> -+ -+static inline void -+msleep(unsigned int ms) -+{ -+ usleep(ms * 1000); -+} -+ -+static inline uint64_t -+us(uint64_t us) -+{ -+ return us; -+} -+ -+static inline uint64_t -+ns2us(uint64_t ns) -+{ -+ return us(ns / 1000); -+} -+ -+static inline uint64_t -+ms2us(uint64_t ms) -+{ -+ return us(ms * 1000); -+} -+ -+static inline uint64_t -+s2us(uint64_t s) -+{ -+ return ms2us(s * 1000); -+} -+ -+static inline uint32_t -+us2ms(uint64_t us) -+{ -+ return (uint32_t)(us / 1000); -+} -+ -+static inline uint64_t -+tv2us(const struct timeval *tv) -+{ -+ return s2us(tv->tv_sec) + tv->tv_usec; -+} -+ -+static inline struct timeval -+us2tv(uint64_t time) -+{ -+ struct timeval tv; -+ -+ tv.tv_sec = time / ms2us(1000); -+ tv.tv_usec = time % ms2us(1000); -+ -+ return tv; -+} 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_1.14.3.bb b/meta/recipes-graphics/wayland/libinput_1.26.1.bb index 46d46c54ee..487270505a 100644 --- a/meta/recipes-graphics/wayland/libinput_1.14.3.bb +++ b/meta/recipes-graphics/wayland/libinput_1.26.1.bb @@ -8,32 +8,42 @@ HOMEPAGE = "http://www.freedesktop.org/wiki/Software/libinput/" SECTION = "libs" LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://COPYING;md5=1f2ea9ebff3a2c6d458faf58492efb63" +LIC_FILES_CHKSUM = "file://COPYING;md5=bab4ac7dc1c10bc0fb037dc76c46ef8a" DEPENDS = "libevdev udev mtdev" -SRC_URI = "http://www.freedesktop.org/software/${BPN}/${BP}.tar.xz \ - file://0001-adjust-for-64bit-time_t-for-32bit-architectures.patch \ -" -SRC_URI[md5sum] = "d052faa64eb6d2e649e582cc0fcf6e32" -SRC_URI[sha256sum] = "0feb3a0589709cc1032893bfaf4c49150d5360bd9782bec888f9e4dd9044c5b7" +SRC_URI = "git://gitlab.freedesktop.org/libinput/libinput.git;protocol=https;branch=main \ + file://run-ptest \ + " +SRCREV = "124431a5d3186e1c3c3aa144a0634b84b3089486" +S = "${WORKDIR}/git" UPSTREAM_CHECK_REGEX = "libinput-(?P<pver>\d+\.\d+\.(?!9\d+)\d+)" -inherit meson pkgconfig lib_package +inherit meson pkgconfig lib_package ptest -PACKAGECONFIG ??= "" +# 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 ??= "${@bb.utils.contains('PTEST_ENABLED', '1', 'tests', '', d)}" PACKAGECONFIG[libwacom] = "-Dlibwacom=true,-Dlibwacom=false,libwacom" -PACKAGECONFIG[gui] = "-Ddebug-gui=true,-Ddebug-gui=false,cairo gtk+3" +PACKAGECONFIG[gui] = "-Ddebug-gui=true,-Ddebug-gui=false,cairo gtk+3 wayland-native" +PACKAGECONFIG[tests] = "-Dtests=true -Dinstall-tests=true,-Dtests=false -Dinstall-tests=false,libcheck" UDEVDIR = "`pkg-config --variable=udevdir udev`" EXTRA_OEMESON += "-Dudev-dir=${UDEVDIR} \ -Ddocumentation=false \ - -Dtests=false \ -Dzshcompletiondir=no" # package name changed in 1.8.1 upgrade: make sure package upgrades work -RPROVIDES_${PN} = "libinput" -RREPLACES_${PN} = "libinput" -RCONFLICTS_${PN} = "libinput" +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/0001-adjust-for-64bit-time_t-for-32bit-architectures.patch b/meta/recipes-graphics/wayland/mtdev/0001-adjust-for-64bit-time_t-for-32bit-architectures.patch deleted file mode 100644 index a0cebe5283..0000000000 --- a/meta/recipes-graphics/wayland/mtdev/0001-adjust-for-64bit-time_t-for-32bit-architectures.patch +++ /dev/null @@ -1,77 +0,0 @@ -From af75e8ee3d12a493b758421b2feed0351fdcbbf0 Mon Sep 17 00:00:00 2001 -From: Khem Raj <raj.khem@gmail.com> -Date: Sat, 23 Nov 2019 13:44:32 -0800 -Subject: [PATCH] adjust for 64bit time_t for 32bit architectures - -libc that has support for 32 bit applications to use 64 bit -time_t supplies __USE_TIME_BITS64 define [1] - -[1] https://sourceware.org/glibc/wiki/Y2038ProofnessDesign - -Upstream-Status: Pending - -Signed-off-by: Khem Raj <raj.khem@gmail.com> ---- - src/core.c | 8 +++++++- - test/mtdev-test.c | 10 ++++++++-- - 2 files changed, 15 insertions(+), 3 deletions(-) - -diff --git a/src/core.c b/src/core.c -index 87ef420..0d91c0b 100644 ---- a/src/core.c -+++ b/src/core.c -@@ -31,6 +31,11 @@ - #include "evbuf.h" - #include "match.h" - -+#ifndef input_event_sec -+#define input_event_sec time.tv_sec -+#define input_event_usec time.tv_usec -+#endif -+ - static inline int istouch(const struct mtdev_slot *data, - const struct mtdev *dev) - { -@@ -251,7 +256,8 @@ static void push_slot_changes(struct mtdev_state *state, - count++; - if (!count) - return; -- ev.time = syn->time; -+ ev.input_event_sec = syn->input_event_sec; -+ ev.input_event_usec = syn->input_event_usec; - ev.type = EV_ABS; - ev.code = ABS_MT_SLOT; - ev.value = slot; -diff --git a/test/mtdev-test.c b/test/mtdev-test.c -index 1b3e4f2..773f86a 100644 ---- a/test/mtdev-test.c -+++ b/test/mtdev-test.c -@@ -30,9 +30,15 @@ - #include <stdio.h> - #include <unistd.h> - #include <fcntl.h> -+#include <stdint.h> -+ -+#ifndef input_event_sec -+#define input_event_sec time.tv_sec -+#define input_event_usec time.tv_usec -+#endif - - /* year-proof millisecond event time */ --typedef __u64 mstime_t; -+typedef uint64_t mstime_t; - - static int use_event(const struct input_event *ev) - { -@@ -47,7 +53,7 @@ static void print_event(const struct input_event *ev) - { - static const mstime_t ms = 1000; - static int slot; -- mstime_t evtime = ev->time.tv_usec / ms + ev->time.tv_sec * ms; -+ mstime_t evtime = ev->input_event_usec / ms + ev->input_event_sec * ms; - if (ev->type == EV_ABS && ev->code == ABS_MT_SLOT) - slot = ev->value; - fprintf(stderr, "%012llx %02d %01d %04x %d\n", --- -2.24.0 - diff --git a/meta/recipes-graphics/wayland/mtdev_1.1.5.bb b/meta/recipes-graphics/wayland/mtdev_1.1.7.bb index aa8bb69966..24803c4238 100644 --- a/meta/recipes-graphics/wayland/mtdev_1.1.5.bb +++ b/meta/recipes-graphics/wayland/mtdev_1.1.7.bb @@ -11,10 +11,7 @@ SECTION = "libs" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://COPYING;md5=ea6bd0268bb0fcd6b27698616ceee5d6" -SRC_URI = "http://bitmath.org/code/${BPN}/${BP}.tar.bz2 \ - file://0001-adjust-for-64bit-time_t-for-32bit-architectures.patch \ -" -SRC_URI[md5sum] = "52c9610b6002f71d1642dc1a1cca5ec1" -SRC_URI[sha256sum] = "6677d5708a7948840de734d8b4675d5980d4561171c5a8e89e54adf7a13eba7f" +SRC_URI = "http://bitmath.org/code/${BPN}/${BP}.tar.bz2" +SRC_URI[sha256sum] = "a107adad2101fecac54ac7f9f0e0a0dd155d954193da55c2340c97f2ff1d814e" 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.18.bb b/meta/recipes-graphics/wayland/wayland-protocols_1.37.bb index c8bec66a40..2bf59b9719 100644 --- a/meta/recipes-graphics/wayland/wayland-protocols_1.18.bb +++ b/meta/recipes-graphics/wayland/wayland-protocols_1.37.bb @@ -9,14 +9,18 @@ LICENSE = "MIT" LIC_FILES_CHKSUM = "file://COPYING;md5=c7b12b6702da38ca028ace54aae3d484 \ file://stable/presentation-time/presentation-time.xml;endline=26;md5=4646cd7d9edc9fa55db941f2d3a7dc53" -SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ - " -SRC_URI[md5sum] = "af38f22d8e233c2f2e00ddc8dcc94694" -SRC_URI[sha256sum] = "3d73b7e7661763dc09d7d9107678400101ecff2b5b1e531674abfa81e04874b3" +SRC_URI = "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/${PV}/downloads/wayland-protocols-${PV}.tar.xz" +SRC_URI[sha256sum] = "a70e9be924f2e8688e6824dceaf6188faacd5ae218dfac8d0a3d0976211ef326" -UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html" +UPSTREAM_CHECK_URI = "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/tags" +UPSTREAM_CHECK_REGEX = "releases/(?P<pver>.+)" -inherit allarch autotools pkgconfig +inherit meson pkgconfig allarch + +EXTRA_OEMESON += "-Dtests=false" PACKAGES = "${PN}" -FILES_${PN} += "${datadir}/pkgconfig/wayland-protocols.pc" +FILES:${PN} += "${datadir}/pkgconfig/wayland-protocols.pc" + +BBCLASSEXTEND = "native nativesdk" + diff --git a/meta/recipes-graphics/wayland/wayland-utils_1.2.0.bb b/meta/recipes-graphics/wayland/wayland-utils_1.2.0.bb new file mode 100644 index 0000000000..59d414a0a6 --- /dev/null +++ b/meta/recipes-graphics/wayland/wayland-utils_1.2.0.bb @@ -0,0 +1,23 @@ +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" +SRC_URI[sha256sum] = "d9278c22554586881802540751bcc42569262bf80cd9ac9b0fd12ff4bd09a9e4" + +UPSTREAM_CHECK_URI = "https://gitlab.freedesktop.org/wayland/wayland-utils/-/tags" +UPSTREAM_CHECK_REGEX = "releases/(?P<pver>.+)" + +inherit meson pkgconfig + +DEPENDS += "wayland wayland-native wayland-protocols" + +PACKAGECONFIG ??= "drm" +PACKAGECONFIG[drm] = "-Ddrm=enabled,-Ddrm=disabled,libdrm" 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..c6ddf8a1f9 --- /dev/null +++ b/meta/recipes-graphics/wayland/wayland/0001-build-Fix-strndup-detection-on-MinGW.patch @@ -0,0 +1,38 @@ +From a90bfa622f7323074c715674b368cba80bc7d196 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 8e28f2a..b56ba91 100644 +--- a/meson.build ++++ b/meson.build +@@ -45,11 +45,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' diff --git a/meta/recipes-graphics/wayland/wayland/0001-scanner-Add-configure-check-for-strndup.patch b/meta/recipes-graphics/wayland/wayland/0001-scanner-Add-configure-check-for-strndup.patch deleted file mode 100644 index c4435875ad..0000000000 --- a/meta/recipes-graphics/wayland/wayland/0001-scanner-Add-configure-check-for-strndup.patch +++ /dev/null @@ -1,50 +0,0 @@ -From 3c8b4467a1ca229e72fb5223787ed400a19c65c0 Mon Sep 17 00:00:00 2001 -From: Joshua Watt <JPEWhacker@gmail.com> -Date: Fri, 25 Oct 2019 21:03:23 -0500 -Subject: [PATCH] scanner: Add configure check for strndup - -Some platforms may not have strndup() (e.g. MinGW), so provide a -equivalent implementation if it's not found. - -Upstream-Status: Accepted [4a1f348c20157db7bd7c759fdeb23fbe8729c571] -Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> ---- - configure.ac | 2 +- - src/scanner.c | 11 +++++++++++ - 2 files changed, 12 insertions(+), 1 deletion(-) - -diff --git a/configure.ac b/configure.ac -index 8d56f2b..1c99e21 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -63,7 +63,7 @@ fi - AC_SUBST(GCC_CFLAGS) - - AC_CHECK_HEADERS([sys/prctl.h]) --AC_CHECK_FUNCS([accept4 mkostemp posix_fallocate prctl]) -+AC_CHECK_FUNCS([accept4 mkostemp posix_fallocate prctl strndup]) - - AC_ARG_ENABLE([libraries], - [AC_HELP_STRING([--disable-libraries], -diff --git a/src/scanner.c b/src/scanner.c -index a94be5d..27004bc 100644 ---- a/src/scanner.c -+++ b/src/scanner.c -@@ -916,6 +916,17 @@ verify_arguments(struct parse_context *ctx, - - } - -+#ifndef HAVE_STRNDUP -+char * -+strndup(const char *s, size_t size) -+{ -+ char *r = malloc(size + 1); -+ strncpy(r, s, size); -+ r[size] = '\0'; -+ return r; -+} -+#endif -+ - static void - end_element(void *data, const XML_Char *name) - { diff --git a/meta/recipes-graphics/wayland/wayland/0002-Move-wl_priv_signal-to-wayland-server-private.h.patch b/meta/recipes-graphics/wayland/wayland/0002-Move-wl_priv_signal-to-wayland-server-private.h.patch deleted file mode 100644 index b05b875abb..0000000000 --- a/meta/recipes-graphics/wayland/wayland/0002-Move-wl_priv_signal-to-wayland-server-private.h.patch +++ /dev/null @@ -1,166 +0,0 @@ -From e746f3bf7c8bb2f5dcf9e93edffc23b56eff12d0 Mon Sep 17 00:00:00 2001 -From: Joshua Watt <JPEWhacker@gmail.com> -Date: Tue, 5 Nov 2019 09:09:50 -0600 -Subject: [PATCH] Move wl_priv_signal to wayland-server-private.h - -Including wayland-server-core.h in wayland-private.h is problematic -because wayland-private.h is included by wayland-scanner which should be -able to build against non-POSIX platforms (e.g. MinGW). The only reason -that wayland-server-core.h was included in wayland-private.h was for the -wl_private_signal definitions, so move those to a -wayland-server-private.h file that can be included by both -wayland-server.c and the tests. - -Upstream-Status: Accepted [e7d88f35eb89cf0cc77cbddd834cacc63683a9cc] -Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> ---- - Makefile.am | 3 +- - src/wayland-private.h | 22 +-------------- - src/wayland-server-private.h | 53 ++++++++++++++++++++++++++++++++++++ - src/wayland-server.c | 1 + - tests/newsignal-test.c | 2 +- - 5 files changed, 58 insertions(+), 23 deletions(-) - create mode 100644 src/wayland-server-private.h - -diff --git a/Makefile.am b/Makefile.am -index f47d055..026d981 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -56,7 +56,8 @@ libwayland_private_la_SOURCES = \ - src/connection.c \ - src/wayland-os.c \ - src/wayland-os.h \ -- src/wayland-private.h -+ src/wayland-private.h \ -+ src/wayland-server-private.h - - include_HEADERS = \ - src/wayland-util.h \ -diff --git a/src/wayland-private.h b/src/wayland-private.h -index 29516ec..dc7d12f 100644 ---- a/src/wayland-private.h -+++ b/src/wayland-private.h -@@ -31,11 +31,11 @@ - #include <stdarg.h> - #include <stdlib.h> - #include <stdint.h> -+#include <stdbool.h> - - #define WL_HIDE_DEPRECATED 1 - - #include "wayland-util.h" --#include "wayland-server-core.h" - - /* Invalid memory address */ - #define WL_ARRAY_POISON_PTR (void *) 4 -@@ -236,26 +236,6 @@ zalloc(size_t s) - return calloc(1, s); - } - --struct wl_priv_signal { -- struct wl_list listener_list; -- struct wl_list emit_list; --}; -- --void --wl_priv_signal_init(struct wl_priv_signal *signal); -- --void --wl_priv_signal_add(struct wl_priv_signal *signal, struct wl_listener *listener); -- --struct wl_listener * --wl_priv_signal_get(struct wl_priv_signal *signal, wl_notify_func_t notify); -- --void --wl_priv_signal_emit(struct wl_priv_signal *signal, void *data); -- --void --wl_priv_signal_final_emit(struct wl_priv_signal *signal, void *data); -- - void - wl_connection_close_fds_in(struct wl_connection *connection, int max); - -diff --git a/src/wayland-server-private.h b/src/wayland-server-private.h -new file mode 100644 -index 0000000..23fa458 ---- /dev/null -+++ b/src/wayland-server-private.h -@@ -0,0 +1,53 @@ -+/* -+ * Copyright © 2008-2011 Kristian Høgsberg -+ * Copyright © 2011 Intel Corporation -+ * Copyright © 2013 Jason Ekstrand -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining -+ * a copy of this software and associated documentation files (the -+ * "Software"), to deal in the Software without restriction, including -+ * without limitation the rights to use, copy, modify, merge, publish, -+ * distribute, sublicense, and/or sell copies of the Software, and to -+ * permit persons to whom the Software is furnished to do so, subject to -+ * the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the -+ * next paragraph) shall be included in all copies or substantial -+ * portions of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -+ * SOFTWARE. -+ */ -+ -+#ifndef WAYLAND_SERVER_PRIVATE_H -+#define WAYLAND_SERVER_PRIVATE_H -+ -+#include "wayland-server-core.h" -+ -+struct wl_priv_signal { -+ struct wl_list listener_list; -+ struct wl_list emit_list; -+}; -+ -+void -+wl_priv_signal_init(struct wl_priv_signal *signal); -+ -+void -+wl_priv_signal_add(struct wl_priv_signal *signal, struct wl_listener *listener); -+ -+struct wl_listener * -+wl_priv_signal_get(struct wl_priv_signal *signal, wl_notify_func_t notify); -+ -+void -+wl_priv_signal_emit(struct wl_priv_signal *signal, void *data); -+ -+void -+wl_priv_signal_final_emit(struct wl_priv_signal *signal, void *data); -+ -+#endif -diff --git a/src/wayland-server.c b/src/wayland-server.c -index 19f6a76..d6f0206 100644 ---- a/src/wayland-server.c -+++ b/src/wayland-server.c -@@ -45,6 +45,7 @@ - - #include "wayland-util.h" - #include "wayland-private.h" -+#include "wayland-server-private.h" - #include "wayland-server.h" - #include "wayland-os.h" - -diff --git a/tests/newsignal-test.c b/tests/newsignal-test.c -index 47c429b..f3a7bd9 100644 ---- a/tests/newsignal-test.c -+++ b/tests/newsignal-test.c -@@ -26,7 +26,7 @@ - #include <assert.h> - - #include "test-runner.h" --#include "wayland-private.h" -+#include "wayland-server-private.h" - - static void - signal_notify(struct wl_listener *listener, void *data) diff --git a/meta/recipes-graphics/wayland/wayland/fixpathinpcfiles.patch b/meta/recipes-graphics/wayland/wayland/fixpathinpcfiles.patch deleted file mode 100644 index ad3526d984..0000000000 --- a/meta/recipes-graphics/wayland/wayland/fixpathinpcfiles.patch +++ /dev/null @@ -1,32 +0,0 @@ -Fix wayland-client and wayland-scanner pc files - -Upstream-Status: Pending - -Signed-off-by: Fabien Lahoudere <fabien.lahoudere@collabora.co.uk> - -Index: wayland-1.14.0/src/wayland-client.pc.in -=================================================================== ---- wayland-1.14.0.orig/src/wayland-client.pc.in -+++ wayland-1.14.0/src/wayland-client.pc.in -@@ -1,7 +1,7 @@ - prefix=@prefix@ - exec_prefix=@exec_prefix@ - datarootdir=@datarootdir@ --pkgdatadir=@datadir@/@PACKAGE@ -+pkgdatadir=${pc_sysrootdir}@datadir@/@PACKAGE@ - libdir=@libdir@ - includedir=@includedir@ - -Index: wayland-1.14.0/src/wayland-scanner.pc.in -=================================================================== ---- wayland-1.14.0.orig/src/wayland-scanner.pc.in -+++ wayland-1.14.0/src/wayland-scanner.pc.in -@@ -2,7 +2,7 @@ prefix=@prefix@ - exec_prefix=@exec_prefix@ - datarootdir=@datarootdir@ - pkgdatadir=@datadir@/@PACKAGE@ --wayland_scanner=@bindir@/wayland-scanner -+wayland_scanner=wayland-scanner - - Name: Wayland Scanner - Description: Wayland scanner 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.17.0.bb b/meta/recipes-graphics/wayland/wayland_1.17.0.bb deleted file mode 100644 index 12916a0c40..0000000000 --- a/meta/recipes-graphics/wayland/wayland_1.17.0.bb +++ /dev/null @@ -1,49 +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=b31d8f53b6aaf2b4985d7dd7810a70d1 \ - file://src/wayland-server.c;endline=24;md5=b8e046164a766bb1ede8ba38e9dcd7ce" - -DEPENDS = "expat libffi wayland-native" - -SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ - file://fixpathinpcfiles.patch \ - file://0001-scanner-Add-configure-check-for-strndup.patch \ - file://0002-Move-wl_priv_signal-to-wayland-server-private.h.patch \ - " -SRC_URI[md5sum] = "d91f970aea11fd549eae023d06f91af3" -SRC_URI[sha256sum] = "72aa11b8ac6e22f4777302c9251e8fec7655dc22f9d94ee676c6b276f95f91a4" - -UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html" - -inherit autotools pkgconfig - -PACKAGECONFIG ??= "dtd-validation" -PACKAGECONFIG[dtd-validation] = "--enable-dtd-validation,--disable-dtd-validation,libxml2,," - -EXTRA_OECONF = "--disable-documentation --with-host-scanner" -EXTRA_OECONF_class-native = "--disable-documentation --disable-libraries" - -# 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" - -BBCLASSEXTEND = "native nativesdk" diff --git a/meta/recipes-graphics/wayland/wayland_1.23.1.bb b/meta/recipes-graphics/wayland/wayland_1.23.1.bb new file mode 100644 index 0000000000..3a5d91be04 --- /dev/null +++ b/meta/recipes-graphics/wayland/wayland_1.23.1.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] = "864fb2a8399e2d0ec39d56e9d9b753c093775beadc6022ce81f441929a81e5ed" + +UPSTREAM_CHECK_URI = "https://gitlab.freedesktop.org/wayland/wayland/-/tags" +UPSTREAM_CHECK_REGEX = "releases/(?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/weston-init.bb b/meta/recipes-graphics/wayland/weston-init.bb index e3e739e2b7..3de697ec34 100644 --- a/meta/recipes-graphics/wayland/weston-init.bb +++ b/meta/recipes-graphics/wayland/weston-init.bb @@ -5,45 +5,103 @@ LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384 PACKAGE_ARCH = "${MACHINE_ARCH}" SRC_URI = "file://init \ + file://weston.env \ file://weston.ini \ - file://weston@.service \ - file://71-weston-drm.rules \ + file://weston.service \ + file://weston.socket \ + file://weston-socket.sh \ + file://weston-autologin \ file://weston-start" -S = "${WORKDIR}" +S = "${WORKDIR}/sources" +UNPACKDIR = "${S}" + +PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xwayland', '', d)}" +PACKAGECONFIG:append:qemuriscv64 = " use-pixman" +PACKAGECONFIG:append:qemuppc64 = " use-pixman" + +PACKAGECONFIG[xwayland] = ",," +PACKAGECONFIG[no-idle-timeout] = ",," +PACKAGECONFIG[use-pixman] = ",," + +DEFAULTBACKEND ??= "" +DEFAULTBACKEND:qemuall ?= "drm" do_install() { - install -Dm755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston - install -D -p -m0644 ${WORKDIR}/weston.ini ${D}${sysconfdir}/xdg/weston/weston.ini - - # Install Weston systemd service and accompanying udev rule - install -D -p -m0644 ${WORKDIR}/weston@.service ${D}${systemd_system_unitdir}/weston@.service - sed -i -e s:/etc:${sysconfdir}:g \ - -e s:/usr/bin:${bindir}:g \ - -e s:/var:${localstatedir}:g \ - ${D}${systemd_unitdir}/system/weston@.service - install -D -p -m0644 ${WORKDIR}/71-weston-drm.rules \ - ${D}${sysconfdir}/udev/rules.d/71-weston-drm.rules # 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 [ "${VIRTUAL-RUNTIME_init_manager}" != "systemd" ]; then + install -Dm755 ${S}/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 + install -Dm755 ${S}/init ${D}/${sysconfdir}/init.d/weston + sed -i 's#ROOTHOME#${ROOT_HOME}#' ${D}/${sysconfdir}/init.d/weston + fi + + # Install Weston systemd service + if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then + install -D -p -m0644 ${S}/weston.service ${D}${systemd_system_unitdir}/weston.service + install -D -p -m0644 ${S}/weston.socket ${D}${systemd_system_unitdir}/weston.socket + install -D -p -m0644 ${S}/weston-socket.sh ${D}${sysconfdir}/profile.d/weston-socket.sh + sed -i -e s:/etc:${sysconfdir}:g \ + -e s:/usr/bin:${bindir}:g \ + -e s:/var:${localstatedir}:g \ + ${D}${systemd_system_unitdir}/weston.service + fi + + if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then + install -D -p -m0644 ${S}/weston-autologin ${D}${sysconfdir}/pam.d/weston-autologin + fi + + install -D -p -m0644 ${S}/weston.ini ${D}${sysconfdir}/xdg/weston/weston.ini + install -Dm644 ${S}/weston.env ${D}${sysconfdir}/default/weston + + if [ -n "${DEFAULTBACKEND}" ]; then + sed -i -e "/^\[core\]/a backend=${DEFAULTBACKEND}-backend.so" ${D}${sysconfdir}/xdg/weston/weston.ini + fi + + if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', '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 update-rc.d features_check systemd +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 ${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'weston-xwayland', '', d)}" 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" +FILES:${PN} += "\ + ${sysconfdir}/xdg/weston/weston.ini \ + ${sysconfdir}/profile.d/weston-socket.sh \ + ${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" +CONFFILES:${PN} += "${sysconfdir}/xdg/weston/weston.ini ${sysconfdir}/default/weston" -SYSTEMD_SERVICE_${PN} = "weston@%i.service" -SYSTEMD_AUTO_ENABLE = "disable" +SYSTEMD_SERVICE:${PN} = "weston.service weston.socket" +USERADD_PARAM:${PN} = "--home /home/weston --shell /bin/sh --user-group -G video,input,render,wayland weston" +GROUPADD_PARAM:${PN} = "-r wayland; -r render" diff --git a/meta/recipes-graphics/wayland/weston-init/71-weston-drm.rules b/meta/recipes-graphics/wayland/weston-init/71-weston-drm.rules deleted file mode 100644 index 1a1b8bbda4..0000000000 --- a/meta/recipes-graphics/wayland/weston-init/71-weston-drm.rules +++ /dev/null @@ -1,2 +0,0 @@ -ACTION=="add", SUBSYSTEM=="graphics", KERNEL=="fb0", TAG+="systemd", ENV{SYSTEMD_WANTS}+="weston@root.service" -ACTION=="add", SUBSYSTEM=="drm", KERNEL=="card0", TAG+="systemd", ENV{SYSTEMD_WANTS}+="weston@root.service" diff --git a/meta/recipes-graphics/wayland/weston-init/init b/meta/recipes-graphics/wayland/weston-init/init index d3e87c6cef..a5c54e001e 100644 --- a/meta/recipes-graphics/wayland/weston-init/init +++ b/meta/recipes-graphics/wayland/weston-init/init @@ -30,8 +30,9 @@ done case "$1" in start) . /etc/profile + export HOME=ROOTHOME - weston-start -- $OPTARGS + WESTON_USER=weston weston-start $OPTARGS & ;; stop) diff --git a/meta/recipes-graphics/wayland/weston-init/qemux86-64/weston.ini b/meta/recipes-graphics/wayland/weston-init/qemux86-64/weston.ini deleted file mode 100644 index 17ebd7fdab..0000000000 --- a/meta/recipes-graphics/wayland/weston-init/qemux86-64/weston.ini +++ /dev/null @@ -1,2 +0,0 @@ -[core] -backend=fbdev-backend.so diff --git a/meta/recipes-graphics/wayland/weston-init/qemux86/weston.ini b/meta/recipes-graphics/wayland/weston-init/qemux86/weston.ini deleted file mode 100644 index 17ebd7fdab..0000000000 --- a/meta/recipes-graphics/wayland/weston-init/qemux86/weston.ini +++ /dev/null @@ -1,2 +0,0 @@ -[core] -backend=fbdev-backend.so 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-socket.sh b/meta/recipes-graphics/wayland/weston-init/weston-socket.sh new file mode 100755 index 0000000000..86389d63a3 --- /dev/null +++ b/meta/recipes-graphics/wayland/weston-init/weston-socket.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# set weston variables for use with global weston socket +global_socket="/run/wayland-0" +if [ -e "$global_socket" ]; then + weston_group=$(stat -c "%G" "$global_socket") + if [ "$(id -u)" = "0" ]; then + export WAYLAND_DISPLAY="$global_socket" + else + case "$(groups "$USER")" in + *"$weston_group"*) + export WAYLAND_DISPLAY="$global_socket" + ;; + *) + ;; + esac + fi + unset weston_group +fi +unset global_socket diff --git a/meta/recipes-graphics/wayland/weston-init/weston-start b/meta/recipes-graphics/wayland/weston-init/weston-start index ccc7093425..01670cd4f5 100755 --- a/meta/recipes-graphics/wayland/weston-init/weston-start +++ b/meta/recipes-graphics/wayland/weston-init/weston-start @@ -6,7 +6,7 @@ export PATH="/sbin:/usr/sbin:/bin:/usr/bin" usage() { cat <<EOF - $0 [<openvt arguments>] [-- <weston options>] + $0 [<weston options>] EOF } @@ -18,9 +18,12 @@ add_weston_argument() { weston_args="$weston_args $1" } -# Add openvt extra argument -add_openvt_argument() { - openvt_args="$openvt_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 @@ -29,29 +32,12 @@ if [ -n "$WAYLAND_DISPLAY" ]; then fi if [ -n "$WESTON_USER" ]; then - if [ -z "$WESTON_TTY" ]; then - echo "ERROR: If you have WESTON_USER variable set, you also need WESTON_TTY." - exit 1 + if [ -z "$WESTON_GROUP" ]; then + # no explicit WESTON_GROUP given, therefore use WESTON_USER + export WESTON_GROUP="${WESTON_USER}" fi - weston_args_user="-u $WESTON_USER -t $WESTON_TTY" fi -if [ -n "$DISPLAY" ]; then - launcher="weston" -else - launcher="weston-launch $weston_args_user --" -fi - -openvt_args="-s" -while [ -n "$1" ]; do - if [ "$1" = "--" ]; then - shift - break - fi - openvt_args="$openvt_args $1" - shift -done - weston_args=$* # Load and run modules @@ -64,6 +50,9 @@ if [ -d "$modules_dir" ]; then # process module . $m + if [[ x"{$weston_modules}" != "x" ]]; then + add_weston_argument "${weston_modules}" + fi; done fi @@ -75,8 +64,8 @@ if test -z "$XDG_RUNTIME_DIR"; then fi if [ -n "$WESTON_USER" ] then - chown $WESTON_USER:$WESTON_USER $XDG_RUNTIME_DIR + chown $WESTON_USER:$WESTON_GROUP $XDG_RUNTIME_DIR fi fi -exec openvt $openvt_args -- $launcher $weston_args --log=@LOCALSTATEDIR@/log/weston.log +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 index 1eecf48bc1..6bd5aef55a 100644 --- a/meta/recipes-graphics/wayland/weston-init/weston.ini +++ b/meta/recipes-graphics/wayland/weston-init/weston.ini @@ -1,9 +1,10 @@ # configuration file for Weston -#[core] +[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 @@ -41,7 +42,7 @@ #path=/build/weston-0lEgCh/weston-1.11.0/weston-flower #[input-method] -#path=/usr/lib/weston/weston-keyboard +#path=/usr/libexec/weston-keyboard #[output] #name=LVDS1 @@ -67,8 +68,8 @@ #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 +[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-init/weston@.service b/meta/recipes-graphics/wayland/weston-init/weston@.service deleted file mode 100644 index 9ecf2ab069..0000000000 --- a/meta/recipes-graphics/wayland/weston-init/weston@.service +++ /dev/null @@ -1,37 +0,0 @@ -[Unit] -Description=Weston Wayland Compositor (on tty7) -RequiresMountsFor=/run -Conflicts=getty@tty7.service plymouth-quit.service -After=systemd-user-sessions.service getty@tty7.service plymouth-quit-wait.service - -[Service] -User=%i -PermissionsStartOnly=true - -# Log us in via PAM so we get our XDG & co. environment and -# are treated as logged in so we can use the tty: -PAMName=login - -# Grab tty7 -UtmpIdentifier=tty7 -TTYPath=/dev/tty7 -TTYReset=yes -TTYVHangup=yes -TTYVTDisallocate=yes - -# stderr to journal so our logging doesn't get thrown into /dev/null -StandardOutput=tty -StandardInput=tty -StandardError=journal - -EnvironmentFile=-/etc/default/weston - -# Weston does not successfully change VT, nor does systemd place us on -# the VT it just activated for us. Switch manually: -ExecStartPre=/usr/bin/chvt 7 -ExecStart=/usr/bin/weston --log=${XDG_RUNTIME_DIR}/weston.log $OPTARGS - -IgnoreSIGPIPE=no - -#[Install] -#Alias=multi-user.target.wants/weston.service diff --git a/meta/recipes-graphics/wayland/weston/0001-libweston-tools-Include-libgen.h-for-basename-signat.patch b/meta/recipes-graphics/wayland/weston/0001-libweston-tools-Include-libgen.h-for-basename-signat.patch new file mode 100644 index 0000000000..2a833ee973 --- /dev/null +++ b/meta/recipes-graphics/wayland/weston/0001-libweston-tools-Include-libgen.h-for-basename-signat.patch @@ -0,0 +1,45 @@ +From 1a2a87013eb6af8e5267ecaf61e17b65a31dc662 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Thu, 14 Dec 2023 09:13:54 -0800 +Subject: [PATCH] libweston,tools: Include libgen.h for basename signature + +Latest musl has removed the declaration from string.h [1] as it only +implements POSIX version alone and string.h in glibc implements GNU +version of basename. This now results in compile errors on musl. + +This might be a warning with older compilers but it is error with +Clang-17+ as it treats -Wimplicit-function-declaration as error + +[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 + +Upstream-Status: Submitted [https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/1420] +Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + libweston/backend-drm/libbacklight.c | 1 + + tools/zunitc/src/zunitc_impl.c | 1 + + 2 files changed, 2 insertions(+) + +diff --git a/libweston/backend-drm/libbacklight.c b/libweston/backend-drm/libbacklight.c +index ca7f2d6..74690fa 100644 +--- a/libweston/backend-drm/libbacklight.c ++++ b/libweston/backend-drm/libbacklight.c +@@ -41,6 +41,7 @@ + #include <drm.h> + #include <fcntl.h> + #include <malloc.h> ++#include <libgen.h> + #include <string.h> + #include <errno.h> + +diff --git a/tools/zunitc/src/zunitc_impl.c b/tools/zunitc/src/zunitc_impl.c +index 18f0301..9b460fa 100644 +--- a/tools/zunitc/src/zunitc_impl.c ++++ b/tools/zunitc/src/zunitc_impl.c +@@ -27,6 +27,7 @@ + + #include <errno.h> + #include <fcntl.h> ++#include <libgen.h> + #include <stdarg.h> + #include <stdbool.h> + #include <stdio.h> diff --git a/meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch b/meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch deleted file mode 100644 index e50845b17a..0000000000 --- a/meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch +++ /dev/null @@ -1,200 +0,0 @@ -From 682b7d79a7b81ec8e38760381104b24ad549e8c0 Mon Sep 17 00:00:00 2001 -From: Tom Hochstein <tom.hochstein@nxp.com> -Date: Wed, 22 Feb 2017 15:53:30 +0200 -Subject: [PATCH] weston-launch: Provide a default version that doesn't require - PAM - -weston-launch requires PAM for starting weston as a non-root user. - -Since starting weston as root is a valid use case by itself, if -PAM is not available, provide a default version of weston-launch -without non-root-user support. - -Upstream-Status: Pending - -Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com> -Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com> -Signed-off-by: Denys Dmytriyenko <denys@ti.com> -Signed-off-by: Ming Liu <ming.liu@toradex.com> ---- - libweston/meson.build | 16 ++++++++++++---- - libweston/weston-launch.c | 21 +++++++++++++++++++++ - meson_options.txt | 7 +++++++ - 3 files changed, 40 insertions(+), 4 deletions(-) - -diff --git a/libweston/meson.build b/libweston/meson.build -index d8d3fc0..326683f 100644 ---- a/libweston/meson.build -+++ b/libweston/meson.build -@@ -199,16 +199,24 @@ dep_vertex_clipping = declare_dependency( - ) - - if get_option('weston-launch') -- dep_pam = cc.find_library('pam') -+ deps_weston_launch = [systemd_dep, dep_libdrm] - -- if not cc.has_function('pam_open_session', dependencies: dep_pam) -- error('pam_open_session not found for weston-launch') -+ if get_option('pam') -+ dep_pam = cc.find_library('pam') -+ if not cc.has_function('pam_open_session', dependencies: dep_pam) -+ error('pam_open_session not found for weston-launch') -+ endif -+ -+ if dep_pam.found() -+ deps_weston_launch += dep_pam -+ config_h.set('HAVE_PAM', '1') -+ endif - endif - - executable( - 'weston-launch', - 'weston-launch.c', -- dependencies: [dep_pam, systemd_dep, dep_libdrm], -+ dependencies: deps_weston_launch, - include_directories: include_directories('..'), - install: true - ) -diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c -index 4962bd6..fc531c5 100644 ---- a/libweston/weston-launch.c -+++ b/libweston/weston-launch.c -@@ -51,7 +51,9 @@ - - #include <pwd.h> - #include <grp.h> -+#ifdef HAVE_PAM - #include <security/pam_appl.h> -+#endif - - #ifdef HAVE_SYSTEMD_LOGIN - #include <systemd/sd-login.h> -@@ -100,8 +102,10 @@ drmSetMaster(int drm_fd) - #endif - - struct weston_launch { -+#ifdef HAVE_PAM - struct pam_conv pc; - pam_handle_t *ph; -+#endif - int tty; - int ttynr; - int sock[2]; -@@ -192,6 +196,7 @@ weston_launch_allowed(struct weston_launch *wl) - return false; - } - -+#ifdef HAVE_PAM - static int - pam_conversation_fn(int msg_count, - const struct pam_message **messages, -@@ -232,6 +237,7 @@ setup_pam(struct weston_launch *wl) - - return 0; - } -+#endif - - static int - setup_launcher_socket(struct weston_launch *wl) -@@ -431,6 +437,7 @@ quit(struct weston_launch *wl, int status) - close(wl->signalfd); - close(wl->sock[0]); - -+#ifdef HAVE_PAM - if (wl->new_user) { - err = pam_close_session(wl->ph, 0); - if (err) -@@ -438,6 +445,7 @@ quit(struct weston_launch *wl, int status) - err, pam_strerror(wl->ph, err)); - pam_end(wl->ph, err); - } -+#endif - - if (ioctl(wl->tty, KDSKBMUTE, 0) && - ioctl(wl->tty, KDSKBMODE, wl->kb_mode)) -@@ -660,6 +668,7 @@ setup_session(struct weston_launch *wl, char **child_argv) - setenv("HOME", wl->pw->pw_dir, 1); - setenv("SHELL", wl->pw->pw_shell, 1); - -+#ifdef HAVE_PAM - env = pam_getenvlist(wl->ph); - if (env) { - for (i = 0; env[i]; ++i) { -@@ -668,6 +677,7 @@ setup_session(struct weston_launch *wl, char **child_argv) - } - free(env); - } -+#endif - - /* - * We open a new session, so it makes sense -@@ -739,8 +749,10 @@ static void - help(const char *name) - { - fprintf(stderr, "Usage: %s [args...] [-- [weston args..]]\n", name); -+#ifdef HAVE_PAM - fprintf(stderr, " -u, --user Start session as specified username,\n" - " e.g. -u joe, requires root.\n"); -+#endif - fprintf(stderr, " -t, --tty Start session on alternative tty,\n" - " e.g. -t /dev/tty4, requires -u option.\n"); - fprintf(stderr, " -v, --verbose Be verbose\n"); -@@ -754,7 +766,9 @@ main(int argc, char *argv[]) - int i, c; - char *tty = NULL; - struct option opts[] = { -+#ifdef HAVE_PAM - { "user", required_argument, NULL, 'u' }, -+#endif - { "tty", required_argument, NULL, 't' }, - { "verbose", no_argument, NULL, 'v' }, - { "help", no_argument, NULL, 'h' }, -@@ -766,11 +780,16 @@ main(int argc, char *argv[]) - while ((c = getopt_long(argc, argv, "u:t:vh", opts, &i)) != -1) { - switch (c) { - case 'u': -+#ifdef HAVE_PAM - wl.new_user = optarg; - if (getuid() != 0) { - fprintf(stderr, "weston: Permission denied. -u allowed for root only\n"); - exit(EXIT_FAILURE); - } -+#else -+ fprintf(stderr, "weston: -u is unsupported in this weston-launch build\n"); -+ exit(EXIT_FAILURE); -+#endif - break; - case 't': - tty = optarg; -@@ -822,8 +841,10 @@ main(int argc, char *argv[]) - if (setup_tty(&wl, tty) < 0) - exit(EXIT_FAILURE); - -+#ifdef HAVE_PAM - if (wl.new_user && setup_pam(&wl) < 0) - exit(EXIT_FAILURE); -+#endif - - if (setup_launcher_socket(&wl) < 0) - exit(EXIT_FAILURE); -diff --git a/meson_options.txt b/meson_options.txt -index d5bf1d5..254eb2b 100644 ---- a/meson_options.txt -+++ b/meson_options.txt -@@ -73,6 +73,13 @@ option( - ) - - option( -+ 'pam', -+ type: 'boolean', -+ value: true, -+ description: 'Define if PAM is available' -+) -+ -+option( - 'xwayland', - type: 'boolean', - value: true, --- -2.7.4 - 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 index b483c97cf1..342ac8d129 100644 --- a/meta/recipes-graphics/wayland/weston/xwayland.weston-start +++ b/meta/recipes-graphics/wayland/weston/xwayland.weston-start @@ -1,7 +1,6 @@ #!/bin/sh if type Xwayland >/dev/null 2>/dev/null; then - mkdir -p /tmp/.X11-unix - - add_weston_argument "--modules=xwayland.so" + mkdir -m 775 -p /tmp/.X11-unix + chown root:video /tmp/.X11-unix fi diff --git a/meta/recipes-graphics/wayland/weston_13.0.3.bb b/meta/recipes-graphics/wayland/weston_13.0.3.bb new file mode 100644 index 0000000000..e4843d38f7 --- /dev/null +++ b/meta/recipes-graphics/wayland/weston_13.0.3.bb @@ -0,0 +1,146 @@ +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/-/releases/${PV}/downloads/${BPN}-${PV}.tar.xz \ + file://0001-libweston-tools-Include-libgen.h-for-basename-signat.patch \ + file://weston.png \ + file://weston.desktop \ + file://xwayland.weston-start \ + file://systemd-notify.weston-start \ + " + +SRC_URI[sha256sum] = "27f68d96e3b97d98daadef13a202356524924fa381418fa6716b9136ef099093" + +UPSTREAM_CHECK_URI = "https://gitlab.freedesktop.org/wayland/weston/-/tags" +UPSTREAM_CHECK_REGEX = "releases/(?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)} \ + image-jpeg \ + screenshare \ + shell-desktop \ + shell-fullscreen \ + shell-ivi \ + shell-kiosk \ + " + +# 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 seatd 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 libxcursor" +# 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 support +PACKAGECONFIG[systemd] = "-Dsystemd=true,-Dsystemd=false,systemd dbus" +# Weston with Xwayland support (requires X11 and Wayland) +PACKAGECONFIG[xwayland] = "-Dxwayland=true,-Dxwayland=false,libxcb libxcursor xcb-util-cursor xwayland" +# 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" +# Kiosk shell +PACKAGECONFIG[shell-kiosk] = "-Dshell-kiosk=true,-Dshell-kiosk=false" +# JPEG image loading support +PACKAGECONFIG[image-jpeg] = "-Dimage-jpeg=true,-Dimage-jpeg=false, jpeg" +# screencasting via PipeWire +PACKAGECONFIG[pipewire] = "-Dbackend-pipewire=true,-Dbackend-pipewire=false,pipewire" +# VNC remote screensharing +PACKAGECONFIG[vnc] = "-Dbackend-vnc=true,-Dbackend-vnc=false,neatvnc" + + +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 ${UNPACKDIR}/weston.desktop ${D}${datadir}/applications + + install -d ${D}${datadir}/icons/hicolor/48x48/apps + install ${UNPACKDIR}/weston.png ${D}${datadir}/icons/hicolor/48x48/apps + fi + + if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "yes" ]; then + install -Dm 644 ${UNPACKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland + fi + + if [ "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'yes', 'no', d)}" = "yes" ]; then + install -Dm 644 ${UNPACKDIR}/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} = "${sysconfdir} ${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" diff --git a/meta/recipes-graphics/wayland/weston_7.0.0.bb b/meta/recipes-graphics/wayland/weston_7.0.0.bb deleted file mode 100644 index e6548d3541..0000000000 --- a/meta/recipes-graphics/wayland/weston_7.0.0.bb +++ /dev/null @@ -1,111 +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=d79ee9e66bb0f95d3386a7acae780b70 \ - file://libweston/compositor.c;endline=27;md5=6c53bbbd99273f4f7c4affa855c33c0a" - -SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ - file://weston.png \ - file://weston.desktop \ - file://xwayland.weston-start \ - file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \ -" -SRC_URI[md5sum] = "cbfda483bc2501d0831af3f33c707850" -SRC_URI[sha256sum] = "a00a6d207b6a45f95f4401c604772a307c3767e5e2beecf3d879110c43909a64" - -UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html" - -inherit meson pkgconfig useradd features_check -# depends on virtual/egl -REQUIRED_DISTRO_FEATURES = "opengl" - -DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0 jpeg" -DEPENDS += "wayland wayland-protocols libinput virtual/egl pango wayland-native" - -WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}" - -EXTRA_OEMESON += "-Dbackend-default=auto -Dbackend-rdp=false -Dpipewire=false" - -PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl', '', d)} \ - ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \ - ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd x11', d)} \ - ${@bb.utils.contains_any('DISTRO_FEATURES', 'wayland x11', '', 'headless', d)} \ - clients launch" -# -# 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 framebuffer -PACKAGECONFIG[fbdev] = "-Dbackend-fbdev=true,-Dbackend-fbdev=false,udev mtdev" -# weston-launch -PACKAGECONFIG[launch] = "-Dweston-launch=true,-Dweston-launch=false,drm" -# 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] = "-Dcolor-management-colord=true,-Dcolor-management-colord=false,colord" -# Clients support -PACKAGECONFIG[clients] = "-Dsimple-clients=all -Ddemo-clients=true,-Dsimple-clients= -Ddemo-clients=false" -# Virtual remote output with GStreamer on DRM backend -PACKAGECONFIG[remoting] = "-Dremoting=true,-Dremoting=false,gstreamer-1.0" -# Weston with PAM support -PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam" - -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', '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} = "${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 += "xserver-xorg-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" |