A word of warning, first: this is an ongoing, unfinished project I'm developing for fun, mainly as an excuse to learn Rust.
This is the source repository of PiRESENCE, a (wannabe) Home Assistant (HA) addon for room presence detection.
The addon (will) listen to events from motion detector sensor via HA, update the current status and predict the presence state for each interconnected room, providing the informaton back to HA to be used for triggers or conditions.
These sections below show how to cross-compile this project for the aarch64-linux-unknown-musl
target.
Download and extract somewhere the aarch64 cross compilation tools for MUSL:
wget https://musl.cc/aarch64-linux-musl-cross.tgz
tar xvzf aarch64-linux-musl-cross.tgz -C /path/to/destination/
Append the path to the extracted toolchain to your PATH environment variable, e.g.
on ~/.bashrc
:
export PATH="$PATH:/path/to/destination/bin"
Reload your shell, then make sure the cargo config file has a section like the following one:
[target.aarch64-unknown-linux-musl]
linker = "aarch64-linux-musl-ld"
Finally, add the target with rustup:
rustup add target aarch64-unknown-linux-musl
From now on, the project may be compiled for Alpine aarch64 with the cargo command:
cargo build --target=aarch64-unknown-linux-musl
Make sure to have Docker installed. Then, install cross
:
cargo install cross
You may now compile the target like this:
cross build --release --target=aarch64-unknown-linux-musl
PiRESENCE is distributed under the terms of both the MIT license and the Apache License (Version 2.0).
See LICENSE-APACHE, LICENSE-MIT for details.