Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

325.7. openrct2-0.5.5

RollerCoaster Tycoon 2 engine, for a player's own copy of the RCT2 or RCT Classic data

Version 0.5.5, release 2
Shelf games-strategy — Strategy, simulation and space-trading games, and their data
Phase 44_apps (Applications), 207 of 422 in build order
Licence GPL-3.0-or-later
Homepage https://openrct2.io
Build time 18.0 SBU
Installed size 147.9 MiB in 2730 files
Recipe ports/core/games-strategy/openrct2/kpkgbuild

About

OpenRCT2 is an open-source re-implementation of the RollerCoaster Tycoon 2 engine: the theme-park game, with a larger window, multiplayer and plugin scripting. The port builds the engine and installs the free asset sets the project publishes, its objects, title sequences, sound effects and music. The original game’s graphics and scenarios cannot be shipped, so the game needs the player’s own copy of RollerCoaster Tycoon 2 or RCT Classic, and asks where it is at first start.

Sources

Dependencies

Depends on: cmake, ninja, pkgconf, unzip, nlohmann-json, sdl2-compat, libglvnd, mesa, freetype2, fontconfig, icu, libzip, zlib, zstd, libpng, flac, libogg, libvorbis, openssl.

Required by: no port names it.

Patches

build.sh applies these; kpkg applies nothing by itself.

Installation

From the repository root, inside the build container, this is the line kdosbuild runs for the port:

script/chroot/exec.sh bash -c 'source script/phases/44_apps/phase.env && kpkg install openrct2'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/games-strategy/openrct2.

1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.

cd /ports/core/games-strategy/openrct2
echo '8b62c45f03d312a369a1b1c23e0f0db293556e8cad58b14ccef7b4e6b4c65964  openrct2-0.5.5.tar.gz' | sha256sum -c -
echo '74e73bbd012339511bb359dd0fbb148fda899790ae37d7d69861d88183b19452  openrct2-objects-1.7.11.zip' | sha256sum -c -
echo 'dabb9787b1576342fca4dd9f64b3f8cfa04a7e6ce9c2bb9610f47b762905c858  openrct2-title-sequences-0.4.26.zip' | sha256sum -c -
echo '06b90f3e19c216752df441d551b26a9e3e1ba7755bdd2102504b73bf993608be  openrct2-opensfx-1.0.6.zip' | sha256sum -c -
echo '994b350d3b180ee1cb9619fe27f7ebae3a1a5232840c4bd47a89f33fa89de1a1  openrct2-openmusic-1.6.1.zip' | sha256sum -c -

2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.

SRC_ROOT=/var/cache/kpkg/work/openrct2
SRC=$SRC_ROOT/openrct2-0.5.5
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf openrct2-0.5.5.tar.gz -C "$SRC" --strip-components=1
cp openrct2-objects-1.7.11.zip "$SRC"
cp openrct2-title-sequences-0.4.26.zip "$SRC"
cp openrct2-opensfx-1.0.6.zip "$SRC"
cp openrct2-openmusic-1.6.1.zip "$SRC"

Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.

3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the recipe’s helpers _objects, _titles, _sfx, _music and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

patch -p1 -i "$PORT_SRC/Werror.patch"
patch -p1 -i "$PORT_SRC/gcc-includes.patch"

mkdir -p data/object data/sequence
unzip -q -o openrct2-objects-$_objects.zip -d data/object
unzip -q -o openrct2-title-sequences-$_titles.zip -d data/sequence
unzip -q -o openrct2-opensfx-$_sfx.zip -d data
unzip -q -o openrct2-openmusic-$_music.zip -d data

export CXXFLAGS="$CXXFLAGS -DJSON_HAS_FILESYSTEM=0 -DJSON_HAS_EXPERIMENTAL_FILESYSTEM=0"
mkdir build && cd build
cmake .. -G Ninja \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DCMAKE_INSTALL_LIBDIR=lib \
	-DOPENRCT2_USE_CCACHE=OFF \
	-DWITH_TESTS=OFF \
	-DDOWNLOAD_TITLE_SEQUENCES=OFF \
	-DDOWNLOAD_OBJECTS=OFF \
	-DDOWNLOAD_OPENSFX=OFF \
	-DDOWNLOAD_OPENMUSIC=OFF \
	-DDOWNLOAD_REPLAYS=OFF \
	-DDISABLE_VERSION_CHECKER=ON \
	-DDISABLE_HTTP=ON \
	-DDISABLE_DISCORD_RPC=ON \
	-DDISABLE_GOOGLE_BENCHMARK=ON \
	-DDISABLE_NETWORK=OFF \
	-DDISABLE_TTF=OFF \
	-DDISABLE_FLAC=OFF \
	-DDISABLE_VORBIS=OFF \
	-DDISABLE_OPENGL=OFF \
	-DENABLE_SCRIPTING=ON \
	-DPORTABLE=OFF \
	-DSTATIC=OFF
ninja
DESTDIR=$PKG ninja install
cd ..

rm -rf "$PKG/usr/share/icons/hicolor/scalable"
cat > "$PKG/usr/share/applications/io.openrct2.openrct2.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=OpenRCT2
GenericName=Theme Park Game
Comment=Build and run a theme park, from your own RollerCoaster Tycoon 2 data
Exec=openrct2 %u
Icon=openrct2
Terminal=false
StartupWMClass=openrct2
Categories=Game;Simulation;
Keywords=openrct2;rct2;rct;roller;coaster;tycoon;theme park;simulation;
DESKTOP
chmod 644 "$PKG/usr/share/applications/io.openrct2.openrct2.desktop"

The switches, and why each is set:

The common switches of each build system are explained in the Flag glossary.

4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/openrct2, prunes what the image does not ship, lints the tree and rolls it reproducibly:

tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
    --mtime=@$SOURCE_DATE_EPOCH \
    --use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
    -cf openrct2-0.5.5-2.tar.xz -C "$PKG" .

5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/openrct2, and runs the triggers its paths call for.

Contents

Installed programs: openrct2, openrct2-cli.

Installed libraries: libopenrct2.a.

Installed directories: /usr/share/doc/openrct2, /usr/share/licenses/openrct2, /usr/share/openrct2.

Short descriptions

openrct2 An open source re-implementation of "RollerCoaster Tycoon 2".
openrct2-cli Headless server mode for OpenRCT2

Notes

The four asset archives are unpacked into the source tree before configure: the objects into data/object, the title sequences into data/sequence, and the sound effects and music into data/, where their assetpack/ and object/ directories join the rest. The install copies data/ whole into /usr/share/openrct2, so they arrive with the rest. Upstream pins each set by URL and SHA-256 in assets.json; the recipe’s _objects, _titles, _sfx and _music versions and their sha256 lines are the same pins, and a version bump of the engine has to carry that file’s new values into the recipe.

Upstream installs a scalable SVG icon beside the PNGs, and the recipe removes it: nothing in the session rasterises an SVG icon (see Desktop entries belong to the port). The main desktop entry is replaced by one with StartupWMClass=openrct2, the Wayland app_id SDL gives the window from the executable’s name. Upstream’s three hidden entries, for save files, scenarios and openrct2: links, are kept as they are.