Repository navigation
building
English | 日本語
The port is built from source with your own discs. The executable carries no game data: at every start it reads the game from your disc image, which must be the release the build was made for.
- Linux x86-64 with bash, curl, tar, git, make, gcc and cpp, Python 3, Ninja and CMake 3.25 or newer.
- A C and C++ compiler, SDL 3, the Vulkan headers and
glslc. - LLVM's
llvm-dwarfdump, which writes each build's state schema: with it, a save state slot loads in other versions of the port too (-DXG_STATE_SCHEMA=OFFbuilds without it). - A GPU and driver with Vulkan 1.3.
- Optional: Khronos glslang (shader presets) and dav1d (AV1 movie packs).
- Your discs as Redump
.cue/.binimages: US (SLUS-00664) or Japanese (SLPS-01160).
No root access is needed. tools/setup.sh puts the PS1 toolchain in
tools/toolchain and the Python packages in .venv.
FreeBSD 15.1 builds use Clang and the binutils, cmake-core, ninja,
sdl3, shaderc, vulkan-headers, and vulkan-loader packages. Follow the
matching build's FreeBSD setup for the pinned PS1 compiler and Python tools.
Give CMake a fresh build directory so it finds GNU ld.bfd and objcopy
for the relocatable game modules. The regular build targets below work
with the same checked retail inputs.
Every release has a FreeBSD package, built on FreeBSD 15.1 amd64 from the release's source. To build it yourself, extract both discs (US and JP Disc 1) and run, from that checkout:
sh packaging/build-freebsd-release.sh --version VERSION --out releaseIt builds the US and Japanese executables with both engines (it also needs
gcc14 and an llvm package for the state schemas), checks each against
your module images as the Linux tarball's are checked, and writes
xenogears-pc-VERSION-freebsd15-amd64.pkg and its .sha256 into release.
tools/setup.sh
source .venv/bin/activate # fish: source .venv/bin/activate.fishPut the images under bin/ with their Redump names, a folder per disc:
bin/Xenogears (USA) (Disc 1)/Xenogears (USA) (Disc 1).cue + .bin
bin/Xenogears (USA) (Disc 2)/Xenogears (USA) (Disc 2).cue + .bin
Only disc 1 is needed to build. Then:
python tools/extract.py us # the game's code files, checked against retail
python tools/configure.py us # split them and write build.ninja
ninja # rebuild every module and check it byte for byte
python tools/pc_sources.py # source lists for CMake
cmake -S port -B build/pc/release -G Ninja -DCMAKE_BUILD_TYPE=Release -DXG_VERSION=US -DXG_EXTRAS=ON
cmake --build build/pc/release
build/pc/release/xenogears --setupFor the Japanese release use jp and -DXG_VERSION=JP, in its own build
folder (for example build/pc/release-jp).

--setup opens the setup screen. Choose the folder with your images (it
finds both discs, also in folders three levels down) and, optionally, a PS1
BIOS. Without a BIOS only the save names on the memory card screens and some
scrolling text stay blank. The same page sets the languages: the game's text
or a translation, the movies' voices and subtitles, and the battle voices
(Translations and mods). Later starts
use the saved paths.
Settings, memory cards and save states are kept in
~/.local/share/xenogears/ (Windows: %APPDATA%\xenogears\).
The port has two engines: Original, the game as the PlayStation ran it, and
Enhanced, the port's own. Every release package holds one xenogears with
both. Choose the engine on the first run's setup screen or in F1 > System >
Engine; a change restarts the game.
-DXG_ENGINE=both builds that executable. It builds both engines, so it
takes about twice as long. For development, -DXG_ENGINE=original (the
default, used in the steps above) and -DXG_ENGINE=enhanced each build one
engine alone, as xenogears and xenogears-enhanced. Build the second into
build/pc/enhanced, or put it beside xenogears, and F1 > System > Engine
switches between the two.
After the steps above, tools/build_windows.sh [--jp] [--debug] [OUTDIR]
cross-builds for Windows with MinGW-w64. It needs x86_64-w64-mingw32-gcc,
CMake, Ninja, glslc and three source tarballs: SDL 3, and for the shader
presets and the movie packs' AV1 videos, glslang and dav1d (Meson). Their
versions, URLs and SHA-256 sums are in tools/deps.json;
python tools/deps.py fetch downloads them into tools/toolchain-src and
keeps only files whose sum matches. The build itself downloads nothing.
--dist makes a build to hand out, with no path of the build machine in its
executable and no link time in its header. The result, in
build/pc/dist/xenogears-us-windows-x86_64 by default, holds xenogears.exe,
which has both engines, and SDL3.dll. Releases are built the same way inside
a pinned Debian build environment with its MinGW-w64 (below), not with the
host's.
Download the amd64 .deb from the releases page
and run sudo apt install ./FILE.deb, substituting the downloaded filename.
Ubuntu 26.04 LTS is the minimum supported Ubuntu release. The same package
installed and reached the disc setup screen on Debian Forky (testing).
On Windows x64, run the setup.exe download to install the port. For a
portable copy, extract the .zip and launch xenogears.exe from the
extracted folder. Both downloads include the SDL runtime and require a
Vulkan 1.3 driver.
On a Linux x86-64 host, the release command needs bubblewrap, Python 3 and
Docker. Docker prepares two cached build environments once: Ubuntu's for the
Linux build and the NSIS compiler, and Debian's MinGW-w64 for the Windows
build (packaging/deb_ubuntu.Dockerfile and packaging/mingw_debian.Dockerfile,
each pinned by image digest and archive snapshot, so everyone gets the same
compilers). The builds run inside them, offline.
bash build-release.sh --fetch-only --cache release-cache
bash build-release.sh --discs bin --cache release-cache --version YYYY.MM.DD.R --out releaseThe second command uses the US Disc 1 image and builds offline. The version is
YYYY.MM.N through 2026.11.40, and YYYY.MM.DD.R from 2026.12.01.0. It writes
the Linux tarball, the Ubuntu amd64 .deb, and the Windows installer and
ZIP once their payload audits pass. Every package holds one xenogears
executable with both engines.
Release packages can check for a new release. The first start asks whether
to check; F1 > System > Updates changes the answer, and update_check=off
in settings.ini turns the check off. A check runs at most once a day and
fetches two small files from the GitHub releases: the update list and its
signature. The request carries nothing about you or your copy, and a list
whose signature does not verify is ignored. On Linux and FreeBSD the check
uses the system's libcurl (libcurl.so.4; on FreeBSD the curl package);
without it there is no check.
When a new release is out, F1 > System > Updates offers it. The Android
app, the Linux tarball and the Windows installer and ZIP copies install it
themselves (Install and restart). The .deb, Arch, Gentoo and FreeBSD
packages only say that it is out; update them with the package manager (on
FreeBSD, pkg install the new release's .pkg). Save state slots
from a release that checks for updates load in the other such releases, older
and newer; a slot marked "This version only" loads only in the release that
made it.
Older releases had a second executable for the Enhanced engine, and their update looks for it in the new release. If you play such a release with the Enhanced engine and Install and restart fails, download the new release and install it by hand once.
The releases are also an APT repository for the .deb, so apt upgrade
keeps the port up to date:
sudo install -d /etc/apt/keyrings
sudo curl -fsSLo /etc/apt/keyrings/xenogears-pc-archive-keyring.asc \
https://github.com/EtherAura/xenogears-pc/releases/latest/download/xenogears-pc-archive-keyring.asc
echo 'deb [signed-by=/etc/apt/keyrings/xenogears-pc-archive-keyring.asc] https://github.com/EtherAura/xenogears-pc/releases/latest/download/ ./' \
| sudo tee /etc/apt/sources.list.d/xenogears-pc.list
sudo apt update && sudo apt install xenogears-pcgpg --show-keys /etc/apt/keyrings/xenogears-pc-archive-keyring.asc shows
the key; its fingerprint is 98D8 FE73 4486 2E22 A6CC 4BD1 F8DB C452 62B8 B7A6.
A release's Linux and Windows executables can be rebuilt on a machine that
has no disc. Each release carries its link tables,
xenogears-pc-VERSION-link-tables.tar.gz. Check out the release's tag,
download that file, and run:
bash build-release.sh --tables xenogears-pc-VERSION-link-tables.tar.gz --out release--only linux or --only windows builds one of them. It needs bubblewrap,
and Docker once to prepare the cached build environments and fetch the
Windows libraries' pinned sources (with network access); the build itself
runs offline. The tables hold addresses, sizes, offsets and hashes of the
game's data and never its bytes. The executables are the same either way:
they read the game from your own disc at every start.
The tables are made where the release is built, from the disc, with the
compilers of the release's build environments. With them is the SHA-256 of
each executable that build made and audited. With the sources of that
release, the command fails unless it made the same bytes; --reproduce also
fails when the sources are not the tables'. Nothing is packaged, because the
packages' payload audit needs the disc images. The repository's "Build
without a disc" workflow runs this for each release and compares the result
with the release's Linux tarball and Windows .zip.
A plain CMake build links from tables too when the checkout has no asm/
folder and the tables are extracted as port/link-tables
(-DXG_LINK_FROM=tables asks for them). They fit the build environments'
compilers: with another one the build stops at a stale source data plan
wherever that compiler lays an object's data out differently.
With the disc, bash build-release.sh --discs bin --write-tables port/link-tables
writes tables for your own checkout: it builds and audits the Linux and
Windows executables and packages nothing.
These pages are published from docs/ in the repository, and edits made on the wiki are overwritten: to change a page, see CONTRIBUTING.
これらのページはリポジトリの docs/ から公開しており、Wiki での編集は上書きされます。ページを変えるには CONTRIBUTING をご覧ください。