-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContainerfile.cross
More file actions
67 lines (58 loc) · 2.93 KB
/
Copy pathContainerfile.cross
File metadata and controls
67 lines (58 loc) · 2.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
FROM debian:bookworm
# Enable ARM64 architecture
RUN dpkg --add-architecture arm64 && apt-get update
# Install dependencies and keys for LLVM repo
RUN apt-get install -y --no-install-recommends \
wget ca-certificates gnupg software-properties-common \
build-essential crossbuild-essential-arm64 cmake pkg-config git
# Add the LLVM 18 APT repository
RUN wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | tee /etc/apt/trusted.gpg.d/llvm.asc && \
echo "deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-18 main" > /etc/apt/sources.list.d/llvm.list && \
apt-get update
# Install Clang 18 and the ARM64 modern C++ standard libraries (libc++)
RUN apt-get install -y --no-install-recommends \
clang-18 lld-18 libc++-18-dev:arm64 libc++abi-18-dev:arm64
# Install ARM64 dependencies for Raylib and the Engine
RUN apt-get install -y --no-install-recommends \
libasound2-dev:arm64 \
libx11-dev:arm64 libxrandr-dev:arm64 libxi-dev:arm64 \
libxcursor-dev:arm64 libxinerama-dev:arm64 libgl1-mesa-dev:arm64 \
libwayland-dev:arm64 libxkbcommon-dev:arm64 libdecor-0-dev:arm64 \
wayland-protocols libwayland-bin libglfw3-dev:arm64
ENV PKG_CONFIG_LIBDIR=/usr/lib/aarch64-linux-gnu/pkgconfig
# Tell pkg-config where our custom static libraries will be installed
# Also include /usr/share/pkgconfig for architecture-independent packages like wayland-protocols
ENV PKG_CONFIG_PATH=/usr/aarch64-linux-gnu/lib/pkgconfig:/usr/aarch64-linux-gnu/lib64/pkgconfig:/usr/aarch64-linux-gnu/share/pkgconfig:/usr/share/pkgconfig
# Cross-compile Raylib statically using Clang 18
RUN git clone --depth 1 --branch 5.0 https://github.com/raysan5/raylib.git /tmp/raylib && \
cd /tmp/raylib && \
cmake -B build -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SYSTEM_NAME=Linux \
-DCMAKE_SYSTEM_PROCESSOR=aarch64 \
-DCMAKE_C_COMPILER=clang-18 \
-DCMAKE_CXX_COMPILER=clang++-18 \
-DCMAKE_C_COMPILER_TARGET=aarch64-linux-gnu \
-DCMAKE_CXX_COMPILER_TARGET=aarch64-linux-gnu \
-DUSE_WAYLAND=ON \
-DGRAPHICS=GRAPHICS_API_OPENGL_ES2 \
-DBUILD_SHARED_LIBS=OFF && \
cmake --build build -j"$(nproc)" && \
cmake --install build --prefix /usr/aarch64-linux-gnu && \
rm -rf /tmp/raylib
# Cross-compile RtMidi statically using Clang 18 and libc++
RUN git clone --depth 1 --branch 5.0.0 https://github.com/thestk/rtmidi.git /tmp/rtmidi && \
cd /tmp/rtmidi && \
cmake -B build -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_SYSTEM_NAME=Linux \
-DCMAKE_SYSTEM_PROCESSOR=aarch64 \
-DCMAKE_C_COMPILER=clang-18 \
-DCMAKE_CXX_COMPILER=clang++-18 \
-DCMAKE_C_COMPILER_TARGET=aarch64-linux-gnu \
-DCMAKE_CXX_COMPILER_TARGET=aarch64-linux-gnu \
-DCMAKE_CXX_FLAGS="-stdlib=libc++" \
-DBUILD_SHARED_LIBS=OFF \
-DRTMIDI_BUILD_TESTING=OFF && \
cmake --build build -j"$(nproc)" && \
cmake --install build --prefix /usr/aarch64-linux-gnu && \
rm -rf /tmp/rtmidi
WORKDIR /workspace