blob: 77dda03cf55f947534686448905079eca977218a [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 \
Andrew Geissler6ce62a22020-11-30 19:58:47 -060010 file://weston.service \
11 file://weston.socket \
Andrew Geisslerc9f78652020-09-18 14:11:35 -050012 file://weston-autologin \
Patrick Williamsc0f7c042017-02-23 20:41:17 -060013 file://weston-start"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050014
15S = "${WORKDIR}"
16
Andrew Geissler4c19ea12020-10-27 13:52:24 -050017PACKAGECONFIG ??= ""
Andrew Geissler9aee5002022-03-30 16:27:02 +000018PACKAGECONFIG:append:qemuriscv64 = " use-pixman"
19PACKAGECONFIG:append:qemuppc64 = " use-pixman"
Andrew Geissler4c19ea12020-10-27 13:52:24 -050020
21PACKAGECONFIG[no-idle-timeout] = ",,"
Andrew Geissler9aee5002022-03-30 16:27:02 +000022PACKAGECONFIG[use-pixman] = ",,"
Andrew Geissler4c19ea12020-10-27 13:52:24 -050023
Andrew Geisslerc9f78652020-09-18 14:11:35 -050024DEFAULTBACKEND ??= ""
Andrew Geissler7e0e3c02022-02-25 20:34:39 +000025DEFAULTBACKEND:qemuall ?= "drm"
Andrew Geisslerc9f78652020-09-18 14:11:35 -050026
Patrick Williamsc124f4f2015-09-15 14:41:29 -050027do_install() {
Andrew Geissler6ce62a22020-11-30 19:58:47 -060028 if [ "${VIRTUAL-RUNTIME_init_manager}" != "systemd" ]; then
29 install -Dm755 ${WORKDIR}/init ${D}/${sysconfdir}/init.d/weston
Andrew Geissler95ac1b82021-03-31 14:34:31 -050030 sed -i 's#ROOTHOME#${ROOT_HOME}#' ${D}/${sysconfdir}/init.d/weston
Andrew Geissler6ce62a22020-11-30 19:58:47 -060031 fi
Brad Bishopa34c0302019-09-23 22:34:48 -040032 install -D -p -m0644 ${WORKDIR}/weston.ini ${D}${sysconfdir}/xdg/weston/weston.ini
Andrew Geissler82c905d2020-04-13 13:39:40 -050033 install -Dm644 ${WORKDIR}/weston.env ${D}${sysconfdir}/default/weston
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050034
Brad Bishopa34c0302019-09-23 22:34:48 -040035 # Install Weston systemd service and accompanying udev rule
Andrew Geissler6ce62a22020-11-30 19:58:47 -060036 install -D -p -m0644 ${WORKDIR}/weston.service ${D}${systemd_system_unitdir}/weston.service
37 install -D -p -m0644 ${WORKDIR}/weston.socket ${D}${systemd_system_unitdir}/weston.socket
Andrew Geisslerc9f78652020-09-18 14:11:35 -050038 if [ "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}" ]; then
39 install -D -p -m0644 ${WORKDIR}/weston-autologin ${D}${sysconfdir}/pam.d/weston-autologin
40 fi
Brad Bishopa34c0302019-09-23 22:34:48 -040041 sed -i -e s:/etc:${sysconfdir}:g \
42 -e s:/usr/bin:${bindir}:g \
43 -e s:/var:${localstatedir}:g \
Andrew Geissler5199d832021-09-24 16:47:35 -050044 ${D}${systemd_system_unitdir}/weston.service
Patrick Williamsc0f7c042017-02-23 20:41:17 -060045 # 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 Geisslerc9f78652020-09-18 14:11:35 -050049 if [ -n "${DEFAULTBACKEND}" ]; then
50 sed -i -e "/^\[core\]/a backend=${DEFAULTBACKEND}-backend.so" ${D}${sysconfdir}/xdg/weston/weston.ini
51 fi
Andrew Geissler4c19ea12020-10-27 13:52:24 -050052
Andrew Geissler615f2f12022-07-15 14:00:58 -050053 if [ "${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'yes', 'no', d)}" = "yes" ]; then
54 sed -i -e "/^\[core\]/a xwayland=true" ${D}${sysconfdir}/xdg/weston/weston.ini
55 fi
56
Andrew Geissler4c19ea12020-10-27 13:52:24 -050057 if [ "${@bb.utils.contains('PACKAGECONFIG', 'no-idle-timeout', 'yes', 'no', d)}" = "yes" ]; then
Andrew Geissler6ce62a22020-11-30 19:58:47 -060058 sed -i -e "/^\[core\]/a idle-time=0" ${D}${sysconfdir}/xdg/weston/weston.ini
Andrew Geissler4c19ea12020-10-27 13:52:24 -050059 fi
Andrew Geissler6ce62a22020-11-30 19:58:47 -060060
Andrew Geissler9aee5002022-03-30 16:27:02 +000061 if [ "${@bb.utils.contains('PACKAGECONFIG', 'use-pixman', 'yes', 'no', d)}" = "yes" ]; then
62 sed -i -e "/^\[core\]/a use-pixman=true" ${D}${sysconfdir}/xdg/weston/weston.ini
63 fi
64
Andrew Geissler6ce62a22020-11-30 19:58:47 -060065 install -dm 755 -o weston -g weston ${D}/home/weston
Andrew Geissler82c905d2020-04-13 13:39:40 -050066}
67
Andrew Geissler6ce62a22020-11-30 19:58:47 -060068INHIBIT_UPDATERCD_BBCLASS = "${@oe.utils.conditional('VIRTUAL-RUNTIME_init_manager', 'systemd', '1', '', d)}"
69
Andrew Geissler9aee5002022-03-30 16:27:02 +000070inherit update-rc.d systemd useradd
Andrew Geissler6ce62a22020-11-30 19:58:47 -060071
72USERADD_PACKAGES = "${PN}"
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050073
74# rdepends on weston which depends on virtual/egl
Andrew Geissler9aee5002022-03-30 16:27:02 +000075#
76require ${THISDIR}/required-distro-features.inc
Patrick Williamsc124f4f2015-09-15 14:41:29 -050077
Patrick Williams213cb262021-08-07 19:21:33 -050078RDEPENDS:${PN} = "weston kbd"
Patrick Williamsc124f4f2015-09-15 14:41:29 -050079
80INITSCRIPT_NAME = "weston"
81INITSCRIPT_PARAMS = "start 9 5 2 . stop 20 0 1 6 ."
Patrick Williamsd8c66bc2016-06-20 12:57:21 -050082
Patrick Williams213cb262021-08-07 19:21:33 -050083FILES:${PN} += "\
Andrew Geissler6ce62a22020-11-30 19:58:47 -060084 ${sysconfdir}/xdg/weston/weston.ini \
85 ${systemd_system_unitdir}/weston.service \
86 ${systemd_system_unitdir}/weston.socket \
87 ${sysconfdir}/default/weston \
88 ${sysconfdir}/pam.d/ \
89 /home/weston \
90 "
Brad Bishopa34c0302019-09-23 22:34:48 -040091
Patrick Williams213cb262021-08-07 19:21:33 -050092CONFFILES:${PN} += "${sysconfdir}/xdg/weston/weston.ini ${sysconfdir}/default/weston"
Brad Bishopa34c0302019-09-23 22:34:48 -040093
Patrick Williams213cb262021-08-07 19:21:33 -050094SYSTEMD_SERVICE:${PN} = "weston.service weston.socket"
95USERADD_PARAM:${PN} = "--home /home/weston --shell /bin/sh --user-group -G video,input weston"
96GROUPADD_PARAM:${PN} = "-r wayland"
Brad Bishopa34c0302019-09-23 22:34:48 -040097