You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
2.2KB

  1. FROM ubuntu:20.04 AS build1
  2. MAINTAINER Ray Burgemeestre
  3. ARG DEBIAN_FRONTEND=noninteractive
  4. RUN apt-get update && \
  5. apt-get -y install g++ git sudo wget gnupg2 && \
  6. apt-get -y install libssl-dev build-essential && \
  7. apt-get -y install vim gdb strace patch && \
  8. \
  9. echo deb http://apt.llvm.org/focal/ llvm-toolchain-focal-12 main >> /etc/apt/sources.list && \
  10. echo deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-12 main >> /etc/apt/sources.list && \
  11. wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - ; \
  12. apt update -y && \
  13. apt-get install -y clang-12 lldb-12 lld-12 && \
  14. apt-get install -y libc++-12-dev libc++-12-dev clang-format-12 && \
  15. \
  16. rm -rf /var/lib/apt/lists/*
  17. # Install newer CMake to avoid some warnings the "FindBoost" script throws on
  18. # more recent versions of boost that the system CMake doesn't now about.
  19. # I chose a bloody new boost, so I need to use the latest RC1 (at the time of writing)
  20. RUN wget https://github.com/Kitware/CMake/releases/download/v3.21.3/cmake-3.21.3.tar.gz && \
  21. tar -zxf cmake-3.21.3.tar.gz && \
  22. cd cmake-3.21.3 && \
  23. ./bootstrap && \
  24. make -j $(nproc) && \
  25. make install && \
  26. cd .. && \
  27. rm -rf cmake-3.21.3 && \
  28. rm -rf cmake-3.21.3.tar.gz
  29. # Install emscripten deps
  30. RUN sudo apt-get update && \
  31. sudo apt-get install -y libsdl2-dev && \
  32. (git clone https://github.com/emscripten-core/emsdk.git || true) && \
  33. cd emsdk && \
  34. ./emsdk install latest && \
  35. ./emsdk activate latest && \
  36. sudo cp -prv ./emsdk_env.sh /etc/profile.d/
  37. # Warmup emscripten (this will pre-fetch SDL2, and cache it)
  38. RUN /emsdk/upstream/emscripten/em++ -s WASM=1 -s USE_SDL=2 -s USE_SDL_TTF=2 -O3 /dev/null || true
  39. # Fix some weird linker issue CAF build runs into. (fails to link -lc++abi)
  40. RUN cp -prv /usr/lib/llvm-12/lib/libc++abi.so.1.0 /usr/lib/llvm-12/lib/libc++abi.so
  41. RUN cp -prv /usr/lib/llvm-12/lib/libunwind.so.1.0 /usr/lib/llvm-12/lib/libunwind.so
  42. COPY switch-to-latest-clang /usr/local/bin/switch-to-latest-clang
  43. COPY switch-to-latest-gcc /usr/local/bin/switch-to-latest-gcc
  44. RUN chmod +x /usr/local/bin/switch-to-latest-clang
  45. RUN chmod +x /usr/local/bin/switch-to-latest-gcc
  46. RUN apt clean
  47. FROM scratch
  48. COPY --from=build1 / /
  49. CMD "/bin/bash"