From 3eab38b3dfc78c6328686226a6a96bdec45bf80a Mon Sep 17 00:00:00 2001 From: Ronan Le Martret Date: Mon, 27 Feb 2017 11:46:52 +0100 Subject: [COMMUNITY] sync wayland from upstream Signed-off-by: Ronan Le Martret --- meta-rcar-gen3/recipes-forward-port/README.md | 3 + .../wayland_fp_morty/libinput_1.4.1.bb | 4 +- .../wayland_fp_morty/mtdev_1.1.5.bb | 18 +++ .../wayland_fp_morty/weston-init.bb | 31 ++++++ .../wayland_fp_morty/weston-init/init | 53 +++++++++ .../wayland_fp_morty/weston-init/weston-start | 69 ++++++++++++ .../wayland_fp_morty/weston-init/weston.service | 12 ++ ...on-1.11-config-option-for-no-input-device.patch | 123 +++++++++++++++++++++ .../wayland_fp_morty/weston_1.11.0.bb | 1 + 9 files changed, 313 insertions(+), 1 deletion(-) create mode 100644 meta-rcar-gen3/recipes-forward-port/README.md create mode 100644 meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/mtdev_1.1.5.bb create mode 100644 meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston-init.bb create mode 100644 meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston-init/init create mode 100755 meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston-init/weston-start create mode 100644 meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston-init/weston.service create mode 100644 meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston/weston-1.11-config-option-for-no-input-device.patch diff --git a/meta-rcar-gen3/recipes-forward-port/README.md b/meta-rcar-gen3/recipes-forward-port/README.md new file mode 100644 index 0000000..794a2b7 --- /dev/null +++ b/meta-rcar-gen3/recipes-forward-port/README.md @@ -0,0 +1,3 @@ +# forward port from poky +## weston + src: poky/meta/recipes-graphics/wayland/ a3fa5ce87619e81d7acfa43340dd18d8f2b2d7dc diff --git a/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/libinput_1.4.1.bb b/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/libinput_1.4.1.bb index c3905f3..3580392 100644 --- a/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/libinput_1.4.1.bb +++ b/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/libinput_1.4.1.bb @@ -20,4 +20,6 @@ PACKAGECONFIG[libunwind] = "--with-libunwind,--without-libunwind,libunwind" PACKAGECONFIG[libwacom] = "--enable-libwacom,--disable-libwacom,libwacom" PACKAGECONFIG[gui] = "--enable-event-gui,--disable-event-gui,cairo gtk+3" -FILES_${PN} += "${libdir}/udev/" +UDEVDIR = "`pkg-config --variable=udevdir udev`" + +EXTRA_OECONF += "--with-udev-dir=${UDEVDIR}" diff --git a/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/mtdev_1.1.5.bb b/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/mtdev_1.1.5.bb new file mode 100644 index 0000000..ccd0ebb --- /dev/null +++ b/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/mtdev_1.1.5.bb @@ -0,0 +1,18 @@ +SUMMARY = "Multitouch Protocol Translation Library" + +DESCRIPTION = "mtdev is a library which transforms all variants of kernel \ +multitouch events to the slotted type B protocol. The events put into mtdev may \ +be from any MT device, specifically type A without contact tracking, type A with \ +contact tracking, or type B with contact tracking" + +HOMEPAGE = "http://bitmath.org/code/mtdev/" +SECTION = "libs" + +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" + +inherit autotools pkgconfig diff --git a/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston-init.bb b/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston-init.bb new file mode 100644 index 0000000..291cd16 --- /dev/null +++ b/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston-init.bb @@ -0,0 +1,31 @@ +SUMMARY = "Startup script and systemd unit file for the Weston Wayland compositor" +LICENSE = "MIT" +LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=4d92cd373abda3937c2bc47fbc49d690" + +SRC_URI = "file://init \ + file://weston.service \ + file://weston-start" + +S = "${WORKDIR}" + +do_install() { + install -Dm755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston + install -Dm0644 ${WORKDIR}/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 + sed -i 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${bindir}/weston-start +} + +inherit allarch update-rc.d distro_features_check systemd + +# rdepends on weston which depends on virtual/egl +REQUIRED_DISTRO_FEATURES = "opengl" + +RDEPENDS_${PN} = "weston kbd" + +INITSCRIPT_NAME = "weston" +INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ." + +SYSTEMD_SERVICE_${PN} = "weston.service" diff --git a/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston-init/init b/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston-init/init new file mode 100644 index 0000000..d3e87c6 --- /dev/null +++ b/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston-init/init @@ -0,0 +1,53 @@ +#!/bin/sh +# +### BEGIN INIT INFO +# Provides: weston +# Required-Start: $local_fs $remote_fs +# Required-Stop: $local_fs $remote_fs +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +### END INIT INFO + +if test -e /etc/default/weston ; then + . /etc/default/weston +fi + +killproc() { + pid=`/bin/pidof $1` + [ "$pid" != "" ] && kill $pid +} + +read CMDLINE < /proc/cmdline +for x in $CMDLINE; do + case $x in + weston=false) + echo "Weston disabled" + exit 0; + ;; + esac +done + +case "$1" in + start) + . /etc/profile + + weston-start -- $OPTARGS + ;; + + stop) + echo "Stopping Weston" + killproc weston + ;; + + restart) + $0 stop + sleep 1 + $0 start + ;; + + *) + echo "usage: $0 { start | stop | restart }" + ;; +esac + +exit 0 diff --git a/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston-init/weston-start b/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston-init/weston-start new file mode 100755 index 0000000..e72fbaa --- /dev/null +++ b/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston-init/weston-start @@ -0,0 +1,69 @@ +#!/bin/sh +# Copyright (C) 2016 O.S. Systems Software LTDA. +# Copyright (C) 2016 Freescale Semiconductor + +export PATH="/sbin:/usr/sbin:/bin:/usr/bin" + +usage() { + cat <] [-- ] +EOF +} + +## Module support +modules_dir=@DATADIR@/weston-start + +# Add weston extra argument +add_weston_argument() { + weston_args="$weston_args $1" +} + +# Add openvt extra argument +add_openvt_argument() { + openvt_args="$openvt_args $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 + fi + openvt_args="$openvt_args $1" + shift +done + +weston_args=$* + +# Load and run modules +if [ -d "$modules_dir" ]; then + for m in "$modules_dir"/*; do + # Skip backup files + if [ "`echo $m | sed -e 's/\~$//'`" != "$m" ]; then + continue + fi + + # process module + . $m + 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 +fi + +exec openvt $openvt_args -- $launcher $weston_args --log=@LOCALSTATEDIR@/log/weston.log diff --git a/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston-init/weston.service b/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston-init/weston.service new file mode 100644 index 0000000..689ce41 --- /dev/null +++ b/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston-init/weston.service @@ -0,0 +1,12 @@ +[Unit] +Description=Weston Wayland Compositor +RequiresMountsFor=/run + +[Service] +User=root +EnvironmentFile=-/etc/default/weston +ExecStart=/usr/bin/weston-start -v -e -- $OPTARGS + +[Install] +WantedBy=multi-user.target + diff --git a/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston/weston-1.11-config-option-for-no-input-device.patch b/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston/weston-1.11-config-option-for-no-input-device.patch new file mode 100644 index 0000000..6f5ad66 --- /dev/null +++ b/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston/weston-1.11-config-option-for-no-input-device.patch @@ -0,0 +1,123 @@ +From bbf2e6ebbd9c051775f43e1e3c3a2f41322342e8 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Daniel=20D=C3=ADaz?= +Date: Fri, 21 Oct 2016 14:03:13 -0500 +Subject: [PATCH] Add configuration option for no input device. +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +[Backported from master, 75b7197.] + +As it has been discussed in the past [1], running Weston +without any input device at launch might be beneficial for +some use cases. + +Certainly, it's best for the vast majority of users (and +the project) to require an input device to be present, as +to avoid frustration and hassle, but for those brave souls +that so prefer, this patch lets them run without any input +device at all. + +This introduces a simple configuration in weston.ini: + [core] + require-input=true + +True is the default, so no behavioral change is introduced. + +[1] https://lists.freedesktop.org/archives/wayland-devel/2015-November/025193.html + +Signed-off-by: Daniel Díaz +--- + man/weston.ini.man | 5 +++++ + src/compositor.h | 4 ++++ + src/libinput-seat.c | 6 ++++++ + src/main.c | 5 +++++ + weston.ini.in | 1 + + 5 files changed, 21 insertions(+) + +diff --git a/man/weston.ini.man b/man/weston.ini.man +index d7c4a6f..c7d0f01 100644 +--- a/man/weston.ini.man ++++ b/man/weston.ini.man +@@ -169,6 +169,11 @@ time, the one specified in the command-line will be used. On the other + hand, if none of these sets the value, default idle timeout will be + set to 300 seconds. + .RS ++.PP ++.RE ++.TP 7 ++.BI "require-input=" true ++require an input device for launch + + .SH "LIBINPUT SECTION" + The +diff --git a/src/compositor.h b/src/compositor.h +index 0bbf458..476b650 100644 +--- a/src/compositor.h ++++ b/src/compositor.h +@@ -803,6 +803,10 @@ struct weston_compositor { + + void *user_data; + void (*exit)(struct weston_compositor *c); ++ ++ /* Whether to let the compositor run without any input device. */ ++ bool require_input; ++ + }; + + struct weston_buffer { +diff --git a/src/libinput-seat.c b/src/libinput-seat.c +index 8ce0ee0..e1fdcf0 100644 +--- a/src/libinput-seat.c ++++ b/src/libinput-seat.c +@@ -255,6 +255,12 @@ udev_input_enable(struct udev_input *input) + devices_found = 1; + } + ++ if (devices_found == 0 && !c->require_input) { ++ weston_log("warning: no input devices found, but none required " ++ "as per configuration.\n"); ++ return 0; ++ } ++ + if (devices_found == 0) { + weston_log( + "warning: no input devices on entering Weston. " +diff --git a/src/main.c b/src/main.c +index 3279ac6..09905ea 100644 +--- a/src/main.c ++++ b/src/main.c +@@ -1298,6 +1298,7 @@ int main(int argc, char *argv[]) + struct wl_client *primary_client; + struct wl_listener primary_client_destroyed; + struct weston_seat *seat; ++ int require_input; + + const struct weston_option core_options[] = { + { WESTON_OPTION_STRING, "backend", 'B', &backend }, +@@ -1373,6 +1374,10 @@ int main(int argc, char *argv[]) + if (weston_compositor_init_config(ec, config) < 0) + goto out; + ++ weston_config_section_get_bool(section, "require-input", ++ &require_input, true); ++ ec->require_input = require_input; ++ + if (load_backend(ec, backend, &argc, argv, config) < 0) { + weston_log("fatal: failed to create compositor backend\n"); + goto out; +diff --git a/weston.ini.in b/weston.ini.in +index 14a4c0c..d837fb5 100644 +--- a/weston.ini.in ++++ b/weston.ini.in +@@ -2,6 +2,7 @@ + #modules=xwayland.so,cms-colord.so + #shell=desktop-shell.so + #gbm-format=xrgb2101010 ++#require-input=true + + [shell] + background-image=/usr/share/backgrounds/gnome/Aqua.jpg +-- +1.9.1 + diff --git a/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston_1.11.0.bb b/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston_1.11.0.bb index 3ad309d..9740ce9 100644 --- a/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston_1.11.0.bb +++ b/meta-rcar-gen3/recipes-forward-port/wayland_fp_morty/weston_1.11.0.bb @@ -14,6 +14,7 @@ SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \ file://xwayland.weston-start \ file://make-weston-launch-exit-for-unrecognized-option.patch \ file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \ + file://weston-1.11-config-option-for-no-input-device.patch \ " SRC_URI[md5sum] = "bc6f90a2039163804aecfa663b69c4c2" SRC_URI[sha256sum] = "05e086e9f186a06843b9f7a5e1abf19347b1a6e4be26d7e74927abc17b6b7125" -- cgit 1.2.3-korg