Files
EnderTheCoder d0ae4c76ba v0.5.0: Windows/ARM64 and Linux/ARM64 cross targets, .deb/.msi packaging
- Cross toolchains: llvm-mingw-aarch64 (Windows ARM64; SDL3 staged from MSYS2's
  clangarm64 repo since SDL ships no MinGW ARM64 dev package) and
  clang-aarch64-linux-gnu (Linux ARM64; arm64 libc++/SDL3 via dpkg multiarch).
- Distro images: Dockerfile.linux-arm64, Dockerfile.win-arm64, Dockerfile.debian
  and Dockerfile.debian-arm64 (Debian 13 with upstream CMake, whose 3.31 gate
  cannot enable import std).
- Packaging via CPack: .deb for Ubuntu 26.04 and Debian 13 on amd64 and arm64
  (dependencies derived by dpkg-shlibdeps), portable .zip/.tar.gz, and a
  Windows .msi built with wixl (msitools) straight from the Linux cross image.
  wixl 0.106 lacks arm64, so Windows/ARM64 ships the portable zip only.
- CMake: parameterize the SDL3 MinGW triple, add install() + CPack config.
- CI: build/package jobs for both arm64 targets and both Debian packages;
  existing Linux/Windows jobs now also emit the .deb / .zip + .msi.
- scripts/: build-linux-arm64, build-windows-arm64, build-debian,
  build-debian-arm64.
2026-09-28 20:38:40 +08:00

74 lines
2.3 KiB
Docker

# syntax=docker/dockerfile:1
# Linux build environment. Isolated from the Windows cross image (Dockerfile.win)
# so the two toolchains and their standard libraries never interfere.
#
# dev target: clang + libc++ (for `import std;`) + SDL3 + debug tools.
FROM ubuntu:26.04 AS dev
ENV DEBIAN_FRONTEND=noninteractive
# Optional apt mirror override, e.g. --build-arg APT_MIRROR=http://mirrors.tuna.tsinghua.edu.cn/ubuntu
ARG APT_MIRROR=""
RUN if [ -n "$APT_MIRROR" ]; then \
sed -i -e "s|http://archive.ubuntu.com/ubuntu|${APT_MIRROR}|g" \
-e "s|http://security.ubuntu.com/ubuntu|${APT_MIRROR}|g" \
-e "s|http://ports.ubuntu.com/ubuntu-ports|${APT_MIRROR}|g" \
/etc/apt/sources.list /etc/apt/sources.list.d/*.sources 2>/dev/null || true; \
fi
RUN --mount=type=cache,target=/var/lib/apt,sharing=locked \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
for attempt in 1 2 3 4 5; do \
apt-get -o Acquire::Retries=5 update && break; \
echo "apt-get update failed (attempt $attempt), retrying"; \
sleep 5; \
done \
&& apt-get -o Acquire::Retries=5 install -y --no-install-recommends \
ca-certificates \
clang-21 \
clang-tools-21 \
cmake \
dpkg-dev \
file \
gdb \
git \
libc++-21-dev \
libc++abi-21-dev \
libsdl3-dev \
libvulkan-dev \
ninja-build \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
ENV CC=clang-21
ENV CXX=clang++-21
WORKDIR /work
COPY . .
RUN cmake -S . -B build/linux -G Ninja -DCMAKE_BUILD_TYPE=Release -DOPENRA3_DISTRO_TAG=ubuntu26.04 \
&& cmake --build build/linux -j \
&& ctest --test-dir build/linux --output-on-failure \
&& (cd build/linux && cpack -G DEB)
# deploy target: runtime dependencies + final binary, minimal and fast.
FROM ubuntu:26.04 AS deploy
ENV DEBIAN_FRONTEND=noninteractive
RUN --mount=type=cache,target=/var/lib/apt,sharing=locked \
--mount=type=cache,target=/var/cache/apt,sharing=locked \
apt-get -o Acquire::Retries=5 update \
&& apt-get -o Acquire::Retries=5 install -y --no-install-recommends \
libc++1 \
libc++abi1 \
libsdl3-0 \
libvulkan1 \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=dev /work/build/linux/bin/openra3 /app/openra3
ENTRYPOINT ["/app/openra3"]