1
0
Fork 0
mirror of https://github.com/librespot-org/librespot.git synced 2025-10-03 17:59:24 +02:00
librespot/contrib/cross-compile-armv6hf/docker-build.sh
Dariusz Olszewski cf61ede6c6
Fix cross compilation for armv6hf (Raspberry Pi 1) (#1457)
* Use ring instead of aws-lc as the default backend for hyper-rustls

Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>

* Cross-compile with libmdns

Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>

* Simplify Docker image to cross-compile for armv6hf (RPi 1)

Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>

* Revert "Use ring instead of aws-lc as the default backend for hyper-rustls"

This reverts commit faeaf506d6.

* Fix bindgen issues (aws-lc-rs) when cross-compiling for armv6hf

Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>

* Add git to the Docker image for cross-compiling

Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>

---------

Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
Co-authored-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
2025-02-03 22:50:47 +01:00

17 lines
602 B
Bash
Executable file

#!/usr/bin/env bash
set -eux
cargo install --force --locked bindgen-cli
PI1_TOOLS_DIR=/pi/tools/arm-bcm2708/arm-linux-gnueabihf
PI1_TOOLS_SYSROOT_DIR=$PI1_TOOLS_DIR/arm-linux-gnueabihf/sysroot
PI1_LIB_DIRS=(
"$PI1_TOOLS_SYSROOT_DIR/lib"
"$PI1_TOOLS_SYSROOT_DIR/usr/lib"
"/sysroot/usr/lib/arm-linux-gnueabihf"
)
export RUSTFLAGS="-C linker=$PI1_TOOLS_DIR/bin/arm-linux-gnueabihf-gcc ${PI1_LIB_DIRS[*]/#/-L}"
export BINDGEN_EXTRA_CLANG_ARGS=--sysroot=$PI1_TOOLS_SYSROOT_DIR
cargo build --release --target arm-unknown-linux-gnueabihf --no-default-features --features "alsa-backend with-libmdns"