diff --git a/snapcraft/parts/plugins/matter_plugin.py b/snapcraft/parts/plugins/matter_plugin.py index 78cb79c202c..962cc44ee2c 100644 --- a/snapcraft/parts/plugins/matter_plugin.py +++ b/snapcraft/parts/plugins/matter_plugin.py @@ -115,23 +115,24 @@ def get_build_snaps(self) -> Set[str]: def get_build_commands(self) -> List[str]: commands = [] - if self.snap_arch == "arm64": - commands.extend( - [ - f"wget --no-verbose https://github.com/project-chip/zap/releases/download/v2023.11.13/zap-linux-{self.snap_arch}.zip", - f"unzip -o zap-linux-{self.snap_arch}.zip", - "echo 'export ZAP_INSTALL_PATH=$PWD'", - ] - ) + """Clone Matter repository if not present""" + commands.extend( + [ + f"if [ ! -d matter ]; then git clone --depth 1 -b v1.2.0.1 {MATTER_REPO} matter && cd matter; " + f"else cd matter || echo 'skip clone'; fi" + ] + ) + + """Checkout submodules for Linux platform""" + commands.extend(["scripts/checkout_submodules.py --shallow --platform linux"]) + + """Bootstrapping script for building Matter SDK and setting up the environment""" + commands.extend(["set +u && source setup/bootstrap.sh && set -u"]) commands.extend( [ - f"if [ ! -d matter ]; then git clone --depth 1 -b v1.2.0.1 {MATTER_REPO} matter; fi", - "cd matter || echo 'skip clone'", - f"scripts/checkout_submodules.py --shallow --platform linux", - f"set +u && source scripts/activate.sh && set -u", "cp -vr ./* $CRAFT_PART_INSTALL/", - "echo 'Cloned Matter repository and activated submodules'", + "echo 'Cloned Matter repository and built Matter SDK'", ] )