diff mbox series

[meta-zephyr,4/5] zephyr-sdk: Add recipe to download and build the Zephyr SDK

Message ID 20220906131702.310027-4-peter.hoyes@arm.com
State New
Headers show
Series [meta-zephyr,1/5] Cleanup README.txt files | expand

Commit Message

Peter Hoyes Sept. 6, 2022, 1:17 p.m. UTC
From: Peter Hoyes <Peter.Hoyes@arm.com>

The Zephyr SDK (https://github.com/zephyrproject-rtos/sdk-ng) provides
pre-built toolchains for all of Zephyr's supported architectures.

Add a recipe to download SDK v0.14.2, in preparation for adding an
option to build Zephyr applications using this toolchain instead of the
Yocto-built one.

Signed-off-by: Peter Hoyes <Peter.Hoyes@arm.com>
---
 .../zephyr-sdk/zephyr-sdk_0.14.2.bb           | 35 +++++++++++++++++++
 1 file changed, 35 insertions(+)
 create mode 100644 meta-zephyr-core/recipes-devtools/zephyr-sdk/zephyr-sdk_0.14.2.bb
diff mbox series

Patch

diff --git a/meta-zephyr-core/recipes-devtools/zephyr-sdk/zephyr-sdk_0.14.2.bb b/meta-zephyr-core/recipes-devtools/zephyr-sdk/zephyr-sdk_0.14.2.bb
new file mode 100644
index 0000000..c893652
--- /dev/null
+++ b/meta-zephyr-core/recipes-devtools/zephyr-sdk/zephyr-sdk_0.14.2.bb
@@ -0,0 +1,35 @@ 
+SUMMARY = "Zephyr SDK Bundle"
+DESCRIPTION = "Official SDK built using crosstool-ng, distributed by the \
+Zephyr project"
+COMPATIBLE_HOST = "(x86_64|aarch64).*-linux"
+
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
+
+INHIBIT_DEFAULT_DEPS = "1"
+# CMake is required by the setup script
+DEPENDS += "cmake"
+
+SDK_ARCHIVE = "zephyr-sdk-${PV}_linux-${BUILD_ARCH}.tar.gz"
+SDK_NAME = "${BUILD_ARCH}"
+SRC_URI = "https://github.com/zephyrproject-rtos/sdk-ng/releases/download/v${PV}/${SDK_ARCHIVE};subdir=${S};name=${SDK_NAME}"
+
+SRC_URI[x86_64.sha256sum] = "2ff0e4d79bffe1468247a3e1958aa9183a0252225ab721cf1c37188bd4b649a2"
+SRC_URI[aarch64.sha256sum] = "cbb616a50e940388ea737788d48dcea3624a85bb3ee04d9aae105496a21ae75e"
+
+do_configure[noexec] = "1"
+do_compile[noexec] = "1"
+
+ZEPHYR_SDK_DIR = "${prefix}/zephyr-sdk"
+
+do_install() {
+    install -d ${D}${prefix}
+    cp -r ${S}/zephyr-sdk-${PV} ${D}${ZEPHYR_SDK_DIR}
+
+    # Install host tools
+    ${D}${ZEPHYR_SDK_DIR}/setup.sh -h
+}
+
+SYSROOT_DIRS += "${ZEPHYR_SDK_DIR}"
+INHIBIT_SYSROOT_STRIP = "1"
+BBCLASSEXTEND = "native"