Dockerfile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. FROM debian:buster
  2. LABEL maintainer="Lovell Fuller <npm@lovell.info>"
  3. # Create Debian-based container suitable for cross-compiling Linux ARMv6 binaries
  4. # Path settings
  5. ENV \
  6. RUSTUP_HOME="/usr/local/rustup" \
  7. CARGO_HOME="/usr/local/cargo" \
  8. PATH="/usr/local/cargo/bin:/root/tools/x64-gcc-6.5.0/arm-rpi-linux-gnueabihf/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. gettext \
  22. git \
  23. gobject-introspection \
  24. gperf \
  25. gtk-doc-tools \
  26. intltool \
  27. jq \
  28. libglib2.0-dev \
  29. libtool \
  30. nasm \
  31. ninja-build \
  32. python3-pip \
  33. texinfo \
  34. && \
  35. mkdir /root/tools && \
  36. curl -Ls https://github.com/rvagg/rpi-newer-crosstools/archive/master.tar.gz | tar xzC /root/tools --strip-components=1 && \
  37. curl https://sh.rustup.rs -sSf | sh -s -- -y \
  38. --no-modify-path \
  39. --profile minimal \
  40. && \
  41. # Downgrade to 1.43.0, see: https://github.com/rust-lang/compiler-builtins/issues/353
  42. rustup toolchain install 1.43.0 && rustup default 1.43.0 && \
  43. rustup target add arm-unknown-linux-gnueabihf && \
  44. pip3 install meson==0.55.3
  45. # Compiler settings
  46. ENV \
  47. PKG_CONFIG="/usr/bin/arm-linux-gnueabihf-pkg-config" \
  48. PLATFORM="linux-armv6" \
  49. CHOST="arm-rpi-linux-gnueabihf" \
  50. RUST_TARGET="arm-unknown-linux-gnueabihf" \
  51. FLAGS="-marm -mcpu=arm1176jzf-s -mfpu=vfp -mfloat-abi=hard -O3 -fPIC -D_GLIBCXX_USE_CXX11_ABI=0" \
  52. WITHOUT_NEON="true" \
  53. MESON="--cross-file=/root/meson.ini"
  54. COPY Toolchain.cmake /root/
  55. COPY meson.ini /root/