From da221050a96db8df865478b65e06bed641843f57 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Sat, 19 Apr 2025 20:16:23 +1000 Subject: [PATCH] Compiling: add downstream packaging section --- Compiling.md | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/Compiling.md b/Compiling.md index d9c231b..dc899d0 100644 --- a/Compiling.md +++ b/Compiling.md @@ -11,15 +11,37 @@ To this end the Makefile default settings enable all optimisations that can be u The engine builds will be dynamically linked except for d0_blind_id which is statically linked to ensure reliable player ID support and because OS distributions don't ship this library. -### Commands +**Invoking `make` or `make help` in the Xonotic directory will print the supported targets and current config.** +**Most players will want `make update-stable client` or `make update-beta client`** -Invoking `make` or `make help` in the Xonotic directory will print the supported targets and current config. - -**Most people will want `make update-stable client` or `make update-beta client`** ## System package dependencies + ### Debian Build (client): `build-essential automake libtool libgmp-dev libjpeg-dev libsdl2-dev` Build (server): `build-essential automake libtool libgmp-dev libjpeg-dev zlib1g-dev` Runtime (client): `curl rsync libpng16-16 libfreetype6 libvorbisfile3` Runtime (server): `curl rsync libpng16-16` + + +## Downstream packaging: install* targets + +The `install` targets support distribution packaging. Several variables should be changed to suit the target platform, the "Suggested definition" is the one downstream packages are expected to apply. +For a working example you may refer to the flatpak manifest at https://github.com/flathub/org.xonotic.Xonotic (NB: it has some tech debt, fixed in current master and to be removed at 0.9 release) + +### Variables +| Variable | GNU | Default | Suggested definition | Explanation | +| CFLAGS | ? | `-march=native -mtune=native` | `""` | `""` = generic CPU, all other optimisations enabled as in upstream builds | +| DESTDIR | yes | `""` | default | [GNU make manual](https://www.gnu.org/software/make/manual/html_node/DESTDIR.html) | +| prefix | yes | `/usr/local` | `/usr` | must start with `/`! | +| bindir | yes | `$(prefix)/bin` | default | `xonotic-sdl` and `xonotic-dedicated` will be installed here | +| datarootdir | yes | `$(prefix)/share` | default | [GNU make manual](https://www.gnu.org/software/make/manual/html_node/Directory-Variables.html) | +| datadir | yes | `$(datarootdir)` | default | [GNU make manual](https://www.gnu.org/software/make/manual/html_node/Directory-Variables.html) | +| docdir | yes | `$(datarootdir)/doc/xonotic` | default | `Docs/*` and/or `server` files/dirs will be installed here | +| BASEDIR | no | `$(datadir)/xonotic` | `/usr/share/xonotic` | `data/*.pk3` files will be installed here. Special: [^nb1] | + +[^nb1]: Defining `BASEDIR` or `DP_FS_BASEDIR` (including to its default value) changes the engine build slightly by compiling this path into engine binaries so they can always find the data files there. Distribution packages are expected to use this mode. +Otherwise (by default) data and engine binaries are installed to `$(datadir)/xonotic` and symlinked to in `$(bindir)` so the symlinks can be used to find the data files. + +### Targets +See: `make help-install` -- 2.39.5