blob: 07cec75fb333e81105ffa07aaf056b9395756dda [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001SUMMARY = "Startup script and systemd unit file for the Weston Wayland compositor"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05002LICENSE = "MIT"
Brad Bishop6e60e8b2018-02-01 10:27:11 -05003LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
Patrick Williamsc124f4f2015-09-15 14:41:29 -05004
Brad Bishopa34c0302019-09-23 22:34:48 -04005PACKAGE_ARCH = "${MACHINE_ARCH}"
6
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05007SRC_URI = "file://init \
Andrew Geissler82c905d2020-04-13 13:39:40 -05008 file://weston.env \
Brad Bishopa34c0302019-09-23 22:34:48 -04009 file://weston.ini \
10 file://weston@.service \
Andrew Geisslerc9f78652020-09-18 14:11:35 -050011 file://weston@.socket \
Brad Bishopa34c0302019-09-23 22:34:48 -040012 file://71-weston-drm.rules \
Andrew Geisslerc9f78652020-09-18 14:11:35 -050013 file://weston-autologin \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060014 file://weston-start"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050015
16S = "${WORKDIR}"
17
Andrew Geisslerc9f78652020-09-18 14:11:35 -050018DEFAULTBACKEND ??= ""
19DEFAULTBACKEND_qemuall ?= "fbdev"
20DEFAULTBACKEND_qemuarm64 = "drm"
21DEFAULTBACKEND_qemux86 = "drm"
22DEFAULTBACKEND_qemux86-64 = "drm"
23
Patrick Williamsc124f4f2015-09-15 14:41:29 -050024do_install() {
Patrick Williamsc0f7c042017-02-23 20:41:17 -060025 install -Dm755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston
Brad Bishopa34c0302019-09-23 22:34:48 -040026 install -D -p -m0644 ${WORKDIR}/weston.ini ${D}${sysconfdir}/xdg/weston/weston.ini
Andrew Geissler82c905d2020-04-13 13:39:40 -050027 install -Dm644 ${WORKDIR}/weston.env ${D}${sysconfdir}/default/weston
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050028
Brad Bishopa34c0302019-09-23 22:34:48 -040029 # Install Weston systemd service and accompanying udev rule
30 install -D -p -m0644 ${WORKDIR}/weston@.service ${D}${systemd_system_unitdir}/weston@.service
Andrew Geisslerc9f78652020-09-18 14:11:35 -050031 install -D -p -m0644 ${WORKDIR}/weston@.socket ${D}${systemd_system_unitdir}/weston@.socket
32 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
33 install -D -p -m0644 ${WORKDIR}/weston-autologin ${D}${sysconfdir}/pam.d/weston-autologin
34 fi
Brad Bishopa34c0302019-09-23 22:34:48 -040035 sed -i -e s:/etc:${sysconfdir}:g \
36 -e s:/usr/bin:${bindir}:g \
37 -e s:/var:${localstatedir}:g \
38 ${D}${systemd_unitdir}/system/weston@.service
39 install -D -p -m0644 ${WORKDIR}/71-weston-drm.rules \
40 ${D}${sysconfdir}/udev/rules.d/71-weston-drm.rules
Patrick Williamsc0f7c042017-02-23 20:41:17 -060041 # Install weston-start script
42 install -Dm755 ${WORKDIR}/weston-start ${D}${bindir}/weston-start
43 sed -i 's,@DATADIR@,${datadir},g' ${D}${bindir}/weston-start
44 sed -i 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${bindir}/weston-start
Andrew Geisslerc9f78652020-09-18 14:11:35 -050045 if [ -n "${DEFAULTBACKEND}" ]; then
46 sed -i -e "/^\[core\]/a backend=${DEFAULTBACKEND}-backend.so" ${D}${sysconfdir}/xdg/weston/weston.ini
47 fi
Andrew Geissler82c905d2020-04-13 13:39:40 -050048}
49
Brad Bishop6dbb3162019-11-25 09:41:34 -050050inherit update-rc.d features_check systemd
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050051
52# rdepends on weston which depends on virtual/egl
53REQUIRED_DISTRO_FEATURES = "opengl"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050054
55RDEPENDS_${PN} = "weston kbd"
56
57INITSCRIPT_NAME = "weston"
58INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ."
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050059
Andrew Geisslerc9f78652020-09-18 14:11:35 -050060FILES_${PN} += "${sysconfdir}/xdg/weston/weston.ini ${systemd_system_unitdir}/weston@.service ${systemd_system_unitdir}/weston@.socket ${sysconfdir}/default/weston ${sysconfdir}/pam.d/"
Brad Bishopa34c0302019-09-23 22:34:48 -040061
Andrew Geissler82c905d2020-04-13 13:39:40 -050062CONFFILES_${PN} += "${sysconfdir}/xdg/weston/weston.ini ${sysconfdir}/default/weston"
Brad Bishopa34c0302019-09-23 22:34:48 -040063
64SYSTEMD_SERVICE_${PN} = "weston@%i.service"
65SYSTEMD_AUTO_ENABLE = "disable"
66