-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
+FILESEXTRAPATHS_prepend_rcar-gen3 := "${THISDIR}/${PN}:"
-SRC_URI_append_ulcb = " file://kingfisher_output.cfg"
-SRC_URI_append_ebisu = " file://ebisu_output.cfg"
-SRC_URI_append_salvator-x = " file://salvator-x_output.cfg"
+SRC_URI_append_rcar-gen3 = " \
+ file://kingfisher_output.cfg \
+ file://ebisu_output.cfg \
+ file://salvator-x_output.cfg \
+"
-do_configure() {
- echo repaint-window=34 >> ${WORKDIR}/core.cfg
+WESTON_FRAGMENTS_append_ulcb = " kingfisher_output"
+WESTON_FRAGMENTS_append_ebisu = " ebisu_output"
+WESTON_FRAGMENTS_append_salvator-x = " salvator-x_output"
- echo transition-duration=300 >> ${WORKDIR}/ivishell.cfg
- echo cursor-theme=default >> ${WORKDIR}/ivishell.cfg
+do_configure_append_rcar-gen3() {
+ echo repaint-window=34 >> ${WORKDIR}/core.cfg
}
##Generate a weston.ini file:
-To modify any of the default sections (core, shell, ivi-shell), add a
-do_configure() function to your bbappend:
+To modify any of the default sections (core, shell), add a
+do_configure() function to your bbappend, using machine (e.g. h3ulcb)
+overrides (i.e. use the MACHINE name where "machine" is used below):
'''
-do_configure() {
+do_configure_machine() {
echo repaint-window=34 >> ${WORKDIR}/core.cfg
echo transition-duration=300 >> ${WORKDIR}/ivishell.cfg
'''
or:
'''
-do_configure() {
+do_configure_machine() {
sed -i -e 's/drm-backend/fbdev-backend/' ${WORKDIR}/core.cfg
}
'''
-To change the display from the default assumption of an HDMI-1-A connected
-screen that needs to be rotated 270 degrees:
-
-'''
-SRC_URI_remove = "file://hdmi-a-1-270.cfg"
-SRC_URI += "file://hdmi-a-1-90.cfg"
+To add new non-display sections, just list them in SRC_URI and WESTON_FRAGMENTS:
'''
+FILESEXTRAPATHS_prepend_machine := "${THISDIR}/${PN}:"
+
+SRC_URI_append_machine = " file://foo.cfg"
+WESTON_FRAGMENTS_append_machine = " foo"
-To add new sections just list them in SRC_URI:
'''
-FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
-SRC_URI += "file://dsi.cfg"
+To change the display, for example from the default assumption of an
+HDMI-1-A connected screen that needs to be rotated 270 degrees to one
+that is rotated 90 degrees, redefine the WESTON_DISPLAYS variable:
+
+'''
+WESTON_DISPLAYS_machine = "hdmi-a-1-90"
'''
+
+Note that the weston-ini-conf recipe automatically generates a landscape
+orientation version of weston.ini by replacing 90/270 degree rotation
+fragments for HDMI-A-1 and the virtual output into 180 and 0 degrees,
+respectively. This landscape configuration can be used in an image by
+pulling in weston-ini-conf-landscape instead of weston-ini-conf.
-SUMMARY = "Startup script and systemd unit file for the Weston Wayland compositor"
+SUMMARY = "Configuration file for the Weston and AGL Wayland compositors"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
-SRC_URI = "file://core.cfg \
- file://shell.cfg \
- file://hdmi-a-1-270.cfg \
- "
-
-# cluster and html5-landscape
-# core, shell, hdmi-a-1-180.cfg, virtual-landscape.cfg
-SRC_URI_remove_landscape = " \
- file://hdmi-a-1-270.cfg \
+SRC_URI = " \
+ file://core.cfg \
+ file://shell.cfg \
file://hdmi-a-1-90.cfg \
- file://virtual.cfg \
-"
-SRC_URI_append_landscape = " \
file://hdmi-a-1-180.cfg \
- file://virtual-landscape.cfg \
+ file://hdmi-a-1-270.cfg \
+ file://remote-output.cfg \
+ file://virtual-270.cfg \
+ file://virtual-0.cfg \
"
-
S = "${WORKDIR}"
-PACKAGE_ARCH = "${MACHINE_ARCH}"
+inherit update-alternatives
+
+# Default primary display/orientation fragment
+WESTON_DISPLAYS ?= "hdmi-a-1-270"
+
+# Configuration fragments to use in weston.ini.*
+# Note that some may be replaced/removed when building the landscape
+# configuration.
+WESTON_FRAGMENTS = "core shell ${WESTON_DISPLAYS}"
+
+# On-target weston.ini directory
+weston_ini_dir = "${sysconfdir}/xdg/weston"
do_compile() {
- # Put all of our cfg files together.
- rm -f ${WORKDIR}/weston.ini
- for F in ${WORKDIR}/*.cfg; do
- cat $F >> ${WORKDIR}/weston.ini
- echo >> ${WORKDIR}/weston.ini
+ # Put all of our cfg files together for a default portrait
+ # orientation configuration
+ rm -f ${WORKDIR}/weston.ini.default
+ for F in ${WESTON_FRAGMENTS}; do
+ cat ${WORKDIR}/${F}.cfg >> ${WORKDIR}/weston.ini.default
+ echo >> ${WORKDIR}/weston.ini.default
done
- sed -i -e '$ d' ${WORKDIR}/weston.ini
+ sed -i -e '$ d' ${WORKDIR}/weston.ini.default
+
+ # Do it again, but filter fragments to configure for landscape
+ rm -f ${WORKDIR}/weston.ini.landscape
+ for F in ${WESTON_FRAGMENTS}; do
+ if echo $F | grep '^hdmi-a-1-\(90\|270\)$'; then
+ F="hdmi-a-1-180"
+ elif echo $F | grep '^virtual-270$'; then
+ F="virtual-0"
+ fi
+ cat ${WORKDIR}/${F}.cfg >> ${WORKDIR}/weston.ini.landscape
+ echo >> ${WORKDIR}/weston.ini.landscape
+ done
+ sed -i -e '$ d' ${WORKDIR}/weston.ini.landscape
}
do_install_append() {
- WESTON_INI_CONFIG=${sysconfdir}/xdg/weston
- install -d ${D}${WESTON_INI_CONFIG}
- install -m 0644 ${WORKDIR}/weston.ini ${D}${WESTON_INI_CONFIG}/weston.ini
+ install -d ${D}${weston_ini_dir}
+ install -m 0644 ${WORKDIR}/weston.ini.default ${D}${weston_ini_dir}/
+ install -m 0644 ${WORKDIR}/weston.ini.landscape ${D}${weston_ini_dir}/
}
+
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+# Use the alternative mechanism to handle multiple packages providing
+# weston.ini. This seems simpler than other possible approaches.
+# Note that for now the generated packages are being marked as
+# incompatible with each other for simplicity, that can be changed if
+# a usecase where switching between alternatives at runtime is desirable
+# appears.
+
+ALTERNATIVE_LINK_NAME[weston.ini] = "${weston_ini_dir}/weston.ini"
+
+RDEPENDS_${PN} = "weston-init"
+RPROVIDES_${PN} = "weston-ini"
+RCONFLICTS_${PN} = "${PN}-landscape"
+ALTERNATIVE_${PN} = "weston.ini"
+ALTERNATIVE_TARGET_${PN} = "${weston_ini_dir}/weston.ini.default"
+
+PACKAGE_BEFORE_PN += "${PN}-landscape"
+
+FILES_${PN}-landscape = "${weston_ini_dir}/weston.ini.landscape"
+
+RDEPENDS_${PN}-landscape = "weston-init"
+RPROVIDES_${PN}-landscape = "weston-ini"
+RCONFLICTS_${PN}-landscape = "${PN}"
+ALTERNATIVE_${PN}-landscape = "weston.ini"
+ALTERNATIVE_TARGET_${PN}-landscape = "${weston_ini_dir}/weston.ini.landscape"