Make the agl-compositor the default compositor
[AGL/meta-agl.git] / meta-agl-profile-graphical / recipes-graphics / wayland / weston-init.bbappend
1 FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
2
3 inherit agl-graphical
4
5 AGL_DEFAULT_WESTONSTART ??= "/usr/bin/agl-compositor --config ${sysconfdir}/xdg/weston/weston.ini"
6
7 WESTONSTART ??= "${AGL_DEFAULT_WESTONSTART} ${WESTONARGS}"
8 WESTONSTART_append = " ${@bb.utils.contains("IMAGE_FEATURES", "debug-tweaks", " --log=${DISPLAY_XDG_RUNTIME_DIR}/compositor.log", "",d)}"
9
10 WIFILES = " \
11     file://weston.conf.in \
12     file://tmpfiles.conf.in \
13     file://zz-dri.rules.in \
14     file://zz-input.rules.in \
15     file://zz-tty.rules.in \
16 "
17
18 WIFILES_append_imx = " \
19     file://zz-dri-imx.rules.in \
20 "
21
22 SRC_URI_append = " ${WIFILES}"
23
24 do_install_append() {
25     # Remove upstream weston.ini to avoid conflict with weston-ini-conf package
26     rm -f ${D}${sysconfdir}/xdg/weston/weston.ini
27
28     # Remove upstream weston udev rules just to be safe
29     rm -f ${D}${sysconfdir}/udev/rules.d/71-weston-drm.rules
30
31     # Process ".in" files
32     files=$(echo ${WIFILES} | sed s,file://,,g)
33     for f in ${files}; do
34         g=${f%.in}
35         if [ "${f}" != "${g}" ]; then
36             sed -e "s,@WESTONUSER@,${WESTONUSER},g" \
37                 -e "s,@WESTONGROUP@,${WESTONGROUP},g" \
38                 -e "s,@XDG_RUNTIME_DIR@,${DISPLAY_XDG_RUNTIME_DIR},g" \
39                 -e "s,@WESTONSTART@,${WESTONSTART},g" \
40                     ${WORKDIR}/${f} > ${WORKDIR}/${g}
41         fi
42     done
43
44     # Install weston drop-in
45     install -d ${D}${systemd_system_unitdir}/weston@.service.d
46     install -m644 ${WORKDIR}/weston.conf ${D}/${systemd_system_unitdir}/weston@.service.d/weston-init.conf
47
48     # Install tmpfiles drop-in
49     install -d ${D}${libdir}/tmpfiles.d
50     install -m644 ${WORKDIR}/tmpfiles.conf ${D}${libdir}/tmpfiles.d/weston-init.conf
51
52     # Install udev rules
53     install -d ${D}${sysconfdir}/udev/rules.d
54     for f in ${files}; do
55         g=${f%.in}
56         h=${g%.rules}
57         if [ "${g}" != "${h}" ]; then
58             install -m644 ${WORKDIR}/${g} ${D}${sysconfdir}/udev/rules.d
59         fi
60     done
61 }
62
63 FILES_${PN} += " \
64     ${libdir}/tmpfiles.d/ \
65     ${systemd_system_unitdir}/weston@.service.d/ \
66 "
67
68 SYSTEMD_AUTO_ENABLE = "enable"
69