Out-of-the-box tool that cross compile a rust tauri project for raspberry pi target.
One can run xcompile.sh -h and see:
Cross compile a rust tauri application to debian package for raspberry pi (armhf/arm64).
Syntax: ./xcompile.sh [-c|h] [-e|n|p|t|a ARG]
Option:
-e <DEBIAN_VERSION>
to set debian version of compilation environment
available versions are bookworm (debian 12, default) and bullseye (debian 11)
-n <PROJECT_NAME>
to set compilation target project
default value is project
-p <PROJECT_PATH>
to set path of compilation target project
default value is ./project
-a <RASP_ARCH>
to set architecture of raspberry pi
default value: arm64
-t <TARGET_PATH>
to set path of compilation target path
default value is .
-c clean up all compilation targets before cross compile
default not to clean up
-h show the help messageYou can create a .xcompile file in the same directory of xcompile.sh to configure the default values. A template with default values is provided in .xcompile.example.
cp .xcompile.example .xcompile
# Edit .xcompile with your preferencesThe file is sourced by the script, so you can use shell variables.
# Example .xcompile
DEBIAN_VER="bullseye"
RASP_ARCH="arm64" # arm64 or armhf
PROJECT_PATH="../my-project"
PROJECT="app"
TARGET_PATH="./dist"
DO_CLEANUP="true" # Set to "true" to enable cargo cleanCLI arguments will always override the values in .xcompile.
Situation:
- Project name:
my_project - Project path:
/path/to/my_project - Raspberry pi architecture:
arm64(ARMv8), e.g. Raspberry pi 4b - Base of Raspberry Pi OS, a.k.a. debian version:
bookworm(debian 12) - Path to get compilation result:
..(parent directory of shell)
One can cross compile a tauri app by running:
./xcompile.sh -e bookworm -n my_project -p /path/to/my_project -a arm64 -t ..dockerinstalled anddockerdis running
| status | hardware | os |
|---|---|---|
| ✅ | Raspberry Pi 4 Model B | Raspberry Pi OS - Debian 11 (bullseye) aarch64 |
| ✅ | Raspberry Pi Zero 2 w | Raspberry Pi OS Lite - Debian 12 (bookworm) aarch64 |
If you are looking for a GitHub Action to automate the build process, check out xc-tauri-rasp-action.
We welcome any kinds of contribution, feel free to post issues and pull requests :)