nixpkgs/pkgs/by-name/uh/uhexen2/package.nix
Silvan Mosberger 4f0dadbf38 treewide: format all inactive Nix files
After final improvements to the official formatter implementation,
this commit now performs the first treewide reformat of Nix files using it.
This is part of the implementation of RFC 166.

Only "inactive" files are reformatted, meaning only files that
aren't being touched by any PR with activity in the past 2 months.
This is to avoid conflicts for PRs that might soon be merged.
Later we can do a full treewide reformat to get the rest,
which should not cause as many conflicts.

A CI check has already been running for some time to ensure that new and
already-formatted files are formatted, so the files being reformatted here
should also stay formatted.

This commit was automatically created and can be verified using

    nix-build a08b3a4d19.tar.gz \
      --argstr baseRev b32a094368
    result/bin/apply-formatting $NIXPKGS_PATH
2024-12-10 20:26:33 +01:00

83 lines
2.1 KiB
Nix

{
lib,
fetchgit,
SDL,
stdenv,
libogg,
libvorbis,
libmad,
xdelta,
}:
stdenv.mkDerivation rec {
pname = "uhexen2";
version = "1.5.9";
src = fetchgit {
url = "https://git.code.sf.net/p/uhexen2/uhexen2";
sha256 = "0crdihbnb92awkikn15mzdpkj1x9s34xixf1r7fxxf762m60niks";
rev = "4ef664bc41e3998b0d2a55ff1166dadf34c936be";
};
buildInputs = [
SDL
libogg
libvorbis
libmad
xdelta
];
preBuild = ''
makeFiles=(
"engine/hexen2 glh2"
"engine/hexen2 clean"
"engine/hexen2 h2"
"engine/hexen2/server"
"engine/hexenworld/client glhw"
"engine/hexenworld/client clean"
"engine/hexenworld/client hw"
"engine/hexenworld/server"
"h2patch"
)
'';
buildPhase = ''
runHook preBuild
for makefile in "''${makeFiles[@]}"; do
local flagsArray=(
-j$NIX_BUILD_CORES
SHELL=$SHELL
$makeFlags "''${makeFlagsArray[@]}"
$buildFlags "''${buildFlagsArray[@]}"
)
echoCmd 'build flags' ""''${flagsArray[@]}""
make -C $makefile ""''${flagsArray[@]}""
unset flagsArray
done
runHook postBuild
'';
installPhase = ''
runHook preInstall
install -Dm755 engine/hexen2/{glhexen2,hexen2,server/h2ded} -t $out/bin
install -Dm755 engine/hexenworld/{client/glhwcl,client/hwcl,server/hwsv} -t $out/bin
install -Dm755 h2patch/h2patch -t $out/bin
runHook postInstall
'';
meta = with lib; {
broken = stdenv.hostPlatform.isDarwin;
description = "Cross-platform port of Hexen II game";
longDescription = ''
Hammer of Thyrion (uHexen2) is a cross-platform port of Raven Software's Hexen II source.
It is based on an older linux port, Anvil of Thyrion.
HoT includes countless bug fixes, improved music, sound and video modes, opengl improvements,
support for many operating systems and architectures, and documentation among many others.
'';
homepage = "https://uhexen2.sourceforge.net/";
license = licenses.gpl2Plus;
maintainers = with maintainers; [ xdhampus ];
platforms = platforms.all;
};
}