From 68f1b73e6c89d5a1a352f4f2c4bcfa08493c394c Mon Sep 17 00:00:00 2001 From: Mengyi Date: Thu, 11 Jan 2024 13:55:23 +0100 Subject: [PATCH] Build hello world snap based on Matter lighting app --- .../matter-hello/README.md | 4 +- .../matter-hello/snap/snapcraft.yaml | 50 ++++++++++++++++--- 2 files changed, 43 insertions(+), 11 deletions(-) diff --git a/tests/spread/plugins/craft-parts/build-and-run-hello/matter-hello/README.md b/tests/spread/plugins/craft-parts/build-and-run-hello/matter-hello/README.md index 3bb060837b..1a423c024c 100644 --- a/tests/spread/plugins/craft-parts/build-and-run-hello/matter-hello/README.md +++ b/tests/spread/plugins/craft-parts/build-and-run-hello/matter-hello/README.md @@ -4,7 +4,5 @@ A new Matter project. ## Getting Started -This project is a starting point for a Matter application. +This project is a starting point for an simple application based on [Matter SDK](https://github.com/project-chip/connectedhomeip). -For help getting started with Matter development, view the -[Matter SDK](https://github.com/project-chip/connectedhomeip). diff --git a/tests/spread/plugins/craft-parts/build-and-run-hello/matter-hello/snap/snapcraft.yaml b/tests/spread/plugins/craft-parts/build-and-run-hello/matter-hello/snap/snapcraft.yaml index f8ae1bccee..430523120a 100644 --- a/tests/spread/plugins/craft-parts/build-and-run-hello/matter-hello/snap/snapcraft.yaml +++ b/tests/spread/plugins/craft-parts/build-and-run-hello/matter-hello/snap/snapcraft.yaml @@ -1,20 +1,54 @@ name: matter-hello version: "1.0" summary: simple matter application -description: build an application using Matter SDK and say "hello world" +description: build an example lighting application using Matter SDK and say "hello world" base: core22 confinement: strict apps: - hello: - command: - hello + lighting: + daemon: simple + install-mode: disable + command: bin/lighting-app + plugs: + - network + - network-bind + - bluez + - avahi-control + - gpio-memory-control + - otbr-dbus-wpan0 parts: - matter: + lighting-hello: plugin: matter matter-sdk-version: "master" matter-zap-version: "v2023.11.13" - hello: - plugin: dump - source: . + source: app + override-build: | + craftctl default + cd $CRAFT_PART_BUILD/matter + + # Build a lighting example + + cd examples/lighting-app/linux + gn gen out/build --args='is_debug=true' + ninja -C out/build + + # ldd out/build/chip-lighting-app + + # mkdir -p $CRAFT_PART_INSTALL/bin + # cp out/build/chip-lighting-app $CRAFT_PART_INSTALL/bin/lighting-app + build-packages: + - gcc + - git + - g++ + - libdbus-1-dev + - libglib2.0-dev + - libssl-dev + - ninja-build + - pkg-config + - python-is-python3 + - python3-dev + - python3-venv + - unzip +