summaryrefslogtreecommitdiffstats
path: root/meta-app-framework/recipes-graphics
diff options
context:
space:
mode:
Diffstat (limited to 'meta-app-framework/recipes-graphics')
-rw-r--r--meta-app-framework/recipes-graphics/wayland/agl-compositor-init.bbappend1
-rw-r--r--meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.conf11
-rw-r--r--meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service.in28
-rw-r--r--meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket10
-rw-r--r--meta-app-framework/recipes-graphics/wayland/agl-compositor-init_agl-app-fw.inc46
-rw-r--r--meta-app-framework/recipes-graphics/wayland/weston-ini-conf.bbappend1
-rw-r--r--meta-app-framework/recipes-graphics/wayland/weston-ini-conf_agl-app-fw.inc3
7 files changed, 100 insertions, 0 deletions
diff --git a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init.bbappend b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init.bbappend
new file mode 100644
index 000000000..70cbaabe2
--- /dev/null
+++ b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'agl-app-fw', 'agl-compositor-init_agl-app-fw.inc', '', d)}
diff --git a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.conf b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.conf
new file mode 100644
index 000000000..66778a91b
--- /dev/null
+++ b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.conf
@@ -0,0 +1,11 @@
+[Unit]
+ConditionPathExists=/dev/tty7
+
+[Service]
+Environment=XDG_SESSION_TYPE=wayland
+TTYPath=/dev/tty7
+TTYReset=yes
+TTYVHangup=yes
+TTYVTDisallocate=yes
+UtmpIdentifier=tty7
+UtmpMode=user
diff --git a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service.in b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service.in
new file mode 100644
index 000000000..2d0195184
--- /dev/null
+++ b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.service.in
@@ -0,0 +1,28 @@
+#
+# Weston must be built with systemd support, and your weston.ini must load
+# the plugin systemd-notify.so.
+
+[Unit]
+Description=agl-compositor, a Wayland compositor, as a systemd user service
+Documentation=https://docs.automotivelinux.org/en/master/#5_Component_Documentation/1_agl-compositor/
+
+# Activate using a systemd socket
+Requires=agl-compositor.socket
+After=agl-compositor.socket
+
+# Since we are part of the agl session, make sure we are started before
+# it is complete.
+Before=agl-session.target
+
+[Service]
+Type=notify
+ExecStart=/usr/bin/agl-compositor @AGL_COMPOSITOR_ARGS@
+
+TimeoutStartSec=60
+WatchdogSec=20
+
+StandardOutput=journal
+StandardError=journal
+
+[Install]
+WantedBy=agl-session.target
diff --git a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket
new file mode 100644
index 000000000..ef9769ff7
--- /dev/null
+++ b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init/agl-compositor.socket
@@ -0,0 +1,10 @@
+#
+# Weston must be built with systemd support, and your weston.ini must load
+# the plugin systemd-notify.so.
+
+[Unit]
+Description=agl-compositor, a Wayland compositor, as a systemd user service
+Documentation=https://docs.automotivelinux.org/en/master/#5_Component_Documentation/1_agl-compositor/
+
+[Socket]
+ListenStream=%t/wayland-0
diff --git a/meta-app-framework/recipes-graphics/wayland/agl-compositor-init_agl-app-fw.inc b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init_agl-app-fw.inc
new file mode 100644
index 000000000..eef88a60c
--- /dev/null
+++ b/meta-app-framework/recipes-graphics/wayland/agl-compositor-init_agl-app-fw.inc
@@ -0,0 +1,46 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/agl-compositor-init:"
+
+SRC_URI = " \
+ file://agl-compositor.conf \
+ file://agl-compositor.service.in \
+ file://agl-compositor.socket \
+ "
+
+# Reset systemd services list
+SYSTEMD_SERVICE:${PN} = ""
+
+do_install() {
+ # Process ".in" files
+ files=agl-compositor.service.in
+ for f in ${files}; do
+ g=${f%.in}
+ if [ "${f}" != "${g}" ]; then
+ sed -e "s,@AGL_COMPOSITOR_ARGS@,${AGL_COMPOSITOR_ARGS},g" \
+ ${WORKDIR}/${f} > ${WORKDIR}/${g}
+ fi
+ done
+
+ install -d ${D}${systemd_system_unitdir}/agl-session@agl-driver.service.d
+ install -m 0644 ${WORKDIR}/agl-compositor.conf \
+ ${D}${systemd_system_unitdir}/agl-session@agl-driver.service.d/agl-compositor.conf
+
+ install -D -p -m0644 ${WORKDIR}/agl-compositor.service ${D}${systemd_user_unitdir}/agl-compositor.service
+ install -D -p -m0644 ${WORKDIR}/agl-compositor.socket ${D}${systemd_user_unitdir}/agl-compositor.socket
+
+ # Enable the compositor as part of the user session
+ install -d ${D}${systemd_user_unitdir}/agl-session.target.wants
+ ln -s ../agl-compositor.service ${D}${systemd_user_unitdir}/agl-session.target.wants/agl-compositor.service
+}
+
+FILES:${PN} = "\
+ ${systemd_system_unitdir} \
+ ${systemd_user_unitdir} \
+"
+
+RDEPENDS:${PN} = " \
+ agl-compositor \
+ agl-session \
+ weston-ini-conf \
+"
+
+RCONFLICTS:${PN} = "weston-init"
diff --git a/meta-app-framework/recipes-graphics/wayland/weston-ini-conf.bbappend b/meta-app-framework/recipes-graphics/wayland/weston-ini-conf.bbappend
new file mode 100644
index 000000000..699275fe8
--- /dev/null
+++ b/meta-app-framework/recipes-graphics/wayland/weston-ini-conf.bbappend
@@ -0,0 +1 @@
+require ${@bb.utils.contains('AGL_FEATURES', 'agl-app-fw', 'weston-ini-conf_agl-app-fw.inc', '', d)}
diff --git a/meta-app-framework/recipes-graphics/wayland/weston-ini-conf_agl-app-fw.inc b/meta-app-framework/recipes-graphics/wayland/weston-ini-conf_agl-app-fw.inc
new file mode 100644
index 000000000..25213a9f1
--- /dev/null
+++ b/meta-app-framework/recipes-graphics/wayland/weston-ini-conf_agl-app-fw.inc
@@ -0,0 +1,3 @@
+RDEPENDS:${PN} = ""
+RDEPENDS:${PN}-landscape = ""
+RDEPENDS:${PN}-landscape-inverted = ""