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.

72 lines
2.5KB

  1. FROM ubuntu:24.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. RUN sudo apt-get update && \
  31. sudo apt-get install -y cmake
  32. # Install emscripten deps
  33. RUN sudo apt-get install -y libsdl2-dev && \
  34. (git clone https://github.com/emscripten-core/emsdk.git || true) && \
  35. cd emsdk && \
  36. ./emsdk install latest && \
  37. ./emsdk activate latest && \
  38. sudo cp -prv ./emsdk_env.sh /etc/profile.d/
  39. # Warmup emscripten (this will pre-fetch SDL2, and cache it)
  40. RUN /emsdk/upstream/emscripten/em++ -s WASM=1 -s USE_SDL=2 -s USE_SDL_TTF=2 -O3 /dev/null || true
  41. # Fix some weird linker issue CAF build runs into. (fails to link -lc++abi)
  42. RUN cp -prv /usr/lib/llvm-15/lib/libc++abi.so.1.0 /usr/lib/llvm-15/lib/libc++abi.so
  43. # EDIT: no longer needed!
  44. # RUN cp -prv /usr/lib/llvm-14/lib/libunwind.so.1.0 /usr/lib/llvm-14/lib/libunwind.so
  45. # Install mold (even faster than gold) (linker)
  46. RUN apt install -y mold
  47. COPY switch-to-latest-clang /usr/local/bin/switch-to-latest-clang
  48. COPY switch-to-latest-gcc /usr/local/bin/switch-to-latest-gcc
  49. RUN chmod +x /usr/local/bin/switch-to-latest-clang
  50. RUN chmod +x /usr/local/bin/switch-to-latest-gcc
  51. RUN apt clean
  52. FROM scratch
  53. COPY --from=build1 / /
  54. CMD "/bin/bash"