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