meta-digi-dey: refactor connectcore demo recipes

Replace the standalone connectcore-demo-example-webkit recipe with
a bbappend extending the main demo recipe. This is in preparation for
adding support for chromium-based connectcore demo.

While on it, merge the .inc file into the main recipe as there is only a
consumer of that inc file. Also minor cosmetic fixes to make the recipe
more Yoct-ish.

https://onedigi.atlassian.net/browse/DEL-9838

Signed-off-by: Javier Viguera <javier.viguera@digi.com>
This commit is contained in:
Javier Viguera 2025-11-20 16:07:12 +01:00
parent 06175c3c26
commit 87b73f3f5d
7 changed files with 153 additions and 169 deletions

View File

@ -1,12 +1,12 @@
#
# Copyright (C) 2020-2023, Digi International Inc.
# Copyright (C) 2020-2025, Digi International Inc.
#
SUMMARY = "WebKit packagegroup for DEY image"
PACKAGE_ARCH = "${MACHINE_ARCH}"
inherit packagegroup
CC_DEMO_PACKAGE ?= "connectcore-demo-example-webkit-multimedia"
CC_DEMO_PACKAGE ?= "connectcore-demo-example-multimedia connectcore-demo-example-webkit"
CC_DEMO_PACKAGE:ccmp1 ?= "connectcore-demo-example-webkit"
# Include WPE WebKit, launcher (cog) and examples

View File

@ -1,62 +0,0 @@
# Copyright (C) 2022-2024, Digi International Inc.
require recipes-digi/dey-examples/connectcore-demo-example.inc
WESTON_SERVICE ?= "weston.service"
WESTON_SERVICE:ccmp15 ?= "weston-launch.service"
WESTON_SERVICE:ccmp25 ?= "weston-launch.service"
CC_DEMO_ENV ?= "DISPLAY=:0.0 XDG_RUNTIME_DIR=/run/user/0 WAYLAND_DISPLAY=\$\{DEMO_DISPLAY\}"
CC_DEMO_ENV:ccimx6ul ?= ""
FILESEXTRAPATHS:prepend := "${THISDIR}/../../../../recipes-digi/dey-examples/connectcore-demo-example:"
SRC_URI += " \
file://connectcore-demo-example-init \
file://connectcore-demo-example.service \
"
do_install:append() {
# Install systemd service
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
# Install systemd unit files
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/connectcore-demo-example.service ${D}${systemd_unitdir}/system/
sed -i -e "s,##WESTON_SERVICE##,${WESTON_SERVICE},g" \
"${D}${systemd_unitdir}/system/connectcore-demo-example.service"
fi
# Install connectcore-demo-example-init
install -d ${D}${sysconfdir}/init.d/
install -m 755 ${WORKDIR}/connectcore-demo-example-init ${D}${sysconfdir}/connectcore-demo-example
sed -i -e "s@##CC_DEMO_ENV##@${CC_DEMO_ENV}@g" \
-e "s@##CC_DEMO_DISPLAY##@${WAYLAND_DISPLAY}@g" \
"${D}${sysconfdir}/connectcore-demo-example"
ln -sf ${sysconfdir}/connectcore-demo-example ${D}${sysconfdir}/init.d/connectcore-demo-example
}
FILES:${PN}:append = " \
${systemd_unitdir}/system/connectcore-demo-example.service \
${sysconfdir}/connectcore-demo-example \
${sysconfdir}/init.d/connectcore-demo-example \
"
RDEPENDS:${PN} += "cog"
# 'connectcore-demo-example-init' script uses '/etc/init.d/functions'
RDEPENDS:${PN} += "initscripts-functions"
INITSCRIPT_PACKAGES += "${PN}"
INITSCRIPT_NAME:${PN} = "connectcore-demo-example"
INITSCRIPT_PARAMS:${PN} = "start 19 2 3 4 5 . stop 21 0 1 6 ."
SYSTEMD_PACKAGES += "${PN}"
SYSTEMD_SERVICE:${PN} = "connectcore-demo-example.service"
RREPLACES:${PN} = "connectcore-demo-example"
RCONFLICTS:${PN} = "connectcore-demo-example"
RDEPENDS:${PN}-multimedia += " \
video-examples \
webglsamples \
"

View File

@ -0,0 +1,50 @@
# Copyright 2025, Digi International Inc.
FILESEXTRAPATHS:prepend := "${THISDIR}/connectcore-demo-example:"
SRC_URI += "\
file://connectcore-demo-example-webkit-init \
file://connectcore-demo-example-webkit.service \
"
CC_DEMO_ENV ?= "DISPLAY=:0.0 XDG_RUNTIME_DIR=/run/user/0 WAYLAND_DISPLAY=\$\{DEMO_DISPLAY\}"
CC_DEMO_ENV:ccimx6ul ?= ""
WESTON_SERVICE ?= "weston.service"
WESTON_SERVICE:ccmp15 ?= "weston-launch.service"
WESTON_SERVICE:ccmp25 ?= "weston-launch.service"
do_install:append() {
# Install the webkit systemd unit
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/connectcore-demo-example-webkit.service ${D}${systemd_unitdir}/system/
sed -i -e "s,##WESTON_SERVICE##,${WESTON_SERVICE},g" \
${D}${systemd_unitdir}/system/connectcore-demo-example-webkit.service
fi
# Install the init script
install -d ${D}${sysconfdir}/init.d/
install -m 755 ${WORKDIR}/connectcore-demo-example-webkit-init ${D}${sysconfdir}/connectcore-demo-example-webkit
sed -i -e "s@##CC_DEMO_ENV##@${CC_DEMO_ENV}@g" \
-e "s@##CC_DEMO_DISPLAY##@${WAYLAND_DISPLAY}@g" \
${D}${sysconfdir}/connectcore-demo-example-webkit
ln -sf ../connectcore-demo-example-webkit ${D}${sysconfdir}/init.d/
}
PACKAGES =+ "${PN}-webkit"
FILES:${PN}-webkit += "\
${systemd_unitdir}/system/connectcore-demo-example-webkit.service \
${sysconfdir}/connectcore-demo-example-webkit \
${sysconfdir}/init.d/connectcore-demo-example-webkit \
"
RDEPENDS:${PN}-webkit = "cog initscripts-functions"
INITSCRIPT_PACKAGES += "${PN}-webkit"
INITSCRIPT_NAME:${PN}-webkit = "connectcore-demo-example-webkit"
INITSCRIPT_PARAMS:${PN}-webkit = "start 19 2 3 4 5 . stop 21 0 1 6 ."
SYSTEMD_PACKAGES += "${PN}-webkit"
SYSTEMD_SERVICE:${PN}-webkit = "connectcore-demo-example-webkit.service"

View File

@ -8,8 +8,8 @@ Requires=##WESTON_SERVICE##
[Service]
Type=forking
ExecStart=/etc/connectcore-demo-example start
ExecStop=/etc/connectcore-demo-example stop
ExecStart=/etc/connectcore-demo-example-webkit start
ExecStop=/etc/connectcore-demo-example-webkit stop
[Install]
WantedBy=multi-user.target

View File

@ -1,3 +1,100 @@
# Copyright (C) 2022, Digi International Inc.
# Copyright (C) 2022-2025, Digi International Inc.
require connectcore-demo-example.inc
require dey-examples-src.inc
SUMMARY = "Connectcore demo"
DESCRIPTION = "Connectcore demo"
HOMEPAGE = "https://github.com/digi-embedded/dey-examples"
SECTION = "examples"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6"
SRC_URI += "\
file://connectcore-demo-server-init \
file://connectcore-demo-server.service \
file://suspendtarget-connectcore-demo-server.service \
"
S = "${WORKDIR}/git/connectcore-demo-example"
do_configure[noexec] = "1"
do_compile[noexec] = "1"
inherit systemd update-rc.d
BOARD_IMAGE_FILE ?= "${MACHINE}_board.png"
BOARD_IMAGE_FILE:ccimx6qpsbc ?= "ccimx6sbc_board.png"
BOARD_IMAGE_FILE:ccimx91-dvk ?= "ccimx93-dvk_board.png"
do_install() {
install -d ${D}${servicedir}/www
\cp --remove-destination -r * ${D}${servicedir}/www/
# Remove unused images
find ${D}${servicedir}/www/static/images/ -type f -name '*_board.png' -not -name '${BOARD_IMAGE_FILE}' -delete
# Install systemd service
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
# Install systemd unit files
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/connectcore-demo-server.service ${D}${systemd_unitdir}/system/
install -m 0644 ${WORKDIR}/suspendtarget-connectcore-demo-server.service ${D}${systemd_unitdir}/system/
fi
# Install connectcore-demo-server-init
install -d ${D}${sysconfdir}/init.d/
install -m 755 ${WORKDIR}/connectcore-demo-server-init ${D}${sysconfdir}/connectcore-demo-server
ln -sf ${sysconfdir}/connectcore-demo-server ${D}${sysconfdir}/init.d/connectcore-demo-server
}
PACKAGE_ARCH = "${MACHINE_ARCH}"
PACKAGES =+ "${PN}-server ${PN}-multimedia"
FILES:${PN} += "\
${servicedir}/www/* \
"
FILES:${PN}-multimedia += "\
${servicedir}/www/multimedia* \
${servicedir}/www/static/images/aquarium.jpg \
${servicedir}/www/static/images/big_buck_bunny.jpg \
${servicedir}/www/static/images/blob.jpg \
${servicedir}/www/static/images/cpu.png \
${servicedir}/www/static/images/electricflower.jpg \
${servicedir}/www/static/images/multiple-views.jpg \
${servicedir}/www/static/images/ram.png \
${servicedir}/www/static/images/spacerocks.jpg \
${servicedir}/www/static/images/toon-shading.jpg \
${servicedir}/www/static/js/multimedia.js \
"
FILES:${PN}-server += "\
${servicedir}/www/demoserver.py \
${systemd_unitdir}/system/connectcore-demo-server.service \
${systemd_unitdir}/system/suspendtarget-connectcore-demo-server.service \
${sysconfdir}/connectcore-demo-server \
${sysconfdir}/init.d/connectcore-demo-server \
"
RDEPENDS:${PN} = "${PN}-server"
RDEPENDS:${PN}-multimedia = "${PN} video-examples webglsamples"
RDEPENDS:${PN}-server = " \
busybox-httpd \
libdigiapix-python3 \
mpg123 \
python3-connectcore-ble \
python3-core \
python3-httplib2 \
python3-json \
python3-logging \
python3-netserver \
"
INITSCRIPT_PACKAGES = "${PN}-server"
INITSCRIPT_NAME:${PN}-server = "connectcore-demo-server"
INITSCRIPT_PARAMS:${PN}-server = "start 20 2 3 4 5 . stop 21 0 1 6 ."
SYSTEMD_PACKAGES = "${PN}-server"
SYSTEMD_SERVICE:${PN}-server = " \
connectcore-demo-server.service \
suspendtarget-connectcore-demo-server.service \
"

View File

@ -1,101 +0,0 @@
# Copyright (C) 2022-2025, Digi International Inc.
require dey-examples-src.inc
SUMMARY = "Connectcore demo"
DESCRIPTION = "Connectcore demo"
SECTION = "examples"
LICENSE = "GPL-2.0-only"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-2.0-only;md5=801f80980d171dd6425610833a22dbe6"
SRC_URI += " \
file://connectcore-demo-server-init \
file://connectcore-demo-server.service \
file://suspendtarget-connectcore-demo-server.service \
"
S = "${WORKDIR}/git/connectcore-demo-example"
do_configure[noexec] = "1"
do_compile[noexec] = "1"
inherit systemd update-rc.d
BOARD_IMAGE_FILE ?= "${MACHINE}_board.png"
# Some boards re-use other boards' images
BOARD_IMAGE_FILE:ccimx6qpsbc = "ccimx6sbc_board.png"
BOARD_IMAGE_FILE:ccimx91-dvk = "ccimx93-dvk_board.png"
do_install() {
install -d ${D}${servicedir}/www
\cp --remove-destination -r * ${D}${servicedir}/www/
# Remove unused images
find ${D}${servicedir}/www/static/images/ -type f -name '*_board.png' -not -name '${BOARD_IMAGE_FILE}' -delete
# Install systemd service
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
# Install systemd unit files
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/connectcore-demo-server.service ${D}${systemd_unitdir}/system/
install -m 0644 ${WORKDIR}/suspendtarget-connectcore-demo-server.service ${D}${systemd_unitdir}/system/
fi
# Install connectcore-demo-server-init
install -d ${D}${sysconfdir}/init.d/
install -m 755 ${WORKDIR}/connectcore-demo-server-init ${D}${sysconfdir}/connectcore-demo-server
ln -sf ${sysconfdir}/connectcore-demo-server ${D}${sysconfdir}/init.d/connectcore-demo-server
}
PACKAGE_ARCH = "${MACHINE_ARCH}"
PACKAGES =+ "${PN}-server ${PN}-multimedia"
FILES:${PN} += " \
${servicedir}/www/* \
"
FILES:${PN}-multimedia += " \
${servicedir}/www/multimedia* \
${servicedir}/www/static/images/aquarium.jpg \
${servicedir}/www/static/images/big_buck_bunny.jpg \
${servicedir}/www/static/images/blob.jpg \
${servicedir}/www/static/images/cpu.png \
${servicedir}/www/static/images/electricflower.jpg \
${servicedir}/www/static/images/multiple-views.jpg \
${servicedir}/www/static/images/ram.png \
${servicedir}/www/static/images/spacerocks.jpg \
${servicedir}/www/static/images/toon-shading.jpg \
${servicedir}/www/static/js/multimedia.js \
"
FILES:${PN}-server += " \
${servicedir}/www/demoserver.py \
${systemd_unitdir}/system/connectcore-demo-server.service \
${systemd_unitdir}/system/suspendtarget-connectcore-demo-server.service \
${sysconfdir}/connectcore-demo-server \
${sysconfdir}/init.d/connectcore-demo-server \
"
RDEPENDS:${PN} = "${PN}-server"
RDEPENDS:${PN}-multimedia = "${PN}"
RDEPENDS:${PN}-server = " \
busybox-httpd \
libdigiapix-python3 \
mpg123 \
python3-connectcore-ble \
python3-core \
python3-httplib2 \
python3-json \
python3-logging \
python3-netserver \
"
INITSCRIPT_PACKAGES = "${PN}-server"
INITSCRIPT_NAME:${PN}-server = "connectcore-demo-server"
INITSCRIPT_PARAMS:${PN}-server = "start 20 2 3 4 5 . stop 21 0 1 6 ."
SYSTEMD_PACKAGES = "${PN}-server"
SYSTEMD_SERVICE:${PN}-server = " \
connectcore-demo-server.service \
suspendtarget-connectcore-demo-server.service \
"