diff options
Diffstat (limited to 'meta/recipes-graphics/wayland')
29 files changed, 720 insertions, 555 deletions
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.12.3.bb b/meta/recipes-graphics/wayland/libinput_1.12.3.bb deleted file mode 100644 index 3d1ab59309..0000000000 --- a/meta/recipes-graphics/wayland/libinput_1.12.3.bb +++ /dev/null @@ -1,29 +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=1f2ea9ebff3a2c6d458faf58492efb63" - -DEPENDS = "libevdev udev mtdev" - -SRC_URI = "http://www.freedesktop.org/software/${BPN}/${BP}.tar.xz \ - " -SRC_URI[md5sum] = "083d6bf311d5e1e3a62440dc634bb8f0" -SRC_URI[sha256sum] = "f266ff861a2e7a97e1402c4345e3547b900efde68adbd40e56403e2617fee255" - -UPSTREAM_CHECK_REGEX = "libinput-(?P<pver>\d+\.\d+\.(?!9\d+)\d+)" -inherit meson pkgconfig lib_package - -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 -Dtests=false" - -# package name changed in 1.8.1 upgrade: make sure package upgrades work -RPROVIDES_${PN} = "libinput" -RREPLACES_${PN} = "libinput" -RCONFLICTS_${PN} = "libinput" diff --git a/meta/recipes-graphics/wayland/libinput_1.26.1.bb b/meta/recipes-graphics/wayland/libinput_1.26.1.bb new file mode 100644 index 0000000000..487270505a --- /dev/null +++ b/meta/recipes-graphics/wayland/libinput_1.26.1.bb @@ -0,0 +1,49 @@ +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" + +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 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 ??= "${@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 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 \ + -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.7.bb index ccd0ebbfce..24803c4238 100644 --- a/meta/recipes-graphics/wayland/mtdev_1.1.5.bb +++ b/meta/recipes-graphics/wayland/mtdev_1.1.7.bb @@ -12,7 +12,6 @@ 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[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.16.bb b/meta/recipes-graphics/wayland/wayland-protocols_1.37.bb index fc4b711172..2bf59b9719 100644 --- a/meta/recipes-graphics/wayland/wayland-protocols_1.16.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] = "e0b523ff162e30bab46be1d65d527683" -SRC_URI[sha256sum] = "6b1485951fdcd36a960c870c46f28b03a3e5121fb46246916333ed07f78c98c5" +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/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.16.0.bb b/meta/recipes-graphics/wayland/wayland_1.16.0.bb deleted file mode 100644 index 112ee1a25e..0000000000 --- a/meta/recipes-graphics/wayland/wayland_1.16.0.bb +++ /dev/null @@ -1,44 +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 libxml2 libffi wayland-native" - -SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ - file://fixpathinpcfiles.patch \ - " -SRC_URI[md5sum] = "0c215e53de71d6fb26f7102cdc6432d3" -SRC_URI[sha256sum] = "4e72c2b56109ccfb6610d776e465f4ca0af2280c9c2f7d5cc23f0ed2548752f5" - -UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html" - -inherit autotools pkgconfig - -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-conf.bb b/meta/recipes-graphics/wayland/weston-conf.bb deleted file mode 100644 index f52200c46a..0000000000 --- a/meta/recipes-graphics/wayland/weston-conf.bb +++ /dev/null @@ -1,35 +0,0 @@ -SUMMARY = "Weston, a Wayland compositor, configuration files" -HOMEPAGE = "http://wayland.freedesktop.org" -LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" - -PACKAGE_ARCH = "${MACHINE_ARCH}" - -CONFFILES_${PN} = "${sysconfdir}/xdg/weston/weston.ini" - -FILES_${PN} = "${sysconfdir}/xdg/weston/weston.ini" - -PACKAGES = "${PN}" - -do_configure[noexec] = '1' -do_compile[noexec] = '1' - -do_install() { - : -} - -do_install_qemux86() { - mkdir -p ${D}/${sysconfdir}/xdg/weston - cat << EOF > ${D}/${sysconfdir}/xdg/weston/weston.ini -[core] -backend=fbdev-backend.so -EOF -} - -do_install_qemux86-64() { - mkdir -p ${D}/${sysconfdir}/xdg/weston - cat << EOF > ${D}/${sysconfdir}/xdg/weston/weston.ini -[core] -backend=fbdev-backend.so -EOF -} diff --git a/meta/recipes-graphics/wayland/weston-init.bb b/meta/recipes-graphics/wayland/weston-init.bb index 22ba5f3fb3..3de697ec34 100644 --- a/meta/recipes-graphics/wayland/weston-init.bb +++ b/meta/recipes-graphics/wayland/weston-init.bb @@ -2,30 +2,106 @@ SUMMARY = "Startup script and systemd unit file for the Weston Wayland composito LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" +PACKAGE_ARCH = "${MACHINE_ARCH}" + SRC_URI = "file://init \ + file://weston.env \ + file://weston.ini \ file://weston.service \ + file://weston.socket \ + file://weston-socket.sh \ + file://weston-autologin \ file://weston-start" -S = "${WORKDIR}" +S = "${WORKDIR}/sources" +UNPACKDIR = "${S}" -do_install() { - install -Dm755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston - install -Dm0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}/weston.service +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 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 allarch update-rc.d distro_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 ." -SYSTEMD_SERVICE_${PN} = "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 ${sysconfdir}/default/weston" + +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/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/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 e72fbaaac4..01670cd4f5 100755 --- a/meta/recipes-graphics/wayland/weston-init/weston-start +++ b/meta/recipes-graphics/wayland/weston-init/weston-start @@ -5,8 +5,8 @@ export PATH="/sbin:/usr/sbin:/bin:/usr/bin" usage() { - cat <<EOF - $0 [<openvt arguments>] [-- <weston options>] + cat <<EOF + $0 [<weston options>] EOF } @@ -18,30 +18,25 @@ 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 echo "ERROR: A Wayland compositor is already running, nested Weston instance is not supported yet." exit 1 fi -if [ -n "$DISPLAY" ]; then - launcher="weston" -else - launcher="weston-launch --" -fi -openvt_args="-s" -while [ -n "$1" ]; do - if [ "$1" = "--" ]; then - shift - break +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 - openvt_args="$openvt_args $1" - shift -done +fi weston_args=$* @@ -55,15 +50,22 @@ if [ -d "$modules_dir" ]; then # 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` - if ! test -d "$XDG_RUNTIME_DIR"; then - mkdir --parents $XDG_RUNTIME_DIR - chmod 0700 $XDG_RUNTIME_DIR - fi + 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 -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 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 index 18f72626e0..80745998ed 100644 --- a/meta/recipes-graphics/wayland/weston-init/weston.service +++ b/meta/recipes-graphics/wayland/weston-init/weston.service @@ -1,13 +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 Wayland Compositor -RequiresMountsFor=/run +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] -User=root -PAMName=login -EnvironmentFile=-/etc/default/weston -ExecStart=/usr/bin/weston-start -v -e -- $OPTARGS +# Requires systemd-notify.so Weston plugin. +Type=notify +EnvironmentFile=/etc/default/weston +ExecStart=/usr/bin/weston --modules=systemd-notify.so -[Install] -WantedBy=multi-user.target +# 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-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-make-error-portable.patch b/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch deleted file mode 100644 index 09ec1559ec..0000000000 --- a/meta/recipes-graphics/wayland/weston/0001-make-error-portable.patch +++ /dev/null @@ -1,78 +0,0 @@ -From ad1d2161c811cff25d1684c33611f300adb753bc 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] make error() portable - -error() is not posix but gnu extension so may not be available on all -kind of systemsi e.g. musl. - -Upstream-Status: Submitted - -Signed-off-by: Khem Raj <raj.khem@gmail.com> - ---- - configure.ac | 2 ++ - libweston/weston-error.h | 20 ++++++++++++++++++++ - libweston/weston-launch.c | 2 +- - 3 files changed, 23 insertions(+), 1 deletion(-) - create mode 100644 libweston/weston-error.h - -diff --git a/configure.ac b/configure.ac -index 7aebbdb..dc9c802 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -109,6 +109,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]) - - # check for libdrm as a build-time dependency only -diff --git a/libweston/weston-error.h b/libweston/weston-error.h -new file mode 100644 -index 0000000..2089d02 ---- /dev/null -+++ b/libweston/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/libweston/weston-launch.c b/libweston/weston-launch.c -index 1adcf21..166bf3b 100644 ---- a/libweston/weston-launch.c -+++ b/libweston/weston-launch.c -@@ -33,7 +33,6 @@ - #include <poll.h> - #include <errno.h> - --#include <error.h> - #include <getopt.h> - - #include <sys/types.h> -@@ -59,6 +58,7 @@ - #endif - - #include "weston-launch.h" -+#include "weston-error.h" - - #define DRM_MAJOR 226 - 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 d648538b89..0000000000 --- a/meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch +++ /dev/null @@ -1,173 +0,0 @@ -From b98b9dbda902225cdd972b5bff6a641c36cc7e90 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> - ---- - configure.ac | 9 +++++++-- - libweston/weston-launch.c | 20 ++++++++++++++++++++ - 2 files changed, 27 insertions(+), 2 deletions(-) - -diff --git a/configure.ac b/configure.ac -index dc9c802..48cf5cb 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -451,13 +451,17 @@ 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])]) - -+AC_ARG_WITH(pam, -+ AS_HELP_STRING([--with-pam], [Use PAM]), -+ [use_pam=$withval], [use_pam=yes]) - AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes) - AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch = xyes) --if test x$enable_weston_launch = xyes; then -+if test x$enable_weston_launch = xyes -a x$use_pam = xyes; then - WESTON_SEARCH_LIBS([PAM], [pam], [pam_open_session], [have_pam=yes], [have_pam=no]) - if test x$have_pam = xno; then -- AC_ERROR([weston-launch requires pam]) -+ AC_ERROR([PAM support is explicitly requested, but libpam couldn't be found]) - fi -+ AC_DEFINE([HAVE_PAM], [1], [Define if PAM is available]) - fi - - AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes") -@@ -702,6 +706,7 @@ AC_MSG_RESULT([ - Enable developer documentation ${enable_devdocs} - - weston-launch utility ${enable_weston_launch} -+ PAM support ${use_pam} - systemd-login support ${have_systemd_login} - systemd notify support ${enable_systemd_notify} - -diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c -index 166bf3b..6fb9232 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> -@@ -101,8 +103,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]; -@@ -189,6 +193,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, -@@ -229,6 +234,7 @@ setup_pam(struct weston_launch *wl) - - return 0; - } -+#endif - - static int - setup_launcher_socket(struct weston_launch *wl) -@@ -422,6 +428,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) -@@ -429,6 +436,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)) -@@ -608,6 +616,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) { -@@ -616,6 +625,7 @@ setup_session(struct weston_launch *wl, char **child_argv) - } - free(env); - } -+#endif - - /* - * We open a new session, so it makes sense -@@ -683,8 +693,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"); -@@ -698,7 +710,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' }, -@@ -710,9 +724,13 @@ 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) - error(1, 0, "Permission denied. -u allowed for root only"); -+#else -+ error(1, 0, "-u is unsupported in this weston-launch build"); -+#endif - break; - case 't': - tty = optarg; -@@ -753,8 +771,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/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..dd5b2e2b27 --- /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,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_5.0.0.bb b/meta/recipes-graphics/wayland/weston_5.0.0.bb deleted file mode 100644 index e51710928a..0000000000 --- a/meta/recipes-graphics/wayland/weston_5.0.0.bb +++ /dev/null @@ -1,108 +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://0001-make-error-portable.patch \ - file://xwayland.weston-start \ - file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \ -" -SRC_URI[md5sum] = "752a04ce3c65af4884cfac4e57231bdb" -SRC_URI[sha256sum] = "15a23423bcfa45e31e1dedc0cd524ba71e2930df174fde9c99b71a537c4e4caf" - -UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html" - -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 wayland-protocols libinput virtual/egl pango wayland-native" - -WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}" - -EXTRA_OECONF = "--enable-setuid-install \ - --disable-rdp-compositor \ - " -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)} \ - clients launch" -# -# Compositor choices -# -# Weston on KMS -PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm udev virtual/mesa virtual/libgbm 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,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] = "--with-webp,--without-webp,libwebp" -# Weston with systemd-login support -PACKAGECONFIG[systemd] = "--enable-systemd-login,--disable-systemd-login,systemd dbus" -# Weston with Xwayland support (requires X11 and Wayland) -PACKAGECONFIG[xwayland] = "--enable-xwayland,--disable-xwayland" -# colord CMS support -PACKAGECONFIG[colord] = "--enable-colord,--disable-colord,colord" -# Clients support -PACKAGECONFIG[clients] = "--enable-clients --enable-simple-clients --enable-demo-clients-install,--disable-clients --disable-simple-clients" -# Weston with PAM support -PACKAGECONFIG[pam] = "--with-pam,--without-pam,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 -} - -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-conf liberation-fonts" -RRECOMMENDS_${PN}-dev += "wayland-protocols" - -USERADD_PACKAGES = "${PN}" -GROUPADD_PARAM_${PN} = "--system weston-launch" |