Building the SDK

From AsteroidOS
Revision as of 22:44, 21 August 2024 by Beroset (talk | contribs) (→‎Which SDK?: update to scarthgap toolchain installer names)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Summary

This page describes how to build the Software Development Kit (SDK) for AsteroidOS without using software containers. If you want to build the SDK using containers, see Building the SDK in a container instead.

If you're not sure which you want, skip to With or without software containers?

If you're not sure why you would want an SDK, continue reading.

What is an SDK?

The Software Development Kit (SDK) for AsteroidOS is a set of tools and libraries for developing software to run on AsteroidOS. Since AsteroidOS is a Linux distribution, you can use just about any programming language to develop software, but most of the core applications use a combination of C++ and Qt, with CMake to build. To get things running quickly, it's recommended to download and install the prebuilt version as described in Installing the SDK. This page describes how to build the SDK from source. Be aware that this can take several hours, even on a fast computer.

Which SDK?

One thing to note is that while this describes "the SDK", there are actually two versions -- the main one is used to develop software that runs on ARM-based watches running AsteroidOS. The other one is the SDK for developing applications that run on the emulator, which uses qemux86. See the Emulator page for details on the qemux86 version. This page describes only the main ARM-based SDK but building the emulator version is almost the same. The only difference is that instead of this:

source ./prepare-build.sh sturgeon
bitbake meta-toolchain-qt5

you would do this instead:

source ./prepare-build.sh qemux86
bitbake meta-toolchain-qt5

You can install both SDKs on the same machine -- they do not interfere.

With or without software containers?

There are two choices to build the SDK: build natively without software containers or build within a software container (such as docker or podman).

Building natively requires somewhat fewer resources (memory and disk space) than building with containers but requires software, such a compilers and other tools, to be installed on the host system. Since these software packages are different for each Linux distribution, this method requires more knowledge and patience to install required software that might not already be installed on your host computer.

The alternative, building with software containers, is somewhat more simpler in that the required software is only installed within the container and not on your host computer, but it requires much more time to compile everything. Still, this may be preferable for people who wish to keep the build environment isolated from the host computer.

Building the Cross Compilation Toolchain

If you’ve already got an OpenEmbedded build directory via the Building AsteroidOS page, cd to that directory. Else, create one with:

git clone https://github.com/AsteroidOS/asteroid
cd asteroid/

Then, build the cross compilation toolchain with:

source ./prepare-build.sh dory
bitbake meta-toolchain-qt5


Install the SDK

Whether you have built with or without containers, if the process was successful, you should have an SDK installation script tmp-glibc/deploy/sdk/oecore-meta-toolchain-qt5-x86_64-armv7vehf-neon-sturgeon-toolchain-nodistro.0.sh (relative to the build directory) -- or a oecore-meta-toolchain-qt5-x86_64-core2-32-qemux86-toolchain-nodistro.0.sh script if you are building the version of the SDK for the emulator. Follow these steps to install the SDK.

Related pages

Building the SDK in a container

installing the SDK

Building AsteroidOS

Creating an Asteroid app