Dockerfile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. FROM debian:buster
  2. LABEL maintainer="Lovell Fuller <npm@lovell.info>"
  3. # Create Debian-based container suitable for cross-compiling Linux ARMv7-A binaries
  4. # Path settings
  5. ENV \
  6. RUSTUP_HOME="/usr/local/rustup" \
  7. CARGO_HOME="/usr/local/cargo" \
  8. PATH="/usr/local/cargo/bin:$PATH"
  9. # Build dependencies
  10. RUN \
  11. apt-get update && \
  12. apt-get install -y curl && \
  13. dpkg --add-architecture armhf && \
  14. apt-get update && \
  15. apt-get install -y \
  16. advancecomp \
  17. autoconf \
  18. autopoint \
  19. brotli \
  20. cmake \
  21. crossbuild-essential-armhf \
  22. gettext \
  23. git \
  24. gobject-introspection \
  25. gperf \
  26. gtk-doc-tools \
  27. intltool \
  28. jq \
  29. libglib2.0-dev \
  30. libtool \
  31. nasm \
  32. ninja-build \
  33. python3-pip \
  34. texinfo \
  35. && \
  36. curl https://sh.rustup.rs -sSf | sh -s -- -y \
  37. --no-modify-path \
  38. --profile minimal \
  39. && \
  40. # Downgrade to 1.43.0, see: https://github.com/rust-lang/compiler-builtins/issues/353
  41. rustup toolchain install 1.43.0 && rustup default 1.43.0 && \
  42. rustup target add arm-unknown-linux-gnueabihf && \
  43. pip3 install meson==0.55.3
  44. # Compiler settings
  45. ENV \
  46. PKG_CONFIG="/usr/bin/arm-linux-gnueabihf-pkg-config" \
  47. PLATFORM="linux-armv7" \
  48. CHOST="arm-linux-gnueabihf" \
  49. RUST_TARGET="arm-unknown-linux-gnueabihf" \
  50. FLAGS="-marm -march=armv7-a -mfpu=neon-vfpv4 -mfloat-abi=hard -O3 -fPIC -D_GLIBCXX_USE_CXX11_ABI=0" \
  51. MESON="--cross-file=/root/meson.ini"
  52. COPY Toolchain.cmake /root/
  53. COPY meson.ini /root/