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.

61 line
2.0KB

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