Headless Rust gRPC daemon to drive Bluetooth, HLS/DASH playback, and snapcast/shairport-sync/squeezelite on Raspberry Pi audio rigs.
1.6 kB
36 lines
1FROM ghcr.io/cross-rs/arm-unknown-linux-gnueabihf:main
2
3# armhf system libs the cross-compiled binary links against.
4RUN dpkg --add-architecture armhf && \
5 rm -f /etc/apt/preferences.d/all-packages && \
6 apt-get update && \
7 apt-get --assume-yes install --no-install-recommends \
8 curl \
9 unzip \
10 ca-certificates \
11 libasound2-dev:armhf \
12 libdbus-1-dev:armhf \
13 libsystemd-dev:armhf \
14 libsystemd0:armhf && \
15 rm -rf /var/lib/apt/lists/*
16
17# Install a modern protoc — the cross base image's distro package ships
18# protoc 3.6 which predates proto3 `optional` and doesn't recognise the
19# --experimental_allow_proto3_optional flag we set in build.rs. protoc runs
20# on the build host (x86_64), not the armhf target.
21ARG PROTOC_VERSION=25.1
22RUN curl -fsSL "https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-x86_64.zip" -o /tmp/protoc.zip && \
23 unzip -q /tmp/protoc.zip -d /usr/local && \
24 rm /tmp/protoc.zip && \
25 chmod +x /usr/local/bin/protoc && \
26 protoc --version
27
28ENV PKG_CONFIG_PATH=/usr/lib/arm-linux-gnueabihf/pkgconfig \
29 PKG_CONFIG_LIBDIR=/usr/lib/arm-linux-gnueabihf/pkgconfig \
30 PKG_CONFIG_SYSROOT_DIR=/ \
31 PKG_CONFIG_ALLOW_CROSS=1
32
33# `bluer` → libdbus-1, and libdbus-1 has an indirect dependency on
34# libsystemd.so.0. `-L` only resolves direct `-l<name>` args, so the linker
35# needs `-rpath-link` to find indirect deps via the multiarch lib dir.
36ENV CARGO_TARGET_ARM_UNKNOWN_LINUX_GNUEABIHF_RUSTFLAGS="-C link-arg=-Wl,-rpath-link=/usr/lib/arm-linux-gnueabihf"