Fix dependency issue around mesa and egl in weston_6.0.0
[AGL/meta-agl.git] / meta-agl-bsp / recipes-graphics / wayland / weston_6.0.0.bb
1 SUMMARY = "Weston, a Wayland compositor"
2 DESCRIPTION = "Weston is the reference implementation of a Wayland compositor"
3 HOMEPAGE = "http://wayland.freedesktop.org"
4 LICENSE = "MIT"
5 LIC_FILES_CHKSUM = "file://COPYING;md5=d79ee9e66bb0f95d3386a7acae780b70 \
6                     file://libweston/compositor.c;endline=27;md5=6c53bbbd99273f4f7c4affa855c33c0a"
7
8 SRC_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 "
15 SRC_URI[md5sum] = "752a04ce3c65af4884cfac4e57231bdb"
16 SRC_URI[sha256sum] = "15a23423bcfa45e31e1dedc0cd524ba71e2930df174fde9c99b71a537c4e4caf"
17 SRC_URI[md5sum] = "7c634e262f8a464a076c97fd50ad36b3"
18 SRC_URI[sha256sum] = "546323a90607b3bd7f48809ea9d76e64cd09718102f2deca6d95aa59a882e612"
19
20 UPSTREAM_CHECK_URI = "https://wayland.freedesktop.org/releases.html"
21
22 inherit autotools pkgconfig useradd distro_features_check
23 # depends on virtual/egl
24 REQUIRED_DISTRO_FEATURES = "opengl"
25
26 DEPENDS = "libxkbcommon gdk-pixbuf pixman cairo glib-2.0 jpeg"
27 DEPENDS += "wayland wayland-protocols libinput virtual/egl pango wayland-native"
28
29 WESTON_MAJOR_VERSION = "${@'.'.join(d.getVar('PV').split('.')[0:1])}"
30
31 EXTRA_OECONF = "--enable-setuid-install \
32                 --disable-rdp-compositor \
33                 --enable-autotools \
34                 "
35 PACKAGECONFIG ??= "${@bb.utils.contains('DISTRO_FEATURES', 'wayland', 'kms fbdev wayland egl', '', d)} \
36                    ${@bb.utils.contains('DISTRO_FEATURES', 'x11 wayland', 'xwayland', '', d)} \
37                    ${@bb.utils.filter('DISTRO_FEATURES', 'pam systemd x11', d)} \
38                    clients launch"
39 #
40 # Compositor choices
41 #
42 # Weston on KMS
43 PACKAGECONFIG[kms] = "--enable-drm-compositor,--disable-drm-compositor,drm udev virtual/egl virtual/libgles2 virtual/libgbm mtdev"
44 # Weston on Wayland (nested Weston)
45 PACKAGECONFIG[wayland] = "--enable-wayland-compositor,--disable-wayland-compositor,virtual/egl virtual/libgles2"
46 # Weston on X11
47 PACKAGECONFIG[x11] = "--enable-x11-compositor,--disable-x11-compositor,virtual/libx11 libxcb libxcb libxcursor cairo"
48 # Headless Weston
49 PACKAGECONFIG[headless] = "--enable-headless-compositor,--disable-headless-compositor"
50 # Weston on framebuffer
51 PACKAGECONFIG[fbdev] = "--enable-fbdev-compositor,--disable-fbdev-compositor,udev mtdev"
52 # weston-launch
53 PACKAGECONFIG[launch] = "--enable-weston-launch,--disable-weston-launch,drm"
54 # VA-API desktop recorder
55 PACKAGECONFIG[vaapi] = "--enable-vaapi-recorder,--disable-vaapi-recorder,libva"
56 # Weston with EGL support
57 PACKAGECONFIG[egl] = "--enable-egl --enable-simple-egl-clients,--disable-egl --disable-simple-egl-clients,virtual/egl"
58 # Weston with cairo glesv2 support
59 PACKAGECONFIG[cairo-glesv2] = "--with-cairo-glesv2,--with-cairo=image,cairo"
60 # Weston with lcms support
61 PACKAGECONFIG[lcms] = "--enable-lcms,--disable-lcms,lcms"
62 # Weston with webp support
63 PACKAGECONFIG[webp] = "--with-webp,--without-webp,libwebp"
64 # Weston with systemd-login support
65 PACKAGECONFIG[systemd] = "--enable-systemd-login,--disable-systemd-login,systemd dbus"
66 # Weston with Xwayland support (requires X11 and Wayland)
67 PACKAGECONFIG[xwayland] = "--enable-xwayland,--disable-xwayland"
68 # colord CMS support
69 PACKAGECONFIG[colord] = "--enable-colord,--disable-colord,colord"
70 # Clients support
71 PACKAGECONFIG[clients] = "--enable-clients --enable-simple-clients --enable-demo-clients-install,--disable-clients --disable-simple-clients"
72 # Weston with PAM support
73 PACKAGECONFIG[pam] = "--with-pam,--without-pam,libpam"
74
75 do_install_append() {
76         # Weston doesn't need the .la files to load modules, so wipe them
77         rm -f ${D}/${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.la
78
79         # If X11, ship a desktop file to launch it
80         if [ "${@bb.utils.filter('DISTRO_FEATURES', 'x11', d)}" ]; then
81                 install -d ${D}${datadir}/applications
82                 install ${WORKDIR}/weston.desktop ${D}${datadir}/applications
83
84                 install -d ${D}${datadir}/icons/hicolor/48x48/apps
85                 install ${WORKDIR}/weston.png ${D}${datadir}/icons/hicolor/48x48/apps
86         fi
87
88         if [ "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', 'yes', 'no', d)}" = "yes" ]; then
89                 install -Dm 644 ${WORKDIR}/xwayland.weston-start ${D}${datadir}/weston-start/xwayland
90         fi
91 }
92
93 PACKAGES += "${@bb.utils.contains('PACKAGECONFIG', 'xwayland', '${PN}-xwayland', '', d)} \
94              libweston-${WESTON_MAJOR_VERSION} ${PN}-examples"
95
96 FILES_${PN} = "${bindir}/weston ${bindir}/weston-terminal ${bindir}/weston-info ${bindir}/weston-launch ${bindir}/wcap-decode ${libexecdir} ${libdir}/${BPN}/*.so ${datadir}"
97
98 FILES_libweston-${WESTON_MAJOR_VERSION} = "${libdir}/lib*${SOLIBS} ${libdir}/libweston-${WESTON_MAJOR_VERSION}/*.so"
99 SUMMARY_libweston-${WESTON_MAJOR_VERSION} = "Helper library for implementing 'wayland window managers'."
100
101 FILES_${PN}-examples = "${bindir}/*"
102
103 FILES_${PN}-xwayland = "${libdir}/libweston-${WESTON_MAJOR_VERSION}/xwayland.so"
104 RDEPENDS_${PN}-xwayland += "xserver-xorg-xwayland"
105
106 RDEPENDS_${PN} += "xkeyboard-config"
107 RRECOMMENDS_${PN} = "weston-conf liberation-fonts"
108 RRECOMMENDS_${PN}-dev += "wayland-protocols"
109
110 USERADD_PACKAGES = "${PN}"
111 GROUPADD_PARAM_${PN} = "--system weston-launch"