summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berton <fabio.berton@ossystems.com.br>2017-05-15 18:06:47 -0300
committerOtavio Salvador <otavio@ossystems.com.br>2017-05-19 07:57:43 -0300
commitfa9281613e2b3b669b06b085ffaf51d61e48a94b (patch)
treefe4d2433c28be2d2662e92e5f2f42f8a28026771
parent15d531bff1d30316c740a8fe85a024b1a69b8c5a (diff)
downloadmeta-freescale-fa9281613e2b3b669b06b085ffaf51d61e48a94b.tar.gz
weston: Use weston 1.11.1 for mx6 and mx7 machines
As EGL support was removed from weston on commit: https://github.com/wayland-project/weston/commit/e77f8ad79bdf3613dc7e587ea0cf5b9d39e4f8e0 we can't use version 2.0.0. Add latest version with EGL support, 1.11.1 and set mx6 and mx7 machines to use this version. Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
-rw-r--r--conf/machine/include/imx-base.inc6
-rw-r--r--recipes-graphics/wayland/weston/0001-Add-configuration-option-for-no-input-device.patch112
-rw-r--r--recipes-graphics/wayland/weston/0001-configure.ac-Fix-wayland-protocols-path.patch29
-rw-r--r--recipes-graphics/wayland/weston/0001-make-error-portable.patch70
-rw-r--r--recipes-graphics/wayland/weston/0001-shared-include-stdint.h-for-int32_t.patch23
-rw-r--r--recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch166
-rw-r--r--recipes-graphics/wayland/weston/weston.desktop9
-rw-r--r--recipes-graphics/wayland/weston/weston.pngbin0 -> 2383 bytes
-rw-r--r--recipes-graphics/wayland/weston/xwayland.weston-start7
-rw-r--r--recipes-graphics/wayland/weston_%.bbappend2
-rw-r--r--recipes-graphics/wayland/weston_1.11.1.bb113
11 files changed, 536 insertions, 1 deletions
diff --git a/conf/machine/include/imx-base.inc b/conf/machine/include/imx-base.inc
index 40689772..6f3b39c2 100644
--- a/conf/machine/include/imx-base.inc
+++ b/conf/machine/include/imx-base.inc
@@ -88,7 +88,7 @@ MACHINE_SOCARCH_SUFFIX_use-mainline-bsp = "-imx"
88 88
89MACHINE_ARCH_FILTER = "virtual/kernel" 89MACHINE_ARCH_FILTER = "virtual/kernel"
90MACHINE_SOCARCH_FILTER_append_imxvpu = " imx-vpu libimxvpuapi imx-codec imx-vpuwrap imx-parser" 90MACHINE_SOCARCH_FILTER_append_imxvpu = " imx-vpu libimxvpuapi imx-codec imx-vpuwrap imx-parser"
91MACHINE_SOCARCH_FILTER_append_imxgpu2d = " virtual/libopenvg virtual/libgles1 virtual/libgles2 virtual/egl virtual/mesa virtual/libgl virtual/libg2d cairo pango" 91MACHINE_SOCARCH_FILTER_append_imxgpu2d = " virtual/libopenvg virtual/libgles1 virtual/libgles2 virtual/egl virtual/mesa virtual/libgl virtual/libg2d cairo pango weston"
92MACHINE_SOCARCH_FILTER_append_imxpxp = " imx-codec imx-parser" 92MACHINE_SOCARCH_FILTER_append_imxpxp = " imx-codec imx-parser"
93MACHINE_SOCARCH_FILTER_append_use-mainline-bsp = " \ 93MACHINE_SOCARCH_FILTER_append_use-mainline-bsp = " \
94 qtbase \ 94 qtbase \
@@ -215,5 +215,9 @@ KERNEL_IMAGETYPE = "zImage"
215 215
216MACHINE_FEATURES = "usbgadget usbhost vfat alsa touchscreen" 216MACHINE_FEATURES = "usbgadget usbhost vfat alsa touchscreen"
217 217
218# Use weston 1.11.1 for mx6 and mx7 machines
219PREFERRED_VERSION_weston_mx6 = "1.11.1"
220PREFERRED_VERSION_weston_mx7 = "1.11.1"
221
218# Add the ability to specify _imx machines 222# Add the ability to specify _imx machines
219MACHINEOVERRIDES =. "imx:" 223MACHINEOVERRIDES =. "imx:"
diff --git a/recipes-graphics/wayland/weston/0001-Add-configuration-option-for-no-input-device.patch b/recipes-graphics/wayland/weston/0001-Add-configuration-option-for-no-input-device.patch
new file mode 100644
index 00000000..c45f3add
--- /dev/null
+++ b/recipes-graphics/wayland/weston/0001-Add-configuration-option-for-no-input-device.patch
@@ -0,0 +1,112 @@
1From 75b7197f4e072a4e2de124ddbe93b85cffb1c0f8 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Daniel=20D=C3=ADaz?= <daniel.diaz@linaro.org>
3Date: Fri, 21 Oct 2016 14:03:13 -0500
4Subject: [PATCH] Add configuration option for no input device.
5MIME-Version: 1.0
6Content-Type: text/plain; charset=UTF-8
7Content-Transfer-Encoding: 8bit
8
9As it has been discussed in the past [1], running Weston
10without any input device at launch might be beneficial for
11some use cases.
12
13Certainly, it's best for the vast majority of users (and
14the project) to require an input device to be present, as
15to avoid frustration and hassle, but for those brave souls
16that so prefer, this patch lets them run without any input
17device at all.
18
19This introduces a simple configuration in weston.ini:
20 [core]
21 require-input=true
22
23True is the default, so no behavioral change is introduced.
24
25[1] https://lists.freedesktop.org/archives/wayland-devel/2015-November/025193.html
26
27Signed-off-by: Daniel Díaz <daniel.diaz@linaro.org>
28Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
29Reviewed-by: Daniel Stone <daniels@collabora.com>
30
31Upstream-Status: backport from
32https://cgit.freedesktop.org/wayland/weston/commit/?id=75b7197f
33---
34 man/weston.ini.man | 5 +++++
35 src/compositor.h | 3 +++
36 src/libinput-seat.c | 6 ++++++
37 src/main.c | 5 +++++
38 weston.ini.in | 1 +
39 5 files changed, 20 insertions(+)
40
41--- a/src/main.c
42+++ b/src/main.c
43@@ -1298,6 +1298,7 @@ int main(int argc, char *argv[])
44 struct wl_client *primary_client;
45 struct wl_listener primary_client_destroyed;
46 struct weston_seat *seat;
47+ int require_input;
48
49 const struct weston_option core_options[] = {
50 { WESTON_OPTION_STRING, "backend", 'B', &backend },
51@@ -1373,6 +1374,10 @@ int main(int argc, char *argv[])
52 if (weston_compositor_init_config(ec, config) < 0)
53 goto out;
54
55+ weston_config_section_get_bool(section, "require-input",
56+ &require_input, true);
57+ ec->require_input = require_input;
58+
59 if (load_backend(ec, backend, &argc, argv, config) < 0) {
60 weston_log("fatal: failed to create compositor backend\n");
61 goto out;
62--- a/src/compositor.h
63+++ b/src/compositor.h
64@@ -803,6 +803,9 @@ struct weston_compositor {
65
66 void *user_data;
67 void (*exit)(struct weston_compositor *c);
68+
69+ /* Whether to let the compositor run without any input device. */
70+ bool require_input;
71 };
72
73 struct weston_buffer {
74--- a/src/libinput-seat.c
75+++ b/src/libinput-seat.c
76@@ -255,6 +255,12 @@ udev_input_enable(struct udev_input *inp
77 devices_found = 1;
78 }
79
80+ if (devices_found == 0 && !c->require_input) {
81+ weston_log("warning: no input devices found, but none required "
82+ "as per configuration.\n");
83+ return 0;
84+ }
85+
86 if (devices_found == 0) {
87 weston_log(
88 "warning: no input devices on entering Weston. "
89--- a/man/weston.ini.man
90+++ b/man/weston.ini.man
91@@ -169,6 +169,11 @@ time, the one specified in the command-l
92 hand, if none of these sets the value, default idle timeout will be
93 set to 300 seconds.
94 .RS
95+.PP
96+.RE
97+.TP 7
98+.BI "require-input=" true
99+require an input device for launch
100
101 .SH "LIBINPUT SECTION"
102 The
103--- a/weston.ini.in
104+++ b/weston.ini.in
105@@ -2,6 +2,7 @@
106 #modules=xwayland.so,cms-colord.so
107 #shell=desktop-shell.so
108 #gbm-format=xrgb2101010
109+#require-input=true
110
111 [shell]
112 background-image=/usr/share/backgrounds/gnome/Aqua.jpg
diff --git a/recipes-graphics/wayland/weston/0001-configure.ac-Fix-wayland-protocols-path.patch b/recipes-graphics/wayland/weston/0001-configure.ac-Fix-wayland-protocols-path.patch
new file mode 100644
index 00000000..edd3b918
--- /dev/null
+++ b/recipes-graphics/wayland/weston/0001-configure.ac-Fix-wayland-protocols-path.patch
@@ -0,0 +1,29 @@
1From 1cfc1434a5d385a74de593ec7601674dba39e2fe Mon Sep 17 00:00:00 2001
2From: Jussi Kukkonen <jussi.kukkonen@intel.com>
3Date: Wed, 11 May 2016 16:16:30 +0300
4Subject: [PATCH] configure.ac: Fix wayland-protocols path
5
6The wayland-protocols directory is used during build: Fix the path
7to point to sysroot specified in recipe.
8
9Normally PKG_CONFIG_SYSROOT_DIR could be used in configure.ac but that
10breaks multilib weston as it would point to multilib sysroot when the
11(allarch) wayland-protocols is actually in the machine sysroot.
12
13Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
14Upstream-Status: Inappropriate [embedded specific]
15---
16 configure.ac | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19--- a/configure.ac
20+++ b/configure.ac
21@@ -187,7 +187,7 @@ PKG_CHECK_MODULES(LIBINPUT_BACKEND, [lib
22 PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
23
24 PKG_CHECK_MODULES(WAYLAND_PROTOCOLS, [wayland-protocols >= 1.2],
25- [ac_wayland_protocols_pkgdatadir=`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`])
26+ [ac_wayland_protocols_pkgdatadir=${WAYLAND_PROTOCOLS_SYSROOT_DIR}`$PKG_CONFIG --variable=pkgdatadir wayland-protocols`])
27 AC_SUBST(WAYLAND_PROTOCOLS_DATADIR, $ac_wayland_protocols_pkgdatadir)
28
29 AC_ARG_ENABLE(wayland-compositor, [ --enable-wayland-compositor],,
diff --git a/recipes-graphics/wayland/weston/0001-make-error-portable.patch b/recipes-graphics/wayland/weston/0001-make-error-portable.patch
new file mode 100644
index 00000000..f7b52843
--- /dev/null
+++ b/recipes-graphics/wayland/weston/0001-make-error-portable.patch
@@ -0,0 +1,70 @@
1From c22e90365d89346258394833cbcad03ff32b2e27 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 29 May 2015 20:56:00 -0700
4Subject: [PATCH weston] make error() portable
5
6error() is not posix but gnu extension so may not be available on all
7kind of systemsi e.g. musl.
8
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11Upstream-Status: Submitted
12
13 configure.ac | 2 ++
14 src/weston-error.h | 20 ++++++++++++++++++++
15 src/weston-launch.c | 2 +-
16 3 files changed, 23 insertions(+), 1 deletion(-)
17 create mode 100644 src/weston-error.h
18
19--- a/configure.ac
20+++ b/configure.ac
21@@ -60,6 +60,8 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[],
22 [[#include <time.h>]])
23 AC_CHECK_HEADERS([execinfo.h])
24
25+AC_CHECK_HEADERS([error.h])
26+
27 AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate])
28
29 COMPOSITOR_MODULES="wayland-server >= $WAYLAND_PREREQ_VERSION pixman-1 >= 0.25.2"
30--- /dev/null
31+++ b/src/weston-error.h
32@@ -0,0 +1,20 @@
33+#ifndef _WESTON_ERROR_H
34+#define _WESTON_ERROR_H
35+
36+#if defined(HAVE_ERROR_H)
37+#include <error.h>
38+#else
39+#include <err.h>
40+#include <string.h>
41+#define _weston_error(S, E, F, ...) do { \
42+ if (E) \
43+ err(S, F ": %s", ##__VA_ARGS__, strerror(E)); \
44+ else \
45+ err(S, F, ##__VA_ARGS__); \
46+} while(0)
47+
48+#define error _weston_error
49+#endif
50+
51+#endif
52+
53--- a/src/weston-launch.c
54+++ b/src/weston-launch.c
55@@ -33,7 +33,6 @@
56 #include <poll.h>
57 #include <errno.h>
58
59-#include <error.h>
60 #include <getopt.h>
61
62 #include <sys/types.h>
63@@ -59,6 +58,7 @@
64 #endif
65
66 #include "weston-launch.h"
67+#include "weston-error.h"
68
69 #define DRM_MAJOR 226
70
diff --git a/recipes-graphics/wayland/weston/0001-shared-include-stdint.h-for-int32_t.patch b/recipes-graphics/wayland/weston/0001-shared-include-stdint.h-for-int32_t.patch
new file mode 100644
index 00000000..ee66c20a
--- /dev/null
+++ b/recipes-graphics/wayland/weston/0001-shared-include-stdint.h-for-int32_t.patch
@@ -0,0 +1,23 @@
1From ba02b8abe4e2afac2bfbf2559972d5059d75a041 Mon Sep 17 00:00:00 2001
2From: Jussi Kukkonen <jussi.kukkonen@intel.com>
3Date: Sat, 16 Jul 2016 22:50:19 +0300
4Subject: [PATCH weston] shared: include stdint.h for int32_t
5
6This fixes build on musl.
7
8Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
9Upstream-Status: Submitted
10---
11 shared/xalloc.h | 1 +
12 1 file changed, 1 insertion(+)
13
14--- a/shared/xalloc.h
15+++ b/shared/xalloc.h
16@@ -30,6 +30,7 @@
17 extern "C" {
18 #endif
19
20+#include <stdint.h>
21 #include <stdlib.h>
22 #include <string.h>
23
diff --git a/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch b/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
new file mode 100644
index 00000000..d684b1c1
--- /dev/null
+++ b/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
@@ -0,0 +1,166 @@
1From d02226b3d5872b184c1d50c7f4706ac9467ffb81 Mon Sep 17 00:00:00 2001
2From: Tom Hochstein <tom.hochstein@nxp.com>
3Date: Fri, 15 Jul 2016 11:00:15 +0300
4Subject: [PATCH] weston-launch: Provide a default version that doesn't require
5 PAM
6
7weston-launch requires PAM for starting weston as a non-root user.
8
9Since starting weston as root is a valid use case by itself, if
10PAM is not available, provide a default version of weston-launch
11without non-root-user support.
12
13Upstream-Status: Pending
14
15Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
16---
17 configure.ac | 9 +++++++--
18 src/weston-launch.c | 20 ++++++++++++++++++++
19 2 files changed, 27 insertions(+), 2 deletions(-)
20
21--- a/configure.ac
22+++ b/configure.ac
23@@ -416,13 +416,17 @@ AC_ARG_ENABLE(resize-optimization,
24 AS_IF([test "x$enable_resize_optimization" = "xyes"],
25 [AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a performance optimization])])
26
27+AC_ARG_WITH(pam,
28+ AS_HELP_STRING([--with-pam], [Use PAM]),
29+ [use_pam=$withval], [use_pam=yes])
30 AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes)
31 AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch == xyes)
32-if test x$enable_weston_launch == xyes; then
33+if test x$enable_weston_launch = xyes -a x$use_pam = xyes; then
34 WESTON_SEARCH_LIBS([PAM], [pam], [pam_open_session], [have_pam=yes], [have_pam=no])
35 if test x$have_pam == xno; then
36- AC_ERROR([weston-launch requires pam])
37+ AC_ERROR([PAM support is explicitly requested, but libpam couldn't be found])
38 fi
39+ AC_DEFINE([HAVE_PAM], [1], [Define if PAM is available])
40 fi
41
42 AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes")
43@@ -673,6 +677,7 @@ AC_MSG_RESULT([
44 Enable developer documentation ${enable_devdocs}
45
46 weston-launch utility ${enable_weston_launch}
47+ PAM support ${use_pam}
48 systemd-login support ${have_systemd_login}
49 systemd notify support ${enable_systemd_notify}
50
51--- a/src/weston-launch.c
52+++ b/src/weston-launch.c
53@@ -51,7 +51,9 @@
54
55 #include <pwd.h>
56 #include <grp.h>
57+#ifdef HAVE_PAM
58 #include <security/pam_appl.h>
59+#endif
60
61 #ifdef HAVE_SYSTEMD_LOGIN
62 #include <systemd/sd-login.h>
63@@ -93,8 +95,10 @@ drmSetMaster(int drm_fd)
64 #endif
65
66 struct weston_launch {
67+#ifdef HAVE_PAM
68 struct pam_conv pc;
69 pam_handle_t *ph;
70+#endif
71 int tty;
72 int ttynr;
73 int sock[2];
74@@ -181,6 +185,7 @@ weston_launch_allowed(struct weston_laun
75 return false;
76 }
77
78+#ifdef HAVE_PAM
79 static int
80 pam_conversation_fn(int msg_count,
81 const struct pam_message **messages,
82@@ -221,6 +226,7 @@ setup_pam(struct weston_launch *wl)
83
84 return 0;
85 }
86+#endif
87
88 static int
89 setup_launcher_socket(struct weston_launch *wl)
90@@ -414,6 +420,7 @@ quit(struct weston_launch *wl, int statu
91 close(wl->signalfd);
92 close(wl->sock[0]);
93
94+#ifdef HAVE_PAM
95 if (wl->new_user) {
96 err = pam_close_session(wl->ph, 0);
97 if (err)
98@@ -421,6 +428,7 @@ quit(struct weston_launch *wl, int statu
99 err, pam_strerror(wl->ph, err));
100 pam_end(wl->ph, err);
101 }
102+#endif
103
104 if (ioctl(wl->tty, KDSKBMUTE, 0) &&
105 ioctl(wl->tty, KDSKBMODE, wl->kb_mode))
106@@ -600,6 +608,7 @@ setup_session(struct weston_launch *wl)
107 setenv("HOME", wl->pw->pw_dir, 1);
108 setenv("SHELL", wl->pw->pw_shell, 1);
109
110+#ifdef HAVE_PAM
111 env = pam_getenvlist(wl->ph);
112 if (env) {
113 for (i = 0; env[i]; ++i) {
114@@ -608,6 +617,7 @@ setup_session(struct weston_launch *wl)
115 }
116 free(env);
117 }
118+#endif
119 }
120
121 static void
122@@ -665,7 +675,9 @@ static void
123 help(const char *name)
124 {
125 fprintf(stderr, "Usage: %s [args...] [-- [weston args..]]\n", name);
126+#ifdef HAVE_PAM
127 fprintf(stderr, " -u, --user Start session as specified username\n");
128+#endif
129 fprintf(stderr, " -t, --tty Start session on alternative tty\n");
130 fprintf(stderr, " -v, --verbose Be verbose\n");
131 fprintf(stderr, " -h, --help Display this help message\n");
132@@ -678,7 +690,9 @@ main(int argc, char *argv[])
133 int i, c;
134 char *tty = NULL;
135 struct option opts[] = {
136+#ifdef HAVE_PAM
137 { "user", required_argument, NULL, 'u' },
138+#endif
139 { "tty", required_argument, NULL, 't' },
140 { "verbose", no_argument, NULL, 'v' },
141 { "help", no_argument, NULL, 'h' },
142@@ -690,9 +704,13 @@ main(int argc, char *argv[])
143 while ((c = getopt_long(argc, argv, "u:t::vh", opts, &i)) != -1) {
144 switch (c) {
145 case 'u':
146+#ifdef HAVE_PAM
147 wl.new_user = optarg;
148 if (getuid() != 0)
149 error(1, 0, "Permission denied. -u allowed for root only");
150+#else
151+ error(1, 0, "-u is unsupported in this weston-launch build");
152+#endif
153 break;
154 case 't':
155 tty = optarg;
156@@ -732,8 +750,10 @@ main(int argc, char *argv[])
157 if (setup_tty(&wl, tty) < 0)
158 exit(EXIT_FAILURE);
159
160+#ifdef HAVE_PAM
161 if (wl.new_user && setup_pam(&wl) < 0)
162 exit(EXIT_FAILURE);
163+#endif
164
165 if (setup_launcher_socket(&wl) < 0)
166 exit(EXIT_FAILURE);
diff --git a/recipes-graphics/wayland/weston/weston.desktop b/recipes-graphics/wayland/weston/weston.desktop
new file mode 100644
index 00000000..1086ae8b
--- /dev/null
+++ b/recipes-graphics/wayland/weston/weston.desktop
@@ -0,0 +1,9 @@
1[Desktop Entry]
2Encoding=UTF-8
3Type=Application
4Name=Weston
5Comment=Wayland Compostitor
6Exec=weston
7Icon=weston
8Terminal=false
9Categories=Utility;
diff --git a/recipes-graphics/wayland/weston/weston.png b/recipes-graphics/wayland/weston/weston.png
new file mode 100644
index 00000000..ea8b7e0e
--- /dev/null
+++ b/recipes-graphics/wayland/weston/weston.png
Binary files differ
diff --git a/recipes-graphics/wayland/weston/xwayland.weston-start b/recipes-graphics/wayland/weston/xwayland.weston-start
new file mode 100644
index 00000000..b483c97c
--- /dev/null
+++ b/recipes-graphics/wayland/weston/xwayland.weston-start
@@ -0,0 +1,7 @@
1#!/bin/sh
2
3if type Xwayland >/dev/null 2>/dev/null; then
4 mkdir -p /tmp/.X11-unix
5
6 add_weston_argument "--modules=xwayland.so"
7fi
diff --git a/recipes-graphics/wayland/weston_%.bbappend b/recipes-graphics/wayland/weston_%.bbappend
index 74d2359e..ccbf393a 100644
--- a/recipes-graphics/wayland/weston_%.bbappend
+++ b/recipes-graphics/wayland/weston_%.bbappend
@@ -42,3 +42,5 @@ EXTRA_OECONF_IMX_imxpxp = "${EXTRA_OECONF_IMX_COMMON}"
42EXTRA_OECONF_IMX_imxgpu2d = "${EXTRA_OECONF_IMX_COMMON}" 42EXTRA_OECONF_IMX_imxgpu2d = "${EXTRA_OECONF_IMX_COMMON}"
43 43
44EXTRA_OECONF_append = " ${EXTRA_OECONF_IMX}" 44EXTRA_OECONF_append = " ${EXTRA_OECONF_IMX}"
45
46PACKAGE_ARCH = "${MACHINE_SOCARCH}"
diff --git a/recipes-graphics/wayland/weston_1.11.1.bb b/recipes-graphics/wayland/weston_1.11.1.bb
new file mode 100644
index 00000000..22b30ad2
--- /dev/null
+++ b/recipes-graphics/wayland/weston_1.11.1.bb
@@ -0,0 +1,113 @@
1SUMMARY = "Weston, a Wayland compositor"
2DESCRIPTION = "Weston is the reference implementation of a Wayland compositor"
3HOMEPAGE = "http://wayland.freedesktop.org"
4LICENSE = "MIT"
5LIC_FILES_CHKSUM = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70 \
6 file://src/compositor.c;endline=26;md5=e342df749174a8ee11065583157c7a38"
7
8SRC_URI = "https://wayland.freedesktop.org/releases/${BPN}-${PV}.tar.xz \
9 file://weston.png \
10 file://weston.desktop \
11 file://0001-make-error-portable.patch \
12 file://0001-configure.ac-Fix-wayland-protocols-path.patch \
13 file://0001-shared-include-stdint.h-for-int32_t.patch \
14 file://xwayland.weston-start \
15 file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \
16 file://0001-Add-configuration-option-for-no-input-device.patch \
17"
18SRC_URI[md5sum] = "c5fdc02ab67d33c0fca8f72d341facdf"
19SRC_URI[sha256sum] = "548973496a5c8613d6690f9120f21066946a544df65ce4fe0ef153a8dc0bf6de"
20
21inherit autotools pkgconfig useradd distro_features_check
22# depends on virtual/egl
23REQUIRED_DISTRO_FEATURES = "opengl"
24
25DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0 jpeg"
26DEPENDS += "wayland wayland-protocols libinput virtual/egl pango wayland-native"
27
28EXTRA_OECONF = "--enable-setuid-install \
29 --disable-rpi-compositor \
30 --disable-rdp-compositor \
31 WAYLAND_PROTOCOLS_SYSROOT_DIR=${RECIPE_SYSROOT} \
32 "
33EXTRA_OECONF_append_qemux86 = "\
34 WESTON_NATIVE_BACKEND=fbdev-backend.so \
35 "
36EXTRA_OECONF_append_qemux86-64 = "\
37 WESTON_NATIVE_BACKEND=fbdev-backend.so \
38 "
39PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl', '', d)} \
40 ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \
41 ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd x11', d)} \
42 clients launch"
43#
44# Compositor choices
45#
46# Weston on KMS
47PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm udev virtual/mesa mtdev"
48# Weston on Wayland (nested Weston)
49PACKAGECONFIG[wayland] = "--enable-wayland-compositor,--disable-wayland-compositor,virtual/mesa"
50# Weston on X11
51PACKAGECONFIG[x11] = "--enable-x11-compositor,--disable-x11-compositor,virtual/libx11 libxcb libxcb libxcursor cairo"
52# Headless Weston
53PACKAGECONFIG[headless] = "--enable-headless-compositor,--disable-headless-compositor"
54# Weston on framebuffer
55PACKAGECONFIG[fbdev] = "--enable-fbdev-compositor,--disable-fbdev-compositor,udev mtdev"
56# weston-launch
57PACKAGECONFIG[launch] = "--enable-weston-launch,--disable-weston-launch,drm"
58# VA-API desktop recorder
59PACKAGECONFIG[vaapi] = "--enable-vaapi-recorder,--disable-vaapi-recorder,libva"
60# Weston with EGL support
61PACKAGECONFIG[egl] = "--enable-egl --enable-simple-egl-clients,--disable-egl --disable-simple-egl-clients,virtual/egl"
62# Weston with cairo glesv2 support
63PACKAGECONFIG[cairo-glesv2] = "--with-cairo-glesv2,--with-cairo=image,cairo"
64# Weston with lcms support
65PACKAGECONFIG[lcms] = "--enable-lcms,--disable-lcms,lcms"
66# Weston with webp support
67PACKAGECONFIG[webp] = "--with-webp,--without-webp,libwebp"
68# Weston with unwinding support
69PACKAGECONFIG[libunwind] = "--enable-libunwind,--disable-libunwind,libunwind"
70# Weston with systemd-login support
71PACKAGECONFIG[systemd] = "--enable-systemd-login,--disable-systemd-login,systemd dbus"
72# Weston with Xwayland support (requires X11 and Wayland)
73PACKAGECONFIG[xwayland] = "--enable-xwayland,--disable-xwayland"
74# colord CMS support
75PACKAGECONFIG[colord] = "--enable-colord,--disable-colord,colord"
76# Clients support
77PACKAGECONFIG[clients] = "--enable-clients --enable-simple-clients --enable-demo-clients-install,--disable-clients --disable-simple-clients"
78# Weston with PAM support
79PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam"
80
81do_install_append() {
82 # Weston doesn't need the .la files to load modules, so wipe them
83 rm -f ${D}/${libdir}/weston/*.la
84
85 # If X11, ship a desktop file to launch it
86 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" ]; then
87 install -d ${D}${datadir}/applications
88 install ${WORKDIR}/weston.desktop ${D}${datadir}/applications
89
90 install -d ${D}${datadir}/icons/hicolor/48x48/apps
91 install ${WORKDIR}/weston.png ${D}${datadir}/icons/hicolor/48x48/apps
92 fi
93
94 if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "yes" ]; then
95 install -Dm 644 ${WORKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland
96 fi
97}
98
99PACKAGE_BEFORE_PN += "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', '${PN}-xwayland', '', d)}"
100PACKAGES += "${PN}-examples"
101
102FILES_${PN} = "${bindir}/weston ${bindir}/weston-terminal ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode ${libexecdir} ${libdir}/${BPN}/*.so ${datadir}"
103FILES_${PN}-examples = "${bindir}/*"
104
105FILES_${PN}-xwayland = "${libdir}/${BPN}/xwayland.so"
106RDEPENDS_${PN}-xwayland += "xserver-xorg-xwayland"
107
108RDEPENDS_${PN} += "xkeyboard-config"
109RRECOMMENDS_${PN} = "liberation-fonts"
110RRECOMMENDS_${PN}-dev += "wayland-protocols"
111
112USERADD_PACKAGES = "${PN}"
113GROUPADD_PARAM_${PN} = "--system weston-launch"