Builds GTA III + Wexford mod releases into one .7z
  • Shell 77.8%
  • Python 18.6%
  • Dockerfile 3%
  • Roff 0.6%
Find a file
2026-10-19 10:47:15 +01:00
base Release builder: stock Steam base, re3-wexford and re3-church into one .7z 2026-10-13 15:13:12 +01:00
docker Build the Linux re3 in a Debian 12 container 2026-10-15 01:03:06 +01:00
saves Ship a save game that starts after Give Me Liberty 2026-10-13 22:59:01 +01:00
tools Release builder: stock Steam base, re3-wexford and re3-church into one .7z 2026-10-13 15:13:12 +01:00
.gitattributes Release builder: stock Steam base, re3-wexford and re3-church into one .7z 2026-10-13 15:13:12 +01:00
.gitignore Add the Windows re3.exe to releases and apply the librw night-lighting patch 2026-10-13 16:54:34 +01:00
build_release.sh Install re3-church's ambient sounds too when the locked commit has them 2026-10-18 22:23:29 +01:00
inputs.lock Pin re3-wexford a05fd83 and re3-church 33191ee 2026-10-19 10:47:15 +01:00
README.md Install re3-church's ambient sounds too when the locked commit has them 2026-10-18 22:23:29 +01:00
requirements.txt Release builder: stock Steam base, re3-wexford and re3-church into one .7z 2026-10-13 15:13:12 +01:00
update_inputs.sh Add update_inputs.sh; pin re3-wexford to the latest commit and re3-church to the rebased PR 2026-10-13 15:13:13 +01:00

gta3-wexford-build

Builds a ready-to-play release of GTA III with the Wexford, Ireland mod: the stock game, re3 built from re3-wexford, and the map, models and data built by re3-church, packed into one .7z archive. The game folder holds both a Linux re3 and a Windows re3.exe; everything else is shared. The script itself runs on Linux.

Building a release

git lfs install           # once, before cloning, so base/gta3-steam.7z is downloaded
git clone ssh://git@git.nuke.ie/joe/gta3-wexford-build.git && cd gta3-wexford-build
./build_release.sh            # build the commits pinned in inputs.lock
./build_release.sh --latest   # move inputs.lock to the newest commits first, then build
./build_release.sh --native   # build the Linux re3 on this machine instead of in the container

To publish the archive as a release of this repository on git.nuke.ie, add --publish. This needs forgejo-cli (fj), logged in with fj auth login. Before the build starts, the script checks four things: fj can reach the repository, nothing but inputs.lock is uncommitted, the branch is not behind origin, and the release name is not already a tag. After a successful build it:

  1. commits inputs.lock if it changed
  2. pushes the branch
  3. tags the commit with the release name
  4. creates the release, with the archive attached and wexford-build.txt as its notes

With --prerelease as well, Forgejo marks the release as a pre-release, so it isn't taken for the latest release: for a build to try out first.

./build_release.sh --latest --publish   # newest commits, built and published
./build_release.sh --publish --prerelease   # published as a pre-release

To move the pins without building, run ./update_inputs.sh. It sets each input in inputs.lock to the newest commit of its branch and lists the commits that came in (from the local checkout, when that has them). Name inputs to update only those, for example ./update_inputs.sh re3-church. Commit inputs.lock afterwards, so the next build uses the same commits.

The archive lands in releases/ as gta3-wexford-<date>-<re3-wexford commit>-<re3-church commit>-<gta3-wexford-build commit>.7z. It holds one folder, GTA III Wexford/, with wexford-build.txt listing exactly what went into it.

What it needs

  • git, git-lfs, 7z, cmake, ninja, a C++ compiler, python3, sha1sum, strip, readelf, objdump
  • Docker, to build the Linux re3 (below). The first build pulls debian:12 and installs the build packages into the image gta3-wexford-build-linux. With --native, instead the libraries the Linux re3 builds against: GLFW, OpenAL, mpg123, OpenSSL, zlib, brotli, zstd
  • The MinGW-w64 cross compiler for x86-64 (x86_64-w64-mingw32-gcc, -g++, -windres, -strip, -objdump) with its sysroot in /usr/x86_64-w64-mingw32. OpenAL and mpg123 for Windows come with re3-wexford; GLFW 3.3.8 is fetched from GitHub on the first build and kept in .cache/
  • The fonts and other system requirements listed in re3-church/docs/setup.md
  • SSH access to git.nuke.ie for anything the local checkouts below do not have
  • Space in /tmp for the build (about 6 GB; on most distributions /tmp is in RAM). Set BUILD_DIR to build somewhere else

The script makes .venv/ here with the Python packages in requirements.txt the first time it runs, and again whenever that file changes.

Steps

  1. Clone re3-wexford and re3-church into BUILD_DIR at the commits in inputs.lock. When checkouts exist next to this repository (../re3-wexford, ../re3-church; override with RE3_WEXFORD_SRC and RE3_CHURCH_SRC), their git and LFS objects are used, so little or nothing is downloaded.
  2. Extract base/gta3-steam.7z and check every file against base/SHA1SUMS.
  3. Copy re3-wexford/gamefiles/ over it. Names are matched in any letter case, as on Windows.
  4. Run the re3-church generators whose output is not in git: tools/town.py, tools/radar_region.py, tools/menumap.py, garda/build_garda.py, arcade/build_arcade.py. The lowrider song comes from git (lowrider/out/wx_lowrider.wav); set LOWRIDER_SONG to a folder with its Taiko chart and audio to rebuild it with lowrider/build_lowrider.py instead. town.py rewrites four headers in the re3-wexford clone; the script warns when they differ from the committed ones.
  5. Run the install scripts in the order of re3-church/docs/install.md, then copy saves/GTA3sf1.b to userfiles/. props/install_props.sh (the eircom phone boxes and the shopping bags) and ambience/install_ambience.sh (the buildings' ambient sounds) run when the locked re3-church commit has them; their output is kept in git, so they need no generator step.
  6. Apply re3-wexford/patches/librw-wexford-shaders.patch to librw (prelit buildings darken at night), then build re3 for Linux (Release, GL3, OpenAL) in the container, or on this machine with --native, and copy the stripped binary in.
  7. Build GLFW and re3.exe with MinGW-w64 as re3-wexford/docs/windows-build.md describes, and copy the stripped exe, OpenAL32.dll and libmpg123-0.dll in. The script warns if the exe imports any other DLL that is not part of Windows.
  8. Delete the install scripts' *.orig backups and re3's texture cache, write wexford-build.txt, pack.

The scratch directory is deleted at the end; set KEEP_BUILD=1 to look inside it.

The Linux re3 is built in a container

A Linux binary needs at least the glibc it was linked against, so re3 built on a rolling distribution refuses to start on an older one (version 'GLIBC_2.43' not found). A distribution built for a newer CPU level, such as CachyOS's x86-64-v3 repositories, also marks every program it links as needing that level, though re3's own code is plain x86-64: on an older CPU it stops with CPU ISA level is lower than required.

So docker/Dockerfile builds it in Debian 12 (GCC 12, GLFW 3.3, OpenSSL 3), pinned by digest. Built there, re3 needs glibc 2.34 and libstdc++ GLIBCXX_3.4.30: Debian 12, Ubuntu 22.04 (Linux Mint 21) and anything newer, on any x86-64 CPU. On the player's system it uses that system's own libraries, so a newer system loses nothing.

The build checks both. It stops if re3 is marked as needing more than a baseline x86-64 CPU (with --native, it only warns), and wexford-build.txt names the glibc it needs. Only re3 is built in the container: re3.exe and the generators' output don't depend on the build machine's libraries.

The base game

base/gta3-steam.7z holds the 404 files of the Steam release of GTA III (app 12100, depot 12101, manifest 1807349195210842305), nothing else. re3 replaces gta3.exe and only reads the data files, and the re3 README names the Steam release as its asset source.

tools/make_base.py made it from a Steam install. It reads the file list and SHA1 hashes from Steam's depot manifest, so files that mods or re3 added to the install are left out, and it stops if a stock file is modified:

python3 tools/make_base.py ~/.local/share/Steam/depotcache/12101_1807349195210842305.manifest \
    "<Steam library>/steamapps/common/Grand Theft Auto 3" /tmp/gta3-base
mv /tmp/gta3-base/SHA1SUMS base/
(cd /tmp/gta3-base && 7z a -t7z -m0=lzma2 -mx=9 -md=256m -ms=on -mmt=on <repo>/base/gta3-steam.7z .)

Replacing the base adds a new LFS object of about 600 MB, so do it only when the base itself changes.

Playing a release

Extract the archive. Inside GTA III Wexford/, run ./re3 on Linux or re3.exe on Windows (64-bit, Windows 10 or later). The first start is slow while re3 builds its texture cache (models/txd.img).

To skip the first mission, Give Me Liberty, choose Load Game and the save in slot 1 ("LUIGI'S GIRLS"). It is userfiles/GTA3sf1.b, copied from saves/ in this repository. Saving to slot 1 overwrites it.

The Linux re3 needs Debian 12, Ubuntu 22.04 or a newer system, with GLFW 3, OpenAL, mpg123 and OpenSSL 3 installed. re3.exe needs nothing beyond the two DLLs next to it.