-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
110 lines (92 loc) · 2.9 KB
/
Copy pathDockerfile
File metadata and controls
110 lines (92 loc) · 2.9 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# syntax=docker/dockerfile:1
ARG BACKEND=SFML
ARG BUILD_TYPE=Release
ARG ALLOW_MISSING_ASSETS=0
FROM ubuntu:24.04 AS linux-deps
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
cmake \
make \
ninja-build \
g++-14 \
git \
libx11-dev \
libxrandr-dev \
libxcursor-dev \
libxi-dev \
libxfixes-dev \
libxext-dev \
libxss-dev \
libxtst-dev \
libxinerama-dev \
libgl1-mesa-dev \
libegl1-mesa-dev \
libgles2-mesa-dev \
libglu1-mesa-dev \
libpulse-dev \
libudev-dev \
libasound2-dev \
libwayland-dev \
wayland-protocols \
libdecor-0-dev \
libdbus-1-dev \
libdrm-dev \
libgbm-dev \
libxkbcommon-dev \
&& rm -rf /var/lib/apt/lists/* \
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 100 \
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 100
WORKDIR /src
FROM linux-deps AS linux
ARG BACKEND
ARG BUILD_TYPE
ARG ALLOW_MISSING_ASSETS
COPY . .
RUN if [ -f Game/assets/ChickenInvaders.dat ]; then \
echo "Game/assets/ChickenInvaders.dat found"; \
elif [ "$ALLOW_MISSING_ASSETS" = "1" ]; then \
mkdir -p Game/assets && touch Game/assets/ChickenInvaders.dat; \
else \
echo "ERROR: Game/assets/ChickenInvaders.dat is missing. This proprietary asset must be present. Pass --build-arg ALLOW_MISSING_ASSETS=1 to build with an empty placeholder instead." >&2; \
exit 1; \
fi
RUN case "$BACKEND" in \
SDL3) \
preset="linux-sdl3-$(echo "$BUILD_TYPE" | tr '[:upper:]' '[:lower:]')" \
;; \
*) \
preset="linux-x64-$(echo "$BUILD_TYPE" | tr '[:upper:]' '[:lower:]')" \
;; \
esac; \
cmake --preset "$preset" -DBUILD_SHARED_LIBS=OFF && \
cmake --build build -j"$(nproc)" && \
mkdir -p /output && \
cp build/Game/ChickenInvaders1 /output/ && \
cp Game/assets/ChickenInvaders.dat /output/ 2>/dev/null
FROM scratch AS linux-out
COPY --from=linux /output/ /
FROM devkitpro/devkitarm:latest AS n3ds
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
cmake \
git \
ninja-build \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /src
ARG ALLOW_MISSING_ASSETS
COPY . .
RUN if [ -f Game/assets/ChickenInvaders.dat ]; then \
mkdir -p Game/romfs && cp Game/assets/ChickenInvaders.dat Game/romfs/; \
elif [ "$ALLOW_MISSING_ASSETS" = "1" ]; then \
mkdir -p Game/romfs && touch Game/romfs/ChickenInvaders.dat; \
else \
echo "ERROR: Game/assets/ChickenInvaders.dat is missing. This proprietary asset must be present. Pass --build-arg ALLOW_MISSING_ASSETS=1 to build with an empty placeholder instead." >&2; \
exit 1; \
fi
RUN cmake --preset 3ds-release && \
cmake --build build-3ds -j"$(nproc)" && \
mkdir -p /output && \
cp build-3ds/Game/ChickenInvaders1.3dsx /output/
FROM scratch AS n3ds-out
COPY --from=n3ds /output/ /
FROM linux