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