326.5. devilutionx-1.5.5
Diablo and Hellfire engine, for a player's own copy of the game data
| Version | 1.5.5, release 1 |
| Shelf | games-rpg — RPGs, roguelikes and interactive fiction |
| Phase | 44_apps (Applications), 192 of 422 in build order |
| Licence | LicenseRef-Sustainable-Use-License |
| Homepage | https://github.com/diasurgical/DevilutionX |
| Build time | 13.6 SBU |
| Installed size | 10.2 MiB in 9 files |
| Recipe | ports/core/games-rpg/devilutionx/kpkgbuild |
About
DevilutionX is an engine for Blizzard’s Diablo and its expansion Hellfire, built on Devilution, a reconstruction of the original game’s source code, so that it runs on current systems. It ships no game: the player supplies their own DIABDAT.MPQ (and Hellfire’s files for the expansion), which cannot be redistributed. The engine’s own assets, devilutionx.mpq, come prebuilt in upstream’s source release. This port installs the one program, devilutionx, with a menu entry for each game.
Sources
devilutionx-1.5.5.tar.xz(33.1 MiB)
sha256f42379cdf098a351a2020d9e6de1840c76e09113c792f73c6df34dec26818b04
upstream: https://github.com/diasurgical/DevilutionX/releases/download/1.5.5/devilutionx-src-fully-vendored.tar.xz
archive copy: sources-2/games-rpg--devilutionx-1.5.5.tar.xz
Dependencies
Depends on: cmake, ninja, pkgconf, sdl2-compat, sdl2-image, libpng, zlib, bzip2, libsodium.
Required by: no port names it.
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 devilutionx'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/games-rpg/devilutionx.
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-rpg/devilutionx
echo 'f42379cdf098a351a2020d9e6de1840c76e09113c792f73c6df34dec26818b04 devilutionx-1.5.5.tar.xz' | 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/devilutionx
SRC=$SRC_ROOT/devilutionx-1.5.5
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf devilutionx-1.5.5.tar.xz -C "$SRC" --strip-components=1
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 five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
mkdir build && cd build
cmake .. -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr \
-DFETCHCONTENT_FULLY_DISCONNECTED=ON \
-DBUILD_TESTING=OFF \
-DDISABLE_LTO=ON \
-DDISABLE_ZERO_TIER=ON \
-DDISABLE_TCP=OFF \
-DDISCORD_INTEGRATION=OFF \
-DNONET=OFF \
-DNOSOUND=OFF \
-DBUILD_ASSETS_MPQ=OFF \
-DDEVILUTIONX_SYSTEM_SDL2=ON \
-DDEVILUTIONX_SYSTEM_SDL_IMAGE=ON \
-DDEVILUTIONX_SYSTEM_ZLIB=ON \
-DDEVILUTIONX_SYSTEM_BZIP2=ON \
-DDEVILUTIONX_SYSTEM_LIBSODIUM=ON \
-DDEVILUTIONX_SYSTEM_LIBFMT=OFF \
-DDEVILUTIONX_SYSTEM_SDL_AUDIOLIB=OFF \
-DDEVILUTIONX_SYSTEM_SIMPLEINI=OFF
ninja
DESTDIR=$PKG ninja install
cd ..
rm -f "$PKG/usr/share/applications/devilutionx.desktop" \
"$PKG/usr/share/applications/devilutionx-hellfire.desktop"
cat > "$PKG/usr/share/applications/devilutionx.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=DevilutionX
GenericName=Action Role-Playing Game
Comment=Play Diablo from your own game data
Exec=devilutionx --diablo
Icon=devilutionx
Terminal=false
StartupWMClass=devilutionx
Categories=Game;RolePlaying;
Keywords=diablo;rpg;dungeon;devilutionx;
DESKTOP
cat > "$PKG/usr/share/applications/devilutionx-hellfire.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=DevilutionX Hellfire
GenericName=Action Role-Playing Game
Comment=Play Diablo: Hellfire from your own game data
Exec=devilutionx --hellfire
Icon=devilutionx-hellfire
Terminal=false
StartupWMClass=devilutionx
Categories=Game;RolePlaying;
Keywords=diablo;hellfire;rpg;dungeon;devilutionx;
DESKTOP
chmod 644 "$PKG/usr/share/applications/"devilutionx*.desktop
The switches, and why each is set:
-DFETCHCONTENT_FULLY_DISCONNECTED=ON— never let CMake’s FetchContent download anything. The source is upstream’s fully vendored distribution, which carries the sources of the FetchContent dependencies this build uses underdist/; with this switch a dependency missing from it is a configure error rather than a download, which a build with no network could not make. Upstream’sdist/CMakeLists.txtleaves the switch off, because its Windows and Android builds still fetch.-DDISABLE_LTO=ON— no link-time optimisation, which upstream turns on for a release build.-DDISABLE_ZERO_TIER=ON— leave out ZeroTier multiplayer. It joins games through a public ZeroTier network, reached through ZeroTier’s servers, and builds the libzt copy indist/.-DDISABLE_TCP=OFF— with-DNONET=OFF: keep network support, and with it multiplayer over TCP, joining a host by its address. Both are upstream’s defaults, named.-DDISCORD_INTEGRATION=OFF— no Discord rich presence. Upstream’s default, named.-DNOSOUND=OFF— build with sound. Upstream’s default, named.-DBUILD_ASSETS_MPQ=OFF— do not package the engine’s assets intodevilutionx.mpqat build time, which needs thesmpqtool; the tree has no port of it. Thedevilutionx.mpqindist/is installed instead.-DDEVILUTIONX_SYSTEM_SDL2=ON— with-DDEVILUTIONX_SYSTEM_SDL_IMAGE=ON,-DDEVILUTIONX_SYSTEM_ZLIB=ON,-DDEVILUTIONX_SYSTEM_BZIP2=ONand-DDEVILUTIONX_SYSTEM_LIBSODIUM=ON: link the tree’s SDL2, SDL_image, zlib, bzip2 and libsodium rather than bundled copies. Upstream’sdist/CMakeLists.txtsets the SDL2, SDL_image, bzip2 and libsodium switches toOFFwhen they are unset, so without these flags the source distribution compiles its own copies fromdist/; the zlib switch is on by default and named. On meansfind_package(... REQUIRED), so a missing library fails the configure instead of falling back to the copy.-DDEVILUTIONX_SYSTEM_LIBFMT=OFF— compile the bundled fmt 10.0 fromdist/, the version this release is written against, rather than the tree’s fmt. The source distribution sets itOFFitself when it is unset; named.-DDEVILUTIONX_SYSTEM_SDL_AUDIOLIB=OFF— with-DDEVILUTIONX_SYSTEM_SIMPLEINI=OFF: compile the bundled SDL_audiolib and simpleini, neither of which is a port. Named, so a copy that appears in the build root later is not picked up instead.
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/devilutionx, 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 devilutionx-1.5.5-1.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/devilutionx, and runs the triggers its paths call for.
Contents
Installed programs: devilutionx.
Installed directories: /usr/share/diasurgical, /usr/share/licenses/devilutionx.
Notes
The build runs from a build directory inside the source; upstream warns about a build in the source directory itself. Libraries that have no system form at all, such as asio, libmpq and libsmackerdec, are always compiled, from their sources under dist/ through the CMake wrappers in 3rdParty/.
build.sh removes upstream’s two desktop entries and writes its own, devilutionx.desktop running devilutionx --diablo and devilutionx-hellfire.desktop running devilutionx --hellfire. Both add StartupWMClass=devilutionx: the two games run the one program, whose Wayland app id is SDL’s default, the executable’s name.