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.

70 lines
2.4KB

  1. FROM ubuntu:22.04 AS build1
  2. MAINTAINER Ray Burgemeestre
  3. ARG DEBIAN_FRONTEND=noninteractive
  4. # This is a workaround for https://stackoverflow.com/questions/71941032/why-i-cannot-run-apt-update-inside-a-fresh-ubuntu22-04
  5. RUN sed -i -e 's/^APT/# APT/' -e 's/^DPkg/# DPkg/' \
  6. /etc/apt/apt.conf.d/docker-clean
  7. RUN apt-get update && \
  8. apt-get -y install g++12 git sudo wget gnupg2 && \
  9. apt-get -y install libssl-dev build-essential && \
  10. apt-get -y install vim gdb strace patch && \
  11. \
  12. apt update -y && \
  13. apt-get install -y clang-15 clang-tidy-15 libclang-15-dev clangd-15 lldb-15 lld-15 clangd-15 && \
  14. apt-get install -y libc++-15-dev libc++-15-dev clang-format-15 clang-tidy-15 && \
  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. # EDIT: actually we can get rid of this block, Ubuntu 22.04 has a recent enough version already
  21. RUN wget https://github.com/Kitware/CMake/releases/download/v3.24.1/cmake-3.24.1.tar.gz && \
  22. tar -zxf cmake-3.24.1.tar.gz && \
  23. cd cmake-3.24.1 && \
  24. ./bootstrap && \
  25. make -j $(nproc) && \
  26. make install && \
  27. cd .. && \
  28. rm -rf cmake-3.24.1 && \
  29. rm -rf cmake-3.24.1.tar.gz
  30. # Install emscripten deps
  31. RUN sudo apt-get update && \
  32. sudo apt-get install -y libsdl2-dev && \
  33. (git clone https://github.com/emscripten-core/emsdk.git || true) && \
  34. cd emsdk && \
  35. ./emsdk install latest && \
  36. ./emsdk activate latest && \
  37. sudo cp -prv ./emsdk_env.sh /etc/profile.d/
  38. # Warmup emscripten (this will pre-fetch SDL2, and cache it)
  39. RUN /emsdk/upstream/emscripten/em++ -s WASM=1 -s USE_SDL=2 -s USE_SDL_TTF=2 -O3 /dev/null || true
  40. # Fix some weird linker issue CAF build runs into. (fails to link -lc++abi)
  41. RUN cp -prv /usr/lib/llvm-15/lib/libc++abi.so.1.0 /usr/lib/llvm-15/lib/libc++abi.so
  42. # EDIT: no longer needed!
  43. # RUN cp -prv /usr/lib/llvm-14/lib/libunwind.so.1.0 /usr/lib/llvm-14/lib/libunwind.so
  44. # Install mold (even faster than gold) (linker)
  45. RUN apt install -y mold
  46. COPY switch-to-latest-clang /usr/local/bin/switch-to-latest-clang
  47. COPY switch-to-latest-gcc /usr/local/bin/switch-to-latest-gcc
  48. RUN chmod +x /usr/local/bin/switch-to-latest-clang
  49. RUN chmod +x /usr/local/bin/switch-to-latest-gcc
  50. RUN apt clean
  51. FROM scratch
  52. COPY --from=build1 / /
  53. CMD "/bin/bash"