Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 1 | SUMMARY = "Startup script and systemd unit file for the Weston Wayland compositor" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 2 | LICENSE = "MIT" |
Brad Bishop | 6e60e8b | 2018-02-01 10:27:11 -0500 | [diff] [blame] | 3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 4 | |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 5 | PACKAGE_ARCH = "${MACHINE_ARCH}" |
| 6 | |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 7 | SRC_URI = "file://init \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 8 | file://weston.env \ |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 9 | file://weston.ini \ |
| 10 | file://weston@.service \ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame^] | 11 | file://weston@.socket \ |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 12 | file://71-weston-drm.rules \ |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame^] | 13 | file://weston-autologin \ |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 14 | file://weston-start" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 15 | |
| 16 | S = "${WORKDIR}" |
| 17 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame^] | 18 | DEFAULTBACKEND ??= "" |
| 19 | DEFAULTBACKEND_qemuall ?= "fbdev" |
| 20 | DEFAULTBACKEND_qemuarm64 = "drm" |
| 21 | DEFAULTBACKEND_qemux86 = "drm" |
| 22 | DEFAULTBACKEND_qemux86-64 = "drm" |
| 23 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 24 | do_install() { |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 25 | install -Dm755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 26 | install -D -p -m0644 ${WORKDIR}/weston.ini ${D}${sysconfdir}/xdg/weston/weston.ini |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 27 | install -Dm644 ${WORKDIR}/weston.env ${D}${sysconfdir}/default/weston |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 28 | |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 29 | # Install Weston systemd service and accompanying udev rule |
| 30 | install -D -p -m0644 ${WORKDIR}/weston@.service ${D}${systemd_system_unitdir}/weston@.service |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame^] | 31 | 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 Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 35 | 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 Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 41 | # 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 Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame^] | 45 | if [ -n "${DEFAULTBACKEND}" ]; then |
| 46 | sed -i -e "/^\[core\]/a backend=${DEFAULTBACKEND}-backend.so" ${D}${sysconfdir}/xdg/weston/weston.ini |
| 47 | fi |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 48 | } |
| 49 | |
Brad Bishop | 6dbb316 | 2019-11-25 09:41:34 -0500 | [diff] [blame] | 50 | inherit update-rc.d features_check systemd |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 51 | |
| 52 | # rdepends on weston which depends on virtual/egl |
| 53 | REQUIRED_DISTRO_FEATURES = "opengl" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 54 | |
| 55 | RDEPENDS_${PN} = "weston kbd" |
| 56 | |
| 57 | INITSCRIPT_NAME = "weston" |
| 58 | INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ." |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 59 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame^] | 60 | FILES_${PN} += "${sysconfdir}/xdg/weston/weston.ini ${systemd_system_unitdir}/weston@.service ${systemd_system_unitdir}/weston@.socket ${sysconfdir}/default/weston ${sysconfdir}/pam.d/" |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 61 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 62 | CONFFILES_${PN} += "${sysconfdir}/xdg/weston/weston.ini ${sysconfdir}/default/weston" |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 63 | |
| 64 | SYSTEMD_SERVICE_${PN} = "weston@%i.service" |
| 65 | SYSTEMD_AUTO_ENABLE = "disable" |
| 66 | |