summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Hochstein <tom.hochstein@nxp.com>2018-06-25 21:11:38 -0500
committerOtavio Salvador <otavio@ossystems.com.br>2018-07-05 15:32:27 -0300
commitfa818a55a70d0c6df6af57b477b4bd2ea9939953 (patch)
treea58d37de5fc15acab5c3dda27efee43a4836f182
parent08d037b0ace4c71ae77b5e4bc6d990252995cf91 (diff)
downloadmeta-freescale-fa818a55a70d0c6df6af57b477b4bd2ea9939953.tar.gz
weston: Copy upstream 4.0 recipe
http://git.yoctoproject.org/cgit.cgi/poky/tree/?h=master-next&id=d05a268c5069c3fb47ceed47862ba36b5f49ebd3 Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
-rw-r--r--conf/machine/include/imx-base.inc5
-rw-r--r--recipes-graphics/wayland/weston/0001-make-error-portable.patch78
-rw-r--r--recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch173
-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_4.0.0.imx.bb114
7 files changed, 384 insertions, 2 deletions
diff --git a/conf/machine/include/imx-base.inc b/conf/machine/include/imx-base.inc
index ead7ea3f..bd2a2aa3 100644
--- a/conf/machine/include/imx-base.inc
+++ b/conf/machine/include/imx-base.inc
@@ -247,8 +247,9 @@ PREFERRED_PROVIDER_virtual/libg2d_mx6ul = ""
247PREFERRED_PROVIDER_virtual/libg2d_mx6ull = "" 247PREFERRED_PROVIDER_virtual/libg2d_mx6ull = ""
248PREFERRED_PROVIDER_virtual/libg2d_mx7ulp ?= "imx-gpu-viv" 248PREFERRED_PROVIDER_virtual/libg2d_mx7ulp ?= "imx-gpu-viv"
249 249
250PREFERRED_VERSION_weston_mx6 ?= "2.0.0" 250PREFERRED_VERSION_weston_mx6 ?= "4.0.0.imx"
251PREFERRED_VERSION_weston_mx7 ?= "2.0.0" 251PREFERRED_VERSION_weston_mx7 ?= "4.0.0.imx"
252PREFERRED_VERSION_weston_mx8 ?= "4.0.0.imx"
252 253
253# Use i.MX libdrm Version 254# Use i.MX libdrm Version
254PREFERRED_VERSION_libdrm_mx6 ?= "2.4.84.imx" 255PREFERRED_VERSION_libdrm_mx6 ?= "2.4.84.imx"
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..09ec1559
--- /dev/null
+++ b/recipes-graphics/wayland/weston/0001-make-error-portable.patch
@@ -0,0 +1,78 @@
1From ad1d2161c811cff25d1684c33611f300adb753bc 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] 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
9Upstream-Status: Submitted
10
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12
13---
14 configure.ac | 2 ++
15 libweston/weston-error.h | 20 ++++++++++++++++++++
16 libweston/weston-launch.c | 2 +-
17 3 files changed, 23 insertions(+), 1 deletion(-)
18 create mode 100644 libweston/weston-error.h
19
20diff --git a/configure.ac b/configure.ac
21index 7aebbdb..dc9c802 100644
22--- a/configure.ac
23+++ b/configure.ac
24@@ -109,6 +109,8 @@ AC_CHECK_DECL(CLOCK_MONOTONIC,[],
25 [[#include <time.h>]])
26 AC_CHECK_HEADERS([execinfo.h])
27
28+AC_CHECK_HEADERS([error.h])
29+
30 AC_CHECK_FUNCS([mkostemp strchrnul initgroups posix_fallocate])
31
32 # check for libdrm as a build-time dependency only
33diff --git a/libweston/weston-error.h b/libweston/weston-error.h
34new file mode 100644
35index 0000000..2089d02
36--- /dev/null
37+++ b/libweston/weston-error.h
38@@ -0,0 +1,20 @@
39+#ifndef _WESTON_ERROR_H
40+#define _WESTON_ERROR_H
41+
42+#if defined(HAVE_ERROR_H)
43+#include <error.h>
44+#else
45+#include <err.h>
46+#include <string.h>
47+#define _weston_error(S, E, F, ...) do { \
48+ if (E) \
49+ err(S, F ": %s", ##__VA_ARGS__, strerror(E)); \
50+ else \
51+ err(S, F, ##__VA_ARGS__); \
52+} while(0)
53+
54+#define error _weston_error
55+#endif
56+
57+#endif
58+
59diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c
60index 1adcf21..166bf3b 100644
61--- a/libweston/weston-launch.c
62+++ b/libweston/weston-launch.c
63@@ -33,7 +33,6 @@
64 #include <poll.h>
65 #include <errno.h>
66
67-#include <error.h>
68 #include <getopt.h>
69
70 #include <sys/types.h>
71@@ -59,6 +58,7 @@
72 #endif
73
74 #include "weston-launch.h"
75+#include "weston-error.h"
76
77 #define DRM_MAJOR 226
78
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..d648538b
--- /dev/null
+++ b/recipes-graphics/wayland/weston/0001-weston-launch-Provide-a-default-version-that-doesn-t.patch
@@ -0,0 +1,173 @@
1From b98b9dbda902225cdd972b5bff6a641c36cc7e90 Mon Sep 17 00:00:00 2001
2From: Tom Hochstein <tom.hochstein@nxp.com>
3Date: Wed, 22 Feb 2017 15:53:30 +0200
4Subject: [PATCH] weston-launch: Provide a default version that doesn't require PAM
5
6weston-launch requires PAM for starting weston as a non-root user.
7
8Since starting weston as root is a valid use case by itself, if
9PAM is not available, provide a default version of weston-launch
10without non-root-user support.
11
12Upstream-Status: Pending
13
14Signed-off-by: Tom Hochstein <tom.hochstein@nxp.com>
15Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
16Signed-off-by: Denys Dmytriyenko <denys@ti.com>
17
18---
19 configure.ac | 9 +++++++--
20 libweston/weston-launch.c | 20 ++++++++++++++++++++
21 2 files changed, 27 insertions(+), 2 deletions(-)
22
23diff --git a/configure.ac b/configure.ac
24index dc9c802..48cf5cb 100644
25--- a/configure.ac
26+++ b/configure.ac
27@@ -451,13 +451,17 @@ AC_ARG_ENABLE(resize-optimization,
28 AS_IF([test "x$enable_resize_optimization" = "xyes"],
29 [AC_DEFINE([USE_RESIZE_POOL], [1], [Use resize memory pool as a performance optimization])])
30
31+AC_ARG_WITH(pam,
32+ AS_HELP_STRING([--with-pam], [Use PAM]),
33+ [use_pam=$withval], [use_pam=yes])
34 AC_ARG_ENABLE(weston-launch, [ --enable-weston-launch],, enable_weston_launch=yes)
35 AM_CONDITIONAL(BUILD_WESTON_LAUNCH, test x$enable_weston_launch = xyes)
36-if test x$enable_weston_launch = xyes; then
37+if test x$enable_weston_launch = xyes -a x$use_pam = xyes; then
38 WESTON_SEARCH_LIBS([PAM], [pam], [pam_open_session], [have_pam=yes], [have_pam=no])
39 if test x$have_pam = xno; then
40- AC_ERROR([weston-launch requires pam])
41+ AC_ERROR([PAM support is explicitly requested, but libpam couldn't be found])
42 fi
43+ AC_DEFINE([HAVE_PAM], [1], [Define if PAM is available])
44 fi
45
46 AM_CONDITIONAL(HAVE_PANGO, test "x$have_pango" = "xyes")
47@@ -702,6 +706,7 @@ AC_MSG_RESULT([
48 Enable developer documentation ${enable_devdocs}
49
50 weston-launch utility ${enable_weston_launch}
51+ PAM support ${use_pam}
52 systemd-login support ${have_systemd_login}
53 systemd notify support ${enable_systemd_notify}
54
55diff --git a/libweston/weston-launch.c b/libweston/weston-launch.c
56index 166bf3b..6fb9232 100644
57--- a/libweston/weston-launch.c
58+++ b/libweston/weston-launch.c
59@@ -51,7 +51,9 @@
60
61 #include <pwd.h>
62 #include <grp.h>
63+#ifdef HAVE_PAM
64 #include <security/pam_appl.h>
65+#endif
66
67 #ifdef HAVE_SYSTEMD_LOGIN
68 #include <systemd/sd-login.h>
69@@ -101,8 +103,10 @@ drmSetMaster(int drm_fd)
70 #endif
71
72 struct weston_launch {
73+#ifdef HAVE_PAM
74 struct pam_conv pc;
75 pam_handle_t *ph;
76+#endif
77 int tty;
78 int ttynr;
79 int sock[2];
80@@ -189,6 +193,7 @@ weston_launch_allowed(struct weston_launch *wl)
81 return false;
82 }
83
84+#ifdef HAVE_PAM
85 static int
86 pam_conversation_fn(int msg_count,
87 const struct pam_message **messages,
88@@ -229,6 +234,7 @@ setup_pam(struct weston_launch *wl)
89
90 return 0;
91 }
92+#endif
93
94 static int
95 setup_launcher_socket(struct weston_launch *wl)
96@@ -422,6 +428,7 @@ quit(struct weston_launch *wl, int status)
97 close(wl->signalfd);
98 close(wl->sock[0]);
99
100+#ifdef HAVE_PAM
101 if (wl->new_user) {
102 err = pam_close_session(wl->ph, 0);
103 if (err)
104@@ -429,6 +436,7 @@ quit(struct weston_launch *wl, int status)
105 err, pam_strerror(wl->ph, err));
106 pam_end(wl->ph, err);
107 }
108+#endif
109
110 if (ioctl(wl->tty, KDSKBMUTE, 0) &&
111 ioctl(wl->tty, KDSKBMODE, wl->kb_mode))
112@@ -608,6 +616,7 @@ setup_session(struct weston_launch *wl, char **child_argv)
113 setenv("HOME", wl->pw->pw_dir, 1);
114 setenv("SHELL", wl->pw->pw_shell, 1);
115
116+#ifdef HAVE_PAM
117 env = pam_getenvlist(wl->ph);
118 if (env) {
119 for (i = 0; env[i]; ++i) {
120@@ -616,6 +625,7 @@ setup_session(struct weston_launch *wl, char **child_argv)
121 }
122 free(env);
123 }
124+#endif
125
126 /*
127 * We open a new session, so it makes sense
128@@ -683,8 +693,10 @@ static void
129 help(const char *name)
130 {
131 fprintf(stderr, "Usage: %s [args...] [-- [weston args..]]\n", name);
132+#ifdef HAVE_PAM
133 fprintf(stderr, " -u, --user Start session as specified username,\n"
134 " e.g. -u joe, requires root.\n");
135+#endif
136 fprintf(stderr, " -t, --tty Start session on alternative tty,\n"
137 " e.g. -t /dev/tty4, requires -u option.\n");
138 fprintf(stderr, " -v, --verbose Be verbose\n");
139@@ -698,7 +710,9 @@ main(int argc, char *argv[])
140 int i, c;
141 char *tty = NULL;
142 struct option opts[] = {
143+#ifdef HAVE_PAM
144 { "user", required_argument, NULL, 'u' },
145+#endif
146 { "tty", required_argument, NULL, 't' },
147 { "verbose", no_argument, NULL, 'v' },
148 { "help", no_argument, NULL, 'h' },
149@@ -710,9 +724,13 @@ main(int argc, char *argv[])
150 while ((c = getopt_long(argc, argv, "u:t:vh", opts, &i)) != -1) {
151 switch (c) {
152 case 'u':
153+#ifdef HAVE_PAM
154 wl.new_user = optarg;
155 if (getuid() != 0)
156 error(1, 0, "Permission denied. -u allowed for root only");
157+#else
158+ error(1, 0, "-u is unsupported in this weston-launch build");
159+#endif
160 break;
161 case 't':
162 tty = optarg;
163@@ -753,8 +771,10 @@ main(int argc, char *argv[])
164 if (setup_tty(&wl, tty) < 0)
165 exit(EXIT_FAILURE);
166
167+#ifdef HAVE_PAM
168 if (wl.new_user && setup_pam(&wl) < 0)
169 exit(EXIT_FAILURE);
170+#endif
171
172 if (setup_launcher_socket(&wl) < 0)
173 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_4.0.0.imx.bb b/recipes-graphics/wayland/weston_4.0.0.imx.bb
new file mode 100644
index 00000000..e78b0d91
--- /dev/null
+++ b/recipes-graphics/wayland/weston_4.0.0.imx.bb
@@ -0,0 +1,114 @@
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://libweston/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://xwayland.weston-start \
13 file://0001-weston-launch-Provide-a-default-version-that-doesn-t.patch \
14"
15SRC_URI[md5sum] = "33709aa4d5916f89643fca0fc0064b39"
16SRC_URI[sha256sum] = "a0fc0ae7ef83dfbed12abfe9b8096a24a7dd00705e86fa0db1e619ded18b4b58"
17
18UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html"
19
20inherit autotools pkgconfig useradd distro_features_check
21# depends on virtual/egl
22REQUIRED_DISTRO_FEATURES = "opengl"
23
24DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0 jpeg"
25DEPENDS += "wayland wayland-protocols libinput virtual/egl pango wayland-native"
26
27WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}"
28
29EXTRA_OECONF = "--enable-setuid-install \
30 --disable-rdp-compositor \
31 "
32EXTRA_OECONF_append_qemux86 = "\
33 WESTON_NATIVE_BACKEND=fbdev-backend.so \
34 "
35EXTRA_OECONF_append_qemux86-64 = "\
36 WESTON_NATIVE_BACKEND=fbdev-backend.so \
37 "
38PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl', '', d)} \
39 ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \
40 ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd x11', d)} \
41 clients launch"
42#
43# Compositor choices
44#
45# Weston on KMS
46PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm udev virtual/mesa mtdev"
47# Weston on Wayland (nested Weston)
48PACKAGECONFIG[wayland] = "--enable-wayland-compositor,--disable-wayland-compositor,virtual/mesa"
49# Weston on X11
50PACKAGECONFIG[x11] = "--enable-x11-compositor,--disable-x11-compositor,virtual/libx11 libxcb libxcb libxcursor cairo"
51# Headless Weston
52PACKAGECONFIG[headless] = "--enable-headless-compositor,--disable-headless-compositor"
53# Weston on framebuffer
54PACKAGECONFIG[fbdev] = "--enable-fbdev-compositor,--disable-fbdev-compositor,udev mtdev"
55# weston-launch
56PACKAGECONFIG[launch] = "--enable-weston-launch,--disable-weston-launch,drm"
57# VA-API desktop recorder
58PACKAGECONFIG[vaapi] = "--enable-vaapi-recorder,--disable-vaapi-recorder,libva"
59# Weston with EGL support
60PACKAGECONFIG[egl] = "--enable-egl --enable-simple-egl-clients,--disable-egl --disable-simple-egl-clients,virtual/egl"
61# Weston with cairo glesv2 support
62PACKAGECONFIG[cairo-glesv2] = "--with-cairo-glesv2,--with-cairo=image,cairo"
63# Weston with lcms support
64PACKAGECONFIG[lcms] = "--enable-lcms,--disable-lcms,lcms"
65# Weston with webp support
66PACKAGECONFIG[webp] = "--with-webp,--without-webp,libwebp"
67# Weston with systemd-login support
68PACKAGECONFIG[systemd] = "--enable-systemd-login,--disable-systemd-login,systemd dbus"
69# Weston with Xwayland support (requires X11 and Wayland)
70PACKAGECONFIG[xwayland] = "--enable-xwayland,--disable-xwayland"
71# colord CMS support
72PACKAGECONFIG[colord] = "--enable-colord,--disable-colord,colord"
73# Clients support
74PACKAGECONFIG[clients] = "--enable-clients --enable-simple-clients --enable-demo-clients-install,--disable-clients --disable-simple-clients"
75# Weston with PAM support
76PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam"
77
78do_install_append() {
79 # Weston doesn't need the .la files to load modules, so wipe them
80 rm -f ${D}/${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.la
81
82 # If X11, ship a desktop file to launch it
83 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" ]; then
84 install -d ${D}${datadir}/applications
85 install ${WORKDIR}/weston.desktop ${D}${datadir}/applications
86
87 install -d ${D}${datadir}/icons/hicolor/48x48/apps
88 install ${WORKDIR}/weston.png ${D}${datadir}/icons/hicolor/48x48/apps
89 fi
90
91 if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "yes" ]; then
92 install -Dm 644 ${WORKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland
93 fi
94}
95
96PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', '${PN}-xwayland', '', d)} \
97 libweston-${WESTON_MAJOR_VERSION} ${PN}-examples"
98
99FILES_${PN} = "${bindir}/weston ${bindir}/weston-terminal ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode ${libexecdir} ${libdir}/${BPN}/*.so ${datadir}"
100
101FILES_libweston-${WESTON_MAJOR_VERSION} = "${libdir}/lib*${SOLIBS} ${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.so"
102SUMMARY_libweston-${WESTON_MAJOR_VERSION} = "Helper library for implementing 'wayland window managers'."
103
104FILES_${PN}-examples = "${bindir}/*"
105
106FILES_${PN}-xwayland = "${libdir}/libweston-${WESTON_MAJOR_VERSION}/xwayland.so"
107RDEPENDS_${PN}-xwayland += "xserver-xorg-xwayland"
108
109RDEPENDS_${PN} += "xkeyboard-config"
110RRECOMMENDS_${PN} = "liberation-fonts"
111RRECOMMENDS_${PN}-dev += "wayland-protocols"
112
113USERADD_PACKAGES = "${PN}"
114GROUPADD_PARAM_${PN} = "--system weston-launch"