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
openrct2-0.5.5.tar.gz(29.9 MiB)
sha2568b62c45f03d312a369a1b1c23e0f0db293556e8cad58b14ccef7b4e6b4c65964
upstream: https://github.com/OpenRCT2/OpenRCT2/archive/refs/tags/v0.5.5.tar.gz
archive copy: sources-2/games-strategy--openrct2-0.5.5.tar.gzopenrct2-objects-1.7.11.zip(10.6 MiB)
sha25674e73bbd012339511bb359dd0fbb148fda899790ae37d7d69861d88183b19452
upstream: https://github.com/OpenRCT2/objects/releases/download/v1.7.11/objects.zip
archive copy: sources-2/games-strategy--openrct2-objects-1.7.11.zipopenrct2-title-sequences-0.4.26.zip(8.3 MiB)
sha256dabb9787b1576342fca4dd9f64b3f8cfa04a7e6ce9c2bb9610f47b762905c858
upstream: https://github.com/OpenRCT2/title-sequences/releases/download/v0.4.26/title-sequences.zip
archive copy: sources-2/games-strategy--openrct2-title-sequences-0.4.26.zipopenrct2-opensfx-1.0.6.zip(4.1 MiB)
sha25606b90f3e19c216752df441d551b26a9e3e1ba7755bdd2102504b73bf993608be
upstream: https://github.com/OpenRCT2/OpenSoundEffects/releases/download/v1.0.6/opensound.zip
archive copy: sources-2/games-strategy--openrct2-opensfx-1.0.6.zipopenrct2-openmusic-1.6.1.zip(40.9 MiB)
sha256994b350d3b180ee1cb9619fe27f7ebae3a1a5232840c4bd47a89f33fa89de1a1
upstream: https://github.com/OpenRCT2/OpenMusic/releases/download/v1.6.1/openmusic.zip
archive copy: sources-2/games-strategy--openrct2-openmusic-1.6.1.zip
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.
Werror.patch— Removes-Werrorfrom the compile flags in the top-levelCMakeLists.txt. The flag is unconditional, so any warning this compiler adds fails the build (see An upstream-Werror).gcc-includes.patch— Adds#include <cstdint>tosrc/openrct2/config/IniReader.hppandsrc/openrct2-ui/UiContext.h, and#include <future>tosrc/openrct2/network/NetworkServerAdvertiser.cpp. Each file uses those declarations without including their header, and the tree’s libstdc++ does not provide them through the headers it does include (see A standard header the source never includes).
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:
-DJSON_HAS_FILESYSTEM=0,-DJSON_HAS_EXPERIMENTAL_FILESYSTEM=0— Compile out nlohmann-json’s conversions between JSON andstd::filesystem::path. OpenRCT2 compiles C++20 with-fno-char8_t, and in C++20 those conversions needchar8_t, so the header does not compile in that build. The game converts no path through JSON.-DDOWNLOAD_TITLE_SEQUENCES=OFF,-DDOWNLOAD_OBJECTS=OFF,-DDOWNLOAD_OPENSFX=OFF,-DDOWNLOAD_OPENMUSIC=OFF,-DDOWNLOAD_REPLAYS=OFF— Switch off the install steps that download the asset sets and the test replays from GitHub. The four asset sets are sources of the recipe instead, unpacked intodata/before the build (see Notes); the replays are only for the tests.-DOPENRCT2_USE_CCACHE=OFF— Do not compile through ccache, which upstream uses by default when it finds it.-DWITH_TESTS=OFF,-DDISABLE_GOOGLE_BENCHMARK=ON— Build neither the tests nor the benchmarks.-DDISABLE_VERSION_CHECKER=ON— No check for a newer release at start.-DDISABLE_HTTP=ON— Leaves out HTTP, and with it the public server list and the in-game downloads; libcurl is then not needed. Multiplayer over a direct address stays, as networking is a separate switch.-DDISABLE_DISCORD_RPC=ON— No Discord rich presence.-DDISABLE_NETWORK=OFF,-DDISABLE_TTF=OFF,-DDISABLE_FLAC=OFF,-DDISABLE_VORBIS=OFF,-DDISABLE_OPENGL=OFF,-DENABLE_SCRIPTING=ON,-DPORTABLE=OFF,-DSTATIC=OFF— Upstream’s defaults, named: multiplayer (its packets are signed with openssl), TrueType text through FreeType, FLAC and Ogg Vorbis audio, the OpenGL renderer, plugin scripting on the bundled QuickJS, and an ordinary dynamically linked install rather than a relocatable or static one.
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.