# Minimal cross-build of shairport-sync with the OHM Songcast sender backend, # for linux/arm64 (Raspberry Pi OS aarch64). Produces a glibc binary compatible # with Debian bullseye (glibc 2.31) and later (e.g. bookworm). # # Usage from the repo root: # docker buildx build --platform linux/arm64 --target binary \ # -f docker/Dockerfile.ohm --output type=local,dest=./out-ohm . # # Then copy ./out-ohm/shairport-sync to the Pi. # # FFmpeg is taken from Debian packages (libavcodec-dev etc.) rather than built # from source, to keep the cross-build fast under emulation. ARG DEBIAN_VERSION=bullseye FROM --platform=linux/arm64 debian:${DEBIAN_VERSION} AS builder ENV DEBIAN_FRONTEND=noninteractive RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ autoconf \ automake \ libtool \ pkg-config \ git \ ca-certificates \ xxd \ libasound2-dev \ libplist-dev \ libplist-utils \ libssl-dev \ libsodium-dev \ libgcrypt-dev \ uuid-dev \ libavcodec-dev \ libavformat-dev \ libswresample-dev \ libavutil-dev \ libavahi-client-dev \ avahi-daemon \ libdbus-1-dev \ libglib2.0-dev \ libconfig-dev \ libpopt-dev \ libsndfile-dev \ libsoxr-dev \ xmltoman \ && rm -rf /var/lib/apt/lists/* WORKDIR /shairport-sync COPY . . WORKDIR /shairport-sync/build RUN autoreconf -i ../ RUN ../configure --sysconfdir=/etc --with-alsa \ --with-avahi --with-ssl=openssl \ --with-airplay-2 --with-ffmpeg --with-metadata \ --with-ohm --with-dummy --with-pipe --with-stdout \ --with-dbus-interface --with-mpris-interface \ --with-convolution --with-soxr RUN make -j"$(nproc)" # Target that yields just the binary on the host filesystem via --output. FROM --platform=linux/arm64 scratch AS binary COPY --from=builder /shairport-sync/build/shairport-sync /shairport-sync