meta-agl-core: fix polkit dependencies
[AGL/meta-agl.git] / meta-agl-core / recipes-graphics / wayland / agl-compositor-init.bb
1 SUMMARY = "Startup systemd unit for the AGL Wayland compositor"
2 LICENSE = "MIT"
3 LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
4
5 inherit systemd
6
7 # Reuse include file from upstream weston since we have the same requirements
8 require recipes-graphics/wayland/required-distro-features.inc
9
10 PACKAGE_ARCH = "${MACHINE_ARCH}"
11
12 SRC_URI = "file://agl-compositor.service \
13            file://agl-compositor.socket \
14            file://agl-compositor-autologin \
15            file://agl-compositor.conf.in \
16 "
17
18 S = "${WORKDIR}"
19
20 AGL_COMPOSITOR_ARGS ?= " --config ${sysconfdir}/xdg/weston/weston.ini --idle-time=0"
21 AGL_COMPOSITOR_USE_PIXMAN ??= "0"
22
23 AGL_COMPOSITOR_ARGS:append = " ${@bb.utils.contains("DISTRO_FEATURES", "agl-devel", " --debug", "",d)}"
24 AGL_COMPOSITOR_ARGS:append = " ${@bb.utils.contains("WESTON_USE_PIXMAN", "1", " --use-pixman", "",d)}"
25
26 do_install() {
27     # Install systemd service
28     install -D -p -m0644 ${WORKDIR}/agl-compositor.service ${D}${systemd_system_unitdir}/agl-compositor.service
29     install -D -p -m0644 ${WORKDIR}/agl-compositor.socket ${D}${systemd_system_unitdir}/agl-compositor.socket
30     if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
31         install -D -p -m0644 ${WORKDIR}/agl-compositor-autologin ${D}${sysconfdir}/pam.d/agl-compositor-autologin
32     fi
33
34     # Install systemd service drop-in with extra configuration
35     files=agl-compositor.conf.in
36     for f in ${files}; do
37         g=${f%.in}
38         if [ "${f}" != "${g}" ]; then
39             sed -e "s,@AGL_COMPOSITOR_ARGS@,${AGL_COMPOSITOR_ARGS},g" \
40                 ${WORKDIR}/${f} > ${WORKDIR}/${g}
41         fi
42     done
43     install -d ${D}${systemd_system_unitdir}/agl-compositor.service.d
44     install -m644 ${WORKDIR}/agl-compositor.conf ${D}/${systemd_system_unitdir}/agl-compositor.service.d/agl-compositor.conf
45 }
46
47 FILES:${PN} += "\
48     ${systemd_system_unitdir}/agl-compositor.service \
49     ${systemd_system_unitdir}/agl-compositor.socket \
50     ${systemd_system_unitdir}/agl-compositor.service.d \
51     ${sysconfdir}/default/agl-compositor \
52     ${sysconfdir}/pam.d/ \
53     "
54
55 CONFFILES:${PN} += "${sysconfdir}/default/agl-compositor"
56
57 RDEPENDS:${PN} = "agl-users agl-compositor weston-ini"
58
59 RCONFLICTS:${PN} = "weston-init"
60
61 SYSTEMD_SERVICE:${PN} = "agl-compositor.service agl-compositor.socket"