Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
matrix:
# Remember if you commit this, newly built images will replace those tags.
# Prefer incrementing the version to unused one
tag: [20-android, 20-noble, 20-bookworm, 20-format, 20-mingw, 20-emscripten]
tag: [21-android, 21-jammy, 21-noble, 21-bookworm, 21-format, 21-mingw, 21-emscripten]
env:
dockertag: ${{ matrix.tag }}
steps:
Expand All @@ -40,10 +40,10 @@ jobs:
run: |
if [ "$dockerid" != "" ]; then
docker login -u "$dockerid" -p "$dockerpass"
docker pull $dockerns/openrct2-build:20-noble
docker tag $dockerns/openrct2-build:20-noble $dockerns/openrct2-build:20
docker tag $dockerns/openrct2-build:20-noble $dockerns/openrct2-build:latest
docker push $dockerns/openrct2-build:20
docker pull $dockerns/openrct2-build:21-noble
docker tag $dockerns/openrct2-build:21-noble $dockerns/openrct2-build:21
docker tag $dockerns/openrct2-build:21-noble $dockerns/openrct2-build:latest
docker push $dockerns/openrct2-build:21
docker push $dockerns/openrct2-build:latest
else
echo 'Images not tagged'
Expand Down
50 changes: 50 additions & 0 deletions 21/android/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Default image that can build OpenRCT2 for Android.
FROM ubuntu:24.04
RUN apt-get update && \
apt-get -y upgrade && \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
# System
ca-certificates curl unzip \
# Build tools
git cmake pkg-config ninja-build ccache g++ \
# Sprite builder libraries for the host
libpng-dev \
openjdk-21-jdk

ENV ANDROID_HOME=/android-dev
ENV ANDROID_NDK_HOME="$ANDROID_HOME/ndk"
ENV JAVA_HOME=/usr/lib/jvm/java-21-openjdk-amd64

# Grab the Android SDK
WORKDIR /tmp/setup
RUN curl -Lo sdk.zip https://dl.google.com/android/repository/commandlinetools-linux-13114758_latest.zip \
&& unzip -qo sdk.zip \
&& mkdir -p $ANDROID_HOME/cmdline-tools \
&& mv cmdline-tools $ANDROID_HOME/cmdline-tools/latest \
&& rm sdk.zip

# Need nlohmann/json, needs to live outside system libraries, so it doesn't
# confuse toolchain to include other host headers.
# 3.12.0 contains a major issue related to utf8 strings. Should be fixed when 3.12.1 releases
RUN curl -Lo json.zip https://github.com/nlohmann/json/releases/download/v3.11.3/include.zip \
&& unzip -qo json.zip -d json \
&& mkdir -p /opt/openrct2/include/ \
&& mv json/include/nlohmann /opt/openrct2/include/nlohmann \
&& rm json.zip

# Clean up
RUN rm -rf /tmp/setup
WORKDIR /

# Accept SDK licenses
RUN yes | "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" --licenses > /dev/null

# Install NDK
RUN "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" "ndk;27.3.13750724"
RUN "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" "cmake;4.0.3"
RUN "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" "build-tools;36.0.0"
RUN "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" "platforms;android-36"
RUN "$ANDROID_HOME/cmdline-tools/latest/bin/sdkmanager" "platform-tools"

# Bash is required for OpenRCT2 CI
SHELL ["/bin/bash", "-c"]
22 changes: 22 additions & 0 deletions 21/bookworm/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Supplementart image that can build OpenRCT2 for Linux (amd64).
# Provides building with cmake+ninja using either gcc or clang.
FROM debian:bookworm
RUN apt-get update && \
apt-get -y upgrade && \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
# System
ca-certificates curl file libcairo2 patchelf unzip \
# Build tools
git cmake pkg-config ninja-build ccache g++ clang \
# Build libraries
libsdl2-dev libspeex-dev libspeexdsp-dev \
libflac-dev libogg-dev libvorbis-dev libopenal-dev \
libcrypto++-dev libcurl4-openssl-dev libssl-dev \
libfontconfig1-dev libfreetype6-dev \
libicu-dev libpng-dev libzip-dev \
nlohmann-json3-dev libzstd-dev \
# Testing libraries
libgtest-dev

# Bash is required for OpenRCT2 CI
SHELL ["/bin/bash", "-c"]
35 changes: 35 additions & 0 deletions 21/emscripten/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
FROM docker.io/library/fedora:42

RUN dnf update -y && dnf install -y git cmake make gcc g++ nlohmann-json-devel autoreconf libtool openssl-devel libcurl-devel fontconfig-devel libzip-devel SDL2-devel zip speexdsp-devel ninja-build hostname ccache libatomic

WORKDIR /

RUN git clone https://github.com/emscripten-core/emsdk.git

WORKDIR /emsdk/

# Pin version - to prevent sudden breakage of the CI
RUN ./emsdk install 4.0.11
RUN ./emsdk activate 4.0.11

# "Install" json headers to emscripten include directory
RUN cp -r /usr/include/nlohmann /emsdk/upstream/emscripten/cache/sysroot/include/nlohmann

# Add emscripten to path
ENV PATH="/emsdk:/emsdk/upstream/emscripten:/emsdk/node/22.16.0_64bit/bin:$PATH"

WORKDIR /ext/

COPY build-depends.sh /ext/
COPY cors_serve.py /usr/bin/

# Build emscripten dependencies
RUN bash build-depends.sh

# Set ENV variables for speexdsp, icu, and libzip
ENV SPEEXDSP_ROOT="/ext/speexdsp"
ENV ICU_ROOT="/ext/icu/icu4c/source"
ENV LIBZIP_ROOT="/ext/libzip/build"


SHELL ["/bin/bash", "-c"]
67 changes: 67 additions & 0 deletions 21/emscripten/build-depends.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
#!/bin/bash

START_DIR=/ext

cd $START_DIR

# Pin versions - to prevent sudden breakage
if [ ! -d "speexdsp" ]; then
git clone https://gitlab.xiph.org/xiph/speexdsp.git --depth 1 --branch SpeexDSP-1.2.1
fi
if [ ! -d "icu" ]; then
git clone https://github.com/unicode-org/icu.git --depth 1 --branch release-77-1
fi
if [ ! -d "libzip" ]; then
git clone https://github.com/nih-at/libzip.git --depth 1 --branch v1.11.4
fi
if [ ! -d "zlib" ]; then
git clone https://github.com/madler/zlib.git --depth 1 --branch v1.3.1
fi
if [ ! -d "zstd" ]; then
git clone https://github.com/facebook/zstd.git --depth 1 --branch v1.5.7
fi

cd speexdsp
emmake ./autogen.sh
emmake ./configure --enable-shared --disable-neon
emmake make -j$(nproc)
cd $START_DIR

cd icu/icu4c/source
ac_cv_namespace_ok=yes icu_cv_host_frag=mh-linux emmake ./configure \
--enable-release \
--enable-shared \
--disable-icu-config \
--disable-extras \
--disable-icuio \
--disable-layoutex \
--disable-tools \
--disable-tests \
--disable-samples
emmake make -j$(nproc)
cd $START_DIR

cd zlib
mkdir -p build/
cd build/
emcmake cmake ../
emmake make zlib -j$(nproc)
emmake make install
ZLIB_ROOT=$(pwd)
cd $START_DIR

cd libzip
mkdir -p build/
cd build/
emcmake cmake ../ -DZLIB_INCLUDE_DIR="$ZLIB_ROOT" -DZLIB_LIBRARY="$ZLIB_ROOT/libz.a"
emmake make zip -j$(nproc)
emmake make install
cd $START_DIR

cd zstd
mkdir -p build/build/
cd build/build/
emcmake cmake ../cmake/ -DZSTD_BUILD_STATIC=ON -DZSTD_BUILD_SHARED=OFF -DZSTD_BUILD_PROGRAMS=OFF
emmake make -j$(nproc)
emmake make install
cd $START_DIR
15 changes: 15 additions & 0 deletions 21/emscripten/cors_serve.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env python3
from http.server import HTTPServer, SimpleHTTPRequestHandler, test
import sys

class CORSRequestHandler (SimpleHTTPRequestHandler):
def end_headers (self):
self.send_header('Cross-Origin-Embedder-Policy', 'require-corp')
self.send_header('Cross-Origin-Opener-Policy', 'same-origin')
SimpleHTTPRequestHandler.end_headers(self)

def main():
test(CORSRequestHandler, HTTPServer, port=int(sys.argv[1]) if len(sys.argv) > 1 else 8000)

if __name__ == '__main__':
main()
3 changes: 3 additions & 0 deletions 21/format/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Image specifically designed to run clang-format on OpenRCT2 source files.
FROM alpine
RUN apk add --no-cache python3 clang20-extra-tools
24 changes: 24 additions & 0 deletions 21/jammy/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Default image that can build OpenRCT2 for Linux (amd64).
# Provides building with cmake+ninja using either gcc or clang.
FROM ubuntu:22.04
RUN apt-get update && \
apt-get -y upgrade && \
DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
# System
ca-certificates curl file libcairo2 patchelf unzip \
# Build tools
git pkg-config ninja-build ccache g++ \
# Build libraries
libsdl2-dev libspeex-dev libspeexdsp-dev xz-utils \
libflac-dev libogg-dev libvorbis-dev libopenal-dev \
libcrypto++-dev libcurl4-openssl-dev libssl-dev \
libfontconfig1-dev libfreetype6-dev \
libicu-dev libpng-dev libzip-dev libzstd-dev \
nlohmann-json3-dev \
# Testing libraries
libgtest-dev \
clang-15 software-properties-common gpg-agent
RUN add-apt-repository -y ppa:ecal/cmake-3.25 && apt install -y cmake

# Bash is required for OpenRCT2 CI
SHELL ["/bin/bash", "-c"]
113 changes: 113 additions & 0 deletions 21/mingw/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
FROM archlinux:latest

# Based on https://github.com/haffmans/docker-mingw-qt5/blob/master/Dockerfile

# Update base system
#RUN pacman -Sy --noconfirm --noprogressbar archlinux-keyring \
# && pacman-key --populate \
RUN pacman -Syu --noconfirm --noprogressbar pacman \
&& pacman-db-upgrade \
&& pacman -Su --noconfirm --noprogressbar ca-certificates \
&& trust extract-compat \
&& pacman -Su --noconfirm --noprogressbar git pyalpm base-devel libffi \
&& pacman -Syyu --noconfirm --noprogressbar \
&& (echo -e "y\ny\n" | pacman -Scc)

# Install pikaur
RUN useradd --create-home --comment "Arch Build User" build && \
groupadd sudo && \
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers; \
echo 'Defaults:nobody !requiretty' >> /etc/sudoers; \
gpasswd -a build sudo

RUN chown -R build /home/build

USER build
# Overrides from arch-base
ENV HOME /home/build

WORKDIR /home/build/
RUN git clone https://aur.archlinux.org/pikaur.git

WORKDIR /home/build/pikaur
RUN makepkg -sr --noconfirm

USER root
RUN pacman -U pikaur-*.zst --noconfirm && pacman -Scc --noconfirm && rm -r /home/build/*

# Add some useful packages to the base system
RUN pacman -S --noconfirm --noprogressbar \
make \
git \
sudo \
wget \
awk \
sudo \
fakeroot \
file \
patch \
ninja \
ccache \
unzip \
&& (echo -e "y\ny\n" | pacman -Scc)

# Add ownstuff repo
# See https://wiki.archlinux.org/index.php/unofficial_user_repositories#ownstuff and https://martchus.no-ip.biz/repoindex/#packages
RUN echo "[ownstuff]" >> /etc/pacman.conf \
&& echo "SigLevel = Optional TrustAll" >> /etc/pacman.conf \
&& echo "Server = https://ftp.f3l.de/~martchus/\$repo/os/\$arch" >> /etc/pacman.conf \
&& echo "Server = https://martchus.no-ip.biz/repo/arch/\$repo/os/\$arch" >> /etc/pacman.conf \
&& pacman -Sy

USER build
# Install MingW packages
RUN pikaur -S --noconfirm --noprogressbar \
mingw-w64-binutils \
mingw-w64-bzip2 \
mingw-w64-boost \
mingw-w64-cmake \
mingw-w64-crt \
mingw-w64-curl \
mingw-w64-flac \
mingw-w64-fontconfig \
mingw-w64-freetype2 \
mingw-w64-gcc \
mingw-w64-gnutls \
mingw-w64-headers \
mingw-w64-libiconv \
mingw-w64-libogg \
mingw-w64-libpng \
mingw-w64-libvorbis \
mingw-w64-nettle \
mingw-w64-openal \
mingw-w64-openssl \
mingw-w64-pkg-config \
mingw-w64-sdl2 \
mingw-w64-speexdsp \
mingw-w64-tools \
mingw-w64-winpthreads \
mingw-w64-xz \
mingw-w64-zlib \
mingw-w64-zstd \
pkgconf \
&& (echo -e "y\ny\n" | sudo pacman -Scc)

WORKDIR /home/build/
COPY mingw-w64-libzip mingw-w64-libzip
USER root
# GMP and Nettle seem to have their mingw libraries misnamed. pkg-config
# points to .a, not .dll.a files; additionally cmake removes any such
# extensions, so symlink the files to their expected places
RUN ln -s /usr/i686-w64-mingw32/lib/libp11-kit.dll.a /usr/i686-w64-mingw32/lib/libp11-kit.a \
&& ln -s /usr/i686-w64-mingw32/lib/libgmp.dll.a /usr/i686-w64-mingw32/lib/libgmp.a
RUN chown -R build /home/build
USER build
WORKDIR /home/build/mingw-w64-libzip
RUN makepkg -sr --noconfirm
USER root
RUN pacman -U mingw-w64-libzip-*.zst --noconfirm && pacman -Scc --noconfirm && rm -r /home/build/*

RUN wget https://github.com/nlohmann/json/releases/download/v3.11.3/include.zip -O /usr/i686-w64-mingw32/json.zip && unzip /usr/i686-w64-mingw32/json.zip -d /usr/i686-w64-mingw32/ && unzip /usr/i686-w64-mingw32/json.zip -d /usr/x86_64-w64-mingw32/

# Bash is required for OpenRCT2 CI
SHELL ["/bin/bash", "-c"]
Loading