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.

63 lines
2.1KB

  1. FROM ubuntu:22.04 AS build1
  2. MAINTAINER Ray Burgemeestre
  3. ARG DEBIAN_FRONTEND=noninteractive
  4. # The || true around apt-get update is to workaround a weird issue that only seems to happen
  5. # in gocd CI
  6. RUN apt-get update || true && \
  7. apt-get -y install g++12 git sudo wget gnupg2 && \
  8. apt-get -y install libssl-dev build-essential && \
  9. apt-get -y install vim gdb strace patch && \
  10. \
  11. apt update -y && \
  12. apt-get install -y clang-14 clang-tidy-14 libclang-14-dev clangd-14 lldb-14 lld-14 clangd-14 && \
  13. apt-get install -y libc++-14-dev libc++-14-dev clang-format-14 && \
  14. \
  15. rm -rf /var/lib/apt/lists/*
  16. # Install newer CMake to avoid some warnings the "FindBoost" script throws on
  17. # more recent versions of boost that the system CMake doesn't now about.
  18. # I chose a bloody new boost, so I need to use the latest RC1 (at the time of writing)
  19. # EDIT: actually we can get rid of this block, Ubuntu 22.04 has a recent enough version already
  20. RUN wget https://github.com/Kitware/CMake/releases/download/v3.24.1/cmake-3.24.1.tar.gz && \
  21. tar -zxf cmake-3.24.1.tar.gz && \
  22. cd cmake-3.24.1 && \
  23. ./bootstrap && \
  24. make -j $(nproc) && \
  25. make install && \
  26. cd .. && \
  27. rm -rf cmake-3.24.1 && \
  28. rm -rf cmake-3.24.1.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-14/lib/libc++abi.so.1.0 /usr/lib/llvm-14/lib/libc++abi.so
  41. # EDIT: no longer needed!
  42. # RUN cp -prv /usr/lib/llvm-14/lib/libunwind.so.1.0 /usr/lib/llvm-14/lib/libunwind.so
  43. COPY switch-to-latest-clang /usr/local/bin/switch-to-latest-clang
  44. RUN chmod +x /usr/local/bin/switch-to-latest-clang
  45. RUN apt clean
  46. FROM scratch
  47. COPY --from=build1 / /
  48. CMD "/bin/bash"