FROM debian:buster

ENV DEBIAN_FRONTEND noninteractive

# Add armhf dpkg architecture and add cross-compiling toolchain and
# tools
RUN dpkg --add-architecture armhf

RUN apt-get clean && \
    apt update && \
    apt install -y \
        devscripts \
        gcc-8-arm-linux-gnueabihf-base \
        gcc-arm-linux-gnueabihf \
        binutils-arm-linux-gnueabihf \
        g++-arm-linux-gnueabihf \
        cpp-arm-linux-gnueabihf \
        binutils-arm-linux-gnueabihf-dbg \
        crossbuild-essential-armhf \
        build-essential && \
    rm -rf /var/lib/apt/lists/*

# Speed up mk-build-deps
RUN apt update && \
    apt install -y -o Acquire::Retries=3 \
        git \
        autoconf \
        automake \
        autopoint \
        cmake \
        libtool \
        nasm \
        libdbus-1-dev \
        libdbus-c++-dev \
        libargon2-0-dev \
        libcanberra-gtk3-dev:armhf \
        libclutter-gtk-1.0-dev:armhf \
        libclutter-1.0-dev:armhf \
        libglib2.0-dev \
        libgtk-3-dev \
        libnotify-dev \
        qtbase5-dev \
        qttools5-dev \
        qttools5-dev-tools \
        yasm \
        autotools-dev \
        gettext \
        libpulse-dev \
        libasound2-dev \
        libexpat1-dev \
        libpcre3-dev \
        libyaml-cpp-dev \
        libboost-dev \
        libxext-dev \
        libxfixes-dev \
        libspeex-dev \
        libspeexdsp-dev \
        uuid-dev \
        libavcodec-dev \
        libavutil-dev \
        libavformat-dev \
        libswscale-dev \
        libavdevice-dev \
        libopus-dev \
        libudev-dev \
        libgsm1-dev \
        libjsoncpp-dev \
        libmsgpack-dev \
        libnatpmp-dev \
        libappindicator3-dev \
        libqrencode-dev \
        libnm-dev \
        libwebkit2gtk-4.0-dev \
        libcrypto++-dev \
        libva-dev \
        libvdpau-dev \
        libssl-dev:armhf && \
    rm -rf /var/lib/apt/lists/*

ADD scripts/build-package-debian.sh /opt/build-package-debian.sh

CMD /opt/build-package-debian.sh
