398cd1c55851e85ccaba56231e355cecab5694e7
[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
6 WESTONSTART ??= "/usr/bin/weston ${WESTONARGS}"
7 WESTONSTART_append = " ${@bb.utils.contains("IMAGE_FEATURES", "debug-tweaks", " --log=${DISPLAY_XDG_RUNTIME_DIR}/weston.log", "",d)}"
8
9 DROPIN_NAME = "weston-init"
10
11 WIFILES = " \
12     file://weston.conf.in \
13     file://tmpfiles.conf.in \
14     file://zz-dri.rules.in \
15     file://zz-input.rules \
16     file://zz-tty.rules.in \
17 "
18
19 WIFILES_append_imx = " \
20     file://zz-dri-imx.rules.in \
21 "
22
23 SRC_URI_append = " ${WIFILES}"
24
25 do_install_append() {
26
27     # files
28     files=$(echo ${WIFILES} | sed s,file://,,g)
29
30     # process ".in" files
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,@WESTONTTY@,${WESTONTTY},g" \
38                 -e "s,@WESTONSTART@,${WESTONSTART},g" \
39                     ${WORKDIR}/${f} > ${WORKDIR}/${g}
40         fi
41     done
42
43     # removes any unexpected entry from weston.service
44     for x in Group User ExecStart PAMName; do
45         sed -i "/^ *$x *=/d" ${D}${systemd_system_unitdir}/weston.service
46     done
47
48     # install weston drop-in
49     install -d ${D}${systemd_system_unitdir}/weston.service.d
50     install -m644 ${WORKDIR}/weston.conf ${D}/${systemd_system_unitdir}/weston.service.d/${DROPIN_NAME}.conf
51
52     # install tmpfiles drop-in
53     install -d ${D}${libdir}/tmpfiles.d
54     install -m644 ${WORKDIR}/tmpfiles.conf ${D}${libdir}/tmpfiles.d/${DROPIN_NAME}.conf
55
56     # install udev rules
57     install -d ${D}${sysconfdir}/udev/rules.d
58     for f in ${files}; do
59         g=${f%.in}
60         h=${g%.rules}
61         if [ "${g}" != "${h}" ]; then
62             install -m644 ${WORKDIR}/${g} ${D}${sysconfdir}/udev/rules.d
63         fi
64     done
65 }
66
67 FILES_${PN} += " \
68     ${libdir}/tmpfiles.d/*.conf \
69     ${systemd_system_unitdir}/weston.service.d/${DROPIN_NAME}.conf \
70 "
71
72