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 | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame^] | 18 | PACKAGECONFIG ??= "" |
| 19 | |
| 20 | PACKAGECONFIG[no-idle-timeout] = ",," |
| 21 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 22 | DEFAULTBACKEND ??= "" |
| 23 | DEFAULTBACKEND_qemuall ?= "fbdev" |
| 24 | DEFAULTBACKEND_qemuarm64 = "drm" |
| 25 | DEFAULTBACKEND_qemux86 = "drm" |
| 26 | DEFAULTBACKEND_qemux86-64 = "drm" |
| 27 | |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 28 | do_install() { |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 29 | install -Dm755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 30 | 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] | 31 | install -Dm644 ${WORKDIR}/weston.env ${D}${sysconfdir}/default/weston |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 32 | |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 33 | # Install Weston systemd service and accompanying udev rule |
| 34 | 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] | 35 | install -D -p -m0644 ${WORKDIR}/weston@.socket ${D}${systemd_system_unitdir}/weston@.socket |
| 36 | if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then |
| 37 | install -D -p -m0644 ${WORKDIR}/weston-autologin ${D}${sysconfdir}/pam.d/weston-autologin |
| 38 | fi |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 39 | sed -i -e s:/etc:${sysconfdir}:g \ |
| 40 | -e s:/usr/bin:${bindir}:g \ |
| 41 | -e s:/var:${localstatedir}:g \ |
| 42 | ${D}${systemd_unitdir}/system/weston@.service |
| 43 | install -D -p -m0644 ${WORKDIR}/71-weston-drm.rules \ |
| 44 | ${D}${sysconfdir}/udev/rules.d/71-weston-drm.rules |
Patrick Williams | c0f7c04 | 2017-02-23 20:41:17 -0600 | [diff] [blame] | 45 | # Install weston-start script |
| 46 | install -Dm755 ${WORKDIR}/weston-start ${D}${bindir}/weston-start |
| 47 | sed -i 's,@DATADIR@,${datadir},g' ${D}${bindir}/weston-start |
| 48 | sed -i 's,@LOCALSTATEDIR@,${localstatedir},g' ${D}${bindir}/weston-start |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 49 | if [ -n "${DEFAULTBACKEND}" ]; then |
| 50 | sed -i -e "/^\[core\]/a backend=${DEFAULTBACKEND}-backend.so" ${D}${sysconfdir}/xdg/weston/weston.ini |
| 51 | fi |
Andrew Geissler | 4c19ea1 | 2020-10-27 13:52:24 -0500 | [diff] [blame^] | 52 | |
| 53 | if [ "${@bb.utils.contains('PACKAGECONFIG', 'no-idle-timeout', 'yes', 'no', d)}" = "yes" ]; then |
| 54 | echo "idle-time=0" >> ${D}${sysconfdir}/xdg/weston/weston.ini |
| 55 | fi |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 56 | } |
| 57 | |
Brad Bishop | 6dbb316 | 2019-11-25 09:41:34 -0500 | [diff] [blame] | 58 | inherit update-rc.d features_check systemd |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 59 | |
| 60 | # rdepends on weston which depends on virtual/egl |
| 61 | REQUIRED_DISTRO_FEATURES = "opengl" |
Patrick Williams | c124f4f | 2015-09-15 14:41:29 -0500 | [diff] [blame] | 62 | |
| 63 | RDEPENDS_${PN} = "weston kbd" |
| 64 | |
| 65 | INITSCRIPT_NAME = "weston" |
| 66 | INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ." |
Patrick Williams | d8c66bc | 2016-06-20 12:57:21 -0500 | [diff] [blame] | 67 | |
Andrew Geissler | c9f7865 | 2020-09-18 14:11:35 -0500 | [diff] [blame] | 68 | 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] | 69 | |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 70 | CONFFILES_${PN} += "${sysconfdir}/xdg/weston/weston.ini ${sysconfdir}/default/weston" |
Brad Bishop | a34c030 | 2019-09-23 22:34:48 -0400 | [diff] [blame] | 71 | |
| 72 | SYSTEMD_SERVICE_${PN} = "weston@%i.service" |
| 73 | SYSTEMD_AUTO_ENABLE = "disable" |
| 74 | |