1
0
Fork 0

Compare commits

...

3 Commits

Author SHA1 Message Date
Alexander Böhm df2a35f4d3 Added cross compile configuration 2024-01-05 15:02:36 +01:00
Alexander Böhm af91ec61c9 Enabled stripping for release builds 2024-01-05 15:02:12 +01:00
Alexander Böhm f16bc27499 Added build instruction 2024-01-05 15:01:24 +01:00
4 changed files with 34 additions and 0 deletions

5
.cargo/config.toml Normal file
View File

@ -0,0 +1,5 @@
[target.armv7-unknown-linux-musleabi]
linker = "arm-linux-gnueabi-gcc"
[target.armv7-unknown-linux-musleabihf]
linker = "arm-linux-gnueabihf-gcc"

View File

@ -12,3 +12,6 @@ log = "0.4.20"
rppal = "0.14.1"
spaceapi-dezentrale-client = { git = "https://github.com/dezentrale/spaceapi-rs.git", package = "spaceapi-dezentrale-client", branch = "main" }
tokio = { version = "1.35.1", features = ["macros"] }
[profile.release]
strip = true

View File

@ -10,3 +10,25 @@ Please change `DOOR_PIN` accordingly.
You need to provide the environment variables
`SPACEAPI_URL` and `API_KEY`.
## Build
[Install stable version of rust](https://rustup.rs/) and run a regular cargo build:
```sh
cargo build
```
### Cross compile
Install arm toolchain and *libmusl* for static linked binaries:
```sh
apt-get install gcc-arm-linux-gnueabihf musl-dev musl-tools
```
Build the application for raspberry pi:
```sh
cargo build --target=armv7-unknown-linux-musleabihf
```

4
rust-toolchain Normal file
View File

@ -0,0 +1,4 @@
[toolchain]
channel = "stable"
targets = ["armv7-unknown-linux-musleabihf"]
profile = "default"