diff options
Diffstat (limited to 'meta/recipes-graphics/wayland')
15 files changed, 116 insertions, 406 deletions
diff --git a/meta/recipes-graphics/wayland/libinput_1.16.4.bb b/meta/recipes-graphics/wayland/libinput_1.19.3.bb index 17b73e3827..a7f13240d5 100644 --- a/meta/recipes-graphics/wayland/libinput_1.16.4.bb +++ b/meta/recipes-graphics/wayland/libinput_1.19.3.bb @@ -8,7 +8,7 @@ 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 libcheck" @@ -16,14 +16,14 @@ SRC_URI = "http://www.freedesktop.org/software/${BPN}/${BP}.tar.xz \ file://run-ptest \ file://determinism.patch \ " -SRC_URI[sha256sum] = "65923a06d5a8970e4a999c4668797b9b689614b62b1d44432ab1c87b65e39e29" +SRC_URI[sha256sum] = "3cae78ccde19d7d0f387e58bc734d4d17ab5f6426f54a9e8b728c90b17baa068" 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() { +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 @@ -42,8 +42,8 @@ EXTRA_OEMESON += "-Dudev-dir=${UDEVDIR} \ -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" +FILES:${PN}-ptest += "${libexecdir}/libinput/libinput-test-suite" diff --git a/meta/recipes-graphics/wayland/wayland-protocols_1.20.bb b/meta/recipes-graphics/wayland/wayland-protocols_1.25.bb index 3fb78f658c..92ba296165 100644 --- a/meta/recipes-graphics/wayland/wayland-protocols_1.20.bb +++ b/meta/recipes-graphics/wayland/wayland-protocols_1.25.bb @@ -11,12 +11,16 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=c7b12b6702da38ca028ace54aae3d484 \ SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ " -SRC_URI[md5sum] = "b0836533a3f2dc6585b1dae00341157f" -SRC_URI[sha256sum] = "9782b7a1a863d82d7c92478497d13c758f52e7da4f197aa16443f73de77e4de7" +SRC_URI[sha256sum] = "f1ff0f7199d0a0da337217dd8c99979967808dc37731a1e759e822b75b571460" UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html" -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/0001-build-Fix-strndup-detection-on-MinGW.patch b/meta/recipes-graphics/wayland/wayland/0001-build-Fix-strndup-detection-on-MinGW.patch index ad1063b2c3..bc753de113 100644 --- 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 @@ -1,4 +1,4 @@ -From 6a6223a8e217664a348835e92d5a602f50e18b2c Mon Sep 17 00:00:00 2001 +From b4c64b6f07743e3fb63ce52359bc664ab7d60df0 Mon Sep 17 00:00:00 2001 From: Joshua Watt <JPEWhacker@gmail.com> Date: Thu, 20 Feb 2020 15:20:45 -0600 Subject: [PATCH] build: Fix strndup detection on MinGW @@ -11,27 +11,31 @@ for strndup(). See: https://github.com/mesonbuild/meson/issues/3672 -Signed-off-by: Joshua Watt <JPEWhacker@gmail.com> 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 11c35fa..80729d0 100644 +index 3bc25c9..adde7b9 100644 --- a/meson.build +++ b/meson.build -@@ -36,11 +36,11 @@ have_funcs = [ - 'posix_fallocate', +@@ -38,11 +38,11 @@ have_funcs = [ 'prctl', 'memfd_create', + 'mremap', - 'strndup', ] foreach f: have_funcs config_h.set('HAVE_' + f.underscorify().to_upper(), cc.has_function(f)) endforeach +config_h.set('HAVE_STRNDUP', cc.has_function('strndup') and cc.has_header_symbol('string.h', 'strndup')) - - if get_option('libraries') - ffi_dep = dependency('libffi') + config_h.set10('HAVE_XUCRED_CR_PID', cc.has_member('struct xucred', 'cr_pid', prefix : '#include <sys/ucred.h>')) + have_broken_msg_cmsg_cloexec = false + if host_machine.system() == 'freebsd' +-- +2.7.4 + diff --git a/meta/recipes-graphics/wayland/wayland/0002-meson.build-find-the-native-wayland-scanner-directly.patch b/meta/recipes-graphics/wayland/wayland/0002-meson.build-find-the-native-wayland-scanner-directly.patch deleted file mode 100644 index 11dc069147..0000000000 --- a/meta/recipes-graphics/wayland/wayland/0002-meson.build-find-the-native-wayland-scanner-directly.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 98e7902a4ddcd80b61cce6f35f97907e841a5eda Mon Sep 17 00:00:00 2001 -From: Alexander Kanavin <alex.kanavin@gmail.com> -Date: Sun, 16 Feb 2020 16:29:53 +0100 -Subject: [PATCH] meson.build: find the native wayland-scanner directly in PATH - -Otherwise, meson attempts to use the target pkg-config and fails. - -Upstream-Status: Pending -Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com> - ---- - src/meson.build | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/src/meson.build b/src/meson.build -index d91c503..15730a3 100644 ---- a/src/meson.build -+++ b/src/meson.build -@@ -59,8 +59,7 @@ if get_option('scanner') - endif - - if meson.is_cross_build() or not get_option('scanner') -- scanner_dep = dependency('wayland-scanner', native: true, version: meson.project_version()) -- wayland_scanner_for_build = find_program(scanner_dep.get_pkgconfig_variable('wayland_scanner')) -+ wayland_scanner_for_build = find_program('wayland-scanner') - else - wayland_scanner_for_build = wayland_scanner - endif diff --git a/meta/recipes-graphics/wayland/wayland_1.19.0.bb b/meta/recipes-graphics/wayland/wayland_1.20.0.bb index 8f121601c4..bd437767b2 100644 --- a/meta/recipes-graphics/wayland/wayland_1.19.0.bb +++ b/meta/recipes-graphics/wayland/wayland_1.20.0.bb @@ -14,11 +14,10 @@ DEPENDS = "expat libffi wayland-native" SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ file://run-ptest \ - file://0002-meson.build-find-the-native-wayland-scanner-directly.patch \ file://0002-Do-not-hardcode-the-path-to-wayland-scanner.patch \ file://0001-build-Fix-strndup-detection-on-MinGW.patch \ " -SRC_URI[sha256sum] = "baccd902300d354581cd5ad3cc49daa4921d55fb416a5883e218750fef166d15" +SRC_URI[sha256sum] = "b8a034154c7059772e0fdbd27dbfcda6c732df29cae56a82274f6ec5d7cd8725" UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html" @@ -28,11 +27,11 @@ PACKAGECONFIG ??= "dtd-validation" PACKAGECONFIG[dtd-validation] = "-Ddtd_validation=true,-Ddtd_validation=false,libxml2,," EXTRA_OEMESON = "-Ddocumentation=false" -EXTRA_OEMESON_class-native = "-Ddocumentation=false -Dlibraries=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() { +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 @@ -47,14 +46,16 @@ do_install_ptest() { cp -rf ${S}/egl/wayland-egl-symbols-check ${D}${PTEST_PATH}/tests/ } -sysroot_stage_all_append_class-target () { +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" +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" +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 6b78e6722f..c34582137d 100644 --- a/meta/recipes-graphics/wayland/weston-init.bb +++ b/meta/recipes-graphics/wayland/weston-init.bb @@ -17,15 +17,10 @@ S = "${WORKDIR}" PACKAGECONFIG ??= "" PACKAGECONFIG[no-idle-timeout] = ",," +PACKAGECONFIG[use-pixman] = ",," DEFAULTBACKEND ??= "" -DEFAULTBACKEND_qemuall ?= "fbdev" -DEFAULTBACKEND_qemuarm64 = "drm" -DEFAULTBACKEND_qemux86 = "drm" -DEFAULTBACKEND_qemux86-64 = "drm" -# gallium swrast was found to crash weston on startup in x32 qemu -DEFAULTBACKEND_qemux86-64_x86-x32 = "fbdev" -DEFAULTBACKEND_x86-x32 = "fbdev" +DEFAULTBACKEND:qemuall ?= "drm" do_install() { if [ "${VIRTUAL-RUNTIME_init_manager}" != "systemd" ]; then @@ -44,7 +39,7 @@ do_install() { sed -i -e s:/etc:${sysconfdir}:g \ -e s:/usr/bin:${bindir}:g \ -e s:/var:${localstatedir}:g \ - ${D}${systemd_unitdir}/system/weston.service + ${D}${systemd_system_unitdir}/weston.service # Install weston-start script install -Dm755 ${WORKDIR}/weston-start ${D}${bindir}/weston-start sed -i 's,@DATADIR@,${datadir},g' ${D}${bindir}/weston-start @@ -57,6 +52,10 @@ do_install() { 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 } @@ -70,12 +69,12 @@ USERADD_PACKAGES = "${PN}" # requires pam enabled if started via systemd REQUIRED_DISTRO_FEATURES = "opengl ${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', 'pam', '', d)}" -RDEPENDS_${PN} = "weston kbd" +RDEPENDS:${PN} = "weston kbd" INITSCRIPT_NAME = "weston" INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ." -FILES_${PN} += "\ +FILES:${PN} += "\ ${sysconfdir}/xdg/weston/weston.ini \ ${systemd_system_unitdir}/weston.service \ ${systemd_system_unitdir}/weston.socket \ @@ -84,9 +83,9 @@ FILES_${PN} += "\ /home/weston \ " -CONFFILES_${PN} += "${sysconfdir}/xdg/weston/weston.ini ${sysconfdir}/default/weston" +CONFFILES:${PN} += "${sysconfdir}/xdg/weston/weston.ini ${sysconfdir}/default/weston" -SYSTEMD_SERVICE_${PN} = "weston.service weston.socket" -USERADD_PARAM_${PN} = "--home /home/weston --shell /bin/sh --user-group -G video,input weston" -GROUPADD_PARAM_${PN} = "-r wayland" +SYSTEMD_SERVICE:${PN} = "weston.service weston.socket" +USERADD_PARAM:${PN} = "--home /home/weston --shell /bin/sh --user-group -G video,input weston" +GROUPADD_PARAM:${PN} = "-r wayland" diff --git a/meta/recipes-graphics/wayland/weston-init/init b/meta/recipes-graphics/wayland/weston-init/init index a849f29bcb..d3b0d1873e 100644 --- a/meta/recipes-graphics/wayland/weston-init/init +++ b/meta/recipes-graphics/wayland/weston-init/init @@ -32,7 +32,7 @@ case "$1" in . /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-start b/meta/recipes-graphics/wayland/weston-init/weston-start index 0b93dc964a..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,33 +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 - fi 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 @@ -68,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 @@ -83,4 +68,4 @@ if test -z "$XDG_RUNTIME_DIR"; then 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.service b/meta/recipes-graphics/wayland/weston-init/weston.service index e09625b31c..80745998ed 100644 --- a/meta/recipes-graphics/wayland/weston-init/weston.service +++ b/meta/recipes-graphics/wayland/weston-init/weston.service @@ -37,8 +37,8 @@ EnvironmentFile=/etc/default/weston ExecStart=/usr/bin/weston --modules=systemd-notify.so # Optional watchdog setup -TimeoutStartSec=60 -WatchdogSec=20 +#TimeoutStartSec=60 +#WatchdogSec=20 # The user to run Weston as. User=weston diff --git a/meta/recipes-graphics/wayland/weston/0001-meson.build-fix-incorrect-header.patch b/meta/recipes-graphics/wayland/weston/0001-meson.build-fix-incorrect-header.patch deleted file mode 100644 index 06e0f7baec..0000000000 --- a/meta/recipes-graphics/wayland/weston/0001-meson.build-fix-incorrect-header.patch +++ /dev/null @@ -1,32 +0,0 @@ -From a2ba4714a6872e547621d29d9ddcb0f374b88cf6 Mon Sep 17 00:00:00 2001 -From: Chen Qi <Qi.Chen@windriver.com> -Date: Tue, 20 Apr 2021 20:42:18 -0700 -Subject: [PATCH] meson.build: fix incorrect header - -The wayland.c actually include 'xdg-shell-client-protocol.h' instead of -the server one, so fix it. Otherwise, it's possible to get build failure -due to race condition. - -Upstream-Status: Pending - -Signed-off-by: Chen Qi <Qi.Chen@windriver.com> ---- - libweston/backend-wayland/meson.build | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/libweston/backend-wayland/meson.build b/libweston/backend-wayland/meson.build -index 7e82513..29270b5 100644 ---- a/libweston/backend-wayland/meson.build -+++ b/libweston/backend-wayland/meson.build -@@ -10,7 +10,7 @@ srcs_wlwl = [ - fullscreen_shell_unstable_v1_protocol_c, - presentation_time_protocol_c, - presentation_time_server_protocol_h, -- xdg_shell_server_protocol_h, -+ xdg_shell_client_protocol_h, - xdg_shell_protocol_c, - ] - --- -2.30.2 - diff --git a/meta/recipes-graphics/wayland/weston/0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch b/meta/recipes-graphics/wayland/weston/0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch deleted file mode 100644 index 6fe86ff3f0..0000000000 --- a/meta/recipes-graphics/wayland/weston/0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 58760e09eed662a72da939ff4802d605489cff8e Mon Sep 17 00:00:00 2001 -From: Denys Dmytriyenko <denys@ti.com> -Date: Tue, 8 Sep 2020 19:37:42 -0400 -Subject: [PATCH] tests: include fcntl.h for open(), O_RDWR, O_CLOEXEC and - O_CREAT - -musl libc (unlike glibc) requires explicitly incuding fcntl.h to define open(), -O_RDWR, O_CLOEXEC and O_CREAT. Otherwise the build fails with the errors: - -| ../weston-9.0.0/tests/weston-test-fixture-compositor.c: In function 'wait_for_lock': -| ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:7: warning: implicit declaration of function 'open'; did you mean 'popen'? [-Wimplicit-function-declaration] -| 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700); -| | ^~~~ -| | popen -| ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:23: error: 'O_RDWR' undeclared (first use in this function) -| 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700); -| | ^~~~~~ -| ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:23: note: each undeclared identifier is reported only once for each function it appears in -| ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:32: error: 'O_CLOEXEC' undeclared (first use in this function) -| 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700); -| | ^~~~~~~~~ -| ../weston-9.0.0/tests/weston-test-fixture-compositor.c:135:44: error: 'O_CREAT' undeclared (first use in this function) -| 135 | fd = open(lock_path, O_RDWR | O_CLOEXEC | O_CREAT, 00700); -| | ^~~~~~~ - -Upstream-Status: Submitted [https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/493/diffs?commit_id=b10c0e843dcb8148bbe869bb15261955b94ac98c] - -Signed-off-by: Denys Dmytriyenko <denys@ti.com> ---- - tests/weston-test-fixture-compositor.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/tests/weston-test-fixture-compositor.c b/tests/weston-test-fixture-compositor.c -index 0c9855f..e0e32c9 100644 ---- a/tests/weston-test-fixture-compositor.c -+++ b/tests/weston-test-fixture-compositor.c -@@ -31,6 +31,7 @@ - #include <unistd.h> - #include <sys/file.h> - #include <errno.h> -+#include <fcntl.h> - - #include "shared/helpers.h" - #include "weston-test-fixture-compositor.h" --- -2.7.4 - 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 3279a728cc..0000000000 --- a/meta/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch +++ /dev/null @@ -1,199 +0,0 @@ -From a1548c742bf2dedbb47282d8a00407b60bbab669 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 08d23ec..cb9fd3f 100644 ---- a/libweston/meson.build -+++ b/libweston/meson.build -@@ -216,16 +216,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: common_inc, - install: true - ) -diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c -index 521cb2c..2d42d33 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) -@@ -466,6 +472,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) -@@ -473,6 +480,7 @@ quit(struct weston_launch *wl, int status) - err, pam_strerror(wl->ph, err)); - pam_end(wl->ph, err); - } -+#endif - - /* - * Get a fresh handle to the tty as the previous one is in -@@ -710,6 +718,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) { -@@ -718,6 +727,7 @@ setup_session(struct weston_launch *wl, char **child_argv) - } - free(env); - } -+#endif - - /* - * We open a new session, so it makes sense -@@ -789,8 +799,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"); -@@ -804,7 +816,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' }, -@@ -816,11 +830,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; -@@ -872,8 +891,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 239bd2d..99e4ec3 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, diff --git a/meta/recipes-graphics/wayland/weston/dont-use-plane-add-prop.patch b/meta/recipes-graphics/wayland/weston/dont-use-plane-add-prop.patch index a4444e5d18..1ac0695222 100644 --- a/meta/recipes-graphics/wayland/weston/dont-use-plane-add-prop.patch +++ b/meta/recipes-graphics/wayland/weston/dont-use-plane-add-prop.patch @@ -1,4 +1,7 @@ -Fix atomic modesetting with musl +From ece4c3d261aeec230869c0304ed1011ff6837c16 Mon Sep 17 00:00:00 2001 +From: Khem Raj <raj.khem@gmail.com> +Date: Sat, 12 Sep 2020 14:04:04 -0700 +Subject: [PATCH] Fix atomic modesetting with musl atomic modesetting seems to fail with drm weston backend and this patch fixes it, below errors are seen before weston exits @@ -8,9 +11,15 @@ atomic: couldn't commit new state: Invalid argument Upstream-Status: Submitted [https://gitlab.freedesktop.org/wayland/weston/-/issues/158] Signed-off-by: Khem Raj <raj.khem@gmail.com> +--- + libweston/backend-drm/kms.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libweston/backend-drm/kms.c b/libweston/backend-drm/kms.c +index 780d007..9994da1 100644 --- a/libweston/backend-drm/kms.c +++ b/libweston/backend-drm/kms.c -@@ -1168,8 +1168,8 @@ drm_pending_state_apply_atomic(struct dr +@@ -1142,8 +1142,8 @@ drm_pending_state_apply_atomic(struct drm_pending_state *pending_state, wl_list_for_each(plane, &b->plane_list, link) { drm_debug(b, "\t\t[atomic] starting with plane %lu disabled\n", (unsigned long) plane->plane_id); 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_9.0.0.bb b/meta/recipes-graphics/wayland/weston_10.0.0.bb index ce2b7d4f37..bebe95f69d 100644 --- a/meta/recipes-graphics/wayland/weston_9.0.0.bb +++ b/meta/recipes-graphics/wayland/weston_10.0.0.bb @@ -3,27 +3,26 @@ 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" + file://libweston/compositor.c;endline=27;md5=eb6d5297798cabe2ddc65e2af519bcf0 \ + " 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 \ - file://0001-tests-include-fcntl.h-for-open-O_RDWR-O_CLOEXEC-and-.patch \ - file://0001-meson.build-fix-incorrect-header.patch \ -" + file://systemd-notify.weston-start \ + " -SRC_URI_append_libc-musl = " file://dont-use-plane-add-prop.patch " +SRC_URI:append:libc-musl = " file://dont-use-plane-add-prop.patch " -SRC_URI[sha256sum] = "5cf5d6ce192e0eb15c1fc861a436bf21b5bb3b91dbdabbdebe83e1f83aa098fe" +SRC_URI[sha256sum] = "5c23964112b90238bed39e5dd1e41cd71a79398813cdc3bbb15a9fdc94e547ae" UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html" inherit meson pkgconfig useradd features_check # depends on virtual/egl # weston-init requires pam enabled if started via systemd -REQUIRED_DISTRO_FEATURES = "opengl ${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', 'pam', '', d)}" +REQUIRED_DISTRO_FEATURES = "wayland opengl ${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', 'pam', '', d)}" DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0" DEPENDS += "wayland wayland-protocols libinput virtual/egl pango wayland-native" @@ -32,13 +31,13 @@ LDFLAGS += "${@bb.utils.contains('DISTRO_FEATURES', 'lto', '-Wl,-z,undefs', '', WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}" -EXTRA_OEMESON += "-Dbackend-default=auto -Dbackend-rdp=false -Dpipewire=false" +EXTRA_OEMESON += "-Dpipewire=false" -PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl clients', '', d)} \ +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', 'pam systemd x11', d)} \ + ${@bb.utils.filter('DISTRO_FEATURES', 'systemd x11', d)} \ ${@bb.utils.contains_any('DISTRO_FEATURES', 'wayland x11', '', 'headless', d)} \ - launch \ + ${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'sysvinit', 'launcher-libseat', '', d)} \ image-jpeg \ screenshare \ shell-desktop \ @@ -57,9 +56,11 @@ PACKAGECONFIG[x11] = "-Dbackend-x11=true,-Dbackend-x11=false,virtual/libx11 libx # Headless Weston PACKAGECONFIG[headless] = "-Dbackend-headless=true,-Dbackend-headless=false" # Weston on framebuffer -PACKAGECONFIG[fbdev] = "-Dbackend-fbdev=true,-Dbackend-fbdev=false,udev mtdev" +PACKAGECONFIG[fbdev] = "-Ddeprecated-backend-fbdev=true,-Ddeprecated-backend-fbdev=false,udev mtdev" +# Weston on RDP +PACKAGECONFIG[rdp] = "-Dbackend-rdp=true,-Dbackend-rdp=false,freerdp" # weston-launch -PACKAGECONFIG[launch] = "-Dweston-launch=true,-Dweston-launch=false,drm" +PACKAGECONFIG[launch] = "-Ddeprecated-weston-launch=true,-Ddeprecated-weston-launch=false,drm" # VA-API desktop recorder PACKAGECONFIG[vaapi] = "-Dbackend-drm-screencast-vaapi=true,-Dbackend-drm-screencast-vaapi=false,libva" # Weston with EGL support @@ -78,8 +79,6 @@ PACKAGECONFIG[colord] = "-Dcolor-management-colord=true,-Dcolor-management-color 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,gstreamer1.0 gstreamer1.0-plugins-base" -# Weston with PAM support -PACKAGECONFIG[pam] = "-Dpam=true,-Dpam=false,libpam" # Weston with screen-share support PACKAGECONFIG[screenshare] = "-Dscreenshare=true,-Dscreenshare=false" # Traditional desktop shell @@ -90,8 +89,10 @@ PACKAGECONFIG[shell-fullscreen] = "-Dshell-fullscreen=true,-Dshell-fullscreen=fa PACKAGECONFIG[shell-ivi] = "-Dshell-ivi=true,-Dshell-ivi=false" # JPEG image loading support PACKAGECONFIG[image-jpeg] = "-Dimage-jpeg=true,-Dimage-jpeg=false, jpeg" +# support libseat based launch +PACKAGECONFIG[launcher-libseat] = "-Dlauncher-libseat=true,-Dlauncher-libseat=false,seatd" -do_install_append() { +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 @@ -108,6 +109,10 @@ do_install_append() { install -Dm 644 ${WORKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland fi + if [ "${@bb.utils.contains('PACKAGECONFIG', 'systemd', 'yes', 'no', d)}" = "yes" ]; then + install -Dm 644 ${WORKDIR}/systemd-notify.weston-start ${D}${datadir}/weston-start/systemd-notify + fi + if [ "${@bb.utils.contains('PACKAGECONFIG', 'launch', 'yes', 'no', d)}" = "yes" ]; then chmod u+s ${D}${bindir}/weston-launch fi @@ -116,20 +121,20 @@ do_install_append() { PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', '${PN}-xwayland', '', d)} \ libweston-${WESTON_MAJOR_VERSION} ${PN}-examples" -FILES_${PN}-dev += "${libdir}/${BPN}/libexec_weston.so" -FILES_${PN} = "${bindir}/weston ${bindir}/weston-terminal ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode ${libexecdir} ${libdir}/${BPN}/*.so* ${datadir}" +FILES:${PN}-dev += "${libdir}/${BPN}/libexec_weston.so" +FILES:${PN} = "${bindir}/weston ${bindir}/weston-terminal ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode ${libexecdir} ${libdir}/${BPN}/*.so* ${datadir}" -FILES_libweston-${WESTON_MAJOR_VERSION} = "${libdir}/lib*${SOLIBS} ${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.so" -SUMMARY_libweston-${WESTON_MAJOR_VERSION} = "Helper library for implementing 'wayland window managers'." +FILES: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}-examples = "${bindir}/*" -FILES_${PN}-xwayland = "${libdir}/libweston-${WESTON_MAJOR_VERSION}/xwayland.so" -RDEPENDS_${PN}-xwayland += "xwayland" +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" +RDEPENDS:${PN} += "xkeyboard-config" +RRECOMMENDS:${PN} = "weston-init liberation-fonts" +RRECOMMENDS:${PN}-dev += "wayland-protocols" USERADD_PACKAGES = "${PN}" -GROUPADD_PARAM_${PN} = "--system weston-launch" +GROUPADD_PARAM:${PN} = "--system weston-launch" |