summary refs log tree commit diff
path: root/pkgs/games/uhexen2
diff options
context:
space:
mode:
authorxdHampus <16954508+xdHampus@users.noreply.github.com>2021-04-02 22:16:12 +0000
committerxdHampus <16954508+xdHampus@users.noreply.github.com>2021-04-05 13:55:09 +0000
commit32b1dddd18359a07f8ed74010491fc52a4a36382 (patch)
tree450f8428f715d2da441acbdcef38bcf68d4be940 /pkgs/games/uhexen2
parentefef5af8134e1c07040c20881c3a644526c7cc61 (diff)
downloadnixpkgs-32b1dddd18359a07f8ed74010491fc52a4a36382.tar
nixpkgs-32b1dddd18359a07f8ed74010491fc52a4a36382.tar.gz
nixpkgs-32b1dddd18359a07f8ed74010491fc52a4a36382.tar.bz2
nixpkgs-32b1dddd18359a07f8ed74010491fc52a4a36382.tar.lz
nixpkgs-32b1dddd18359a07f8ed74010491fc52a4a36382.tar.xz
nixpkgs-32b1dddd18359a07f8ed74010491fc52a4a36382.tar.zst
nixpkgs-32b1dddd18359a07f8ed74010491fc52a4a36382.zip
uhexen2: init at 1.5.9
Diffstat (limited to 'pkgs/games/uhexen2')
-rw-r--r--pkgs/games/uhexen2/default.nix66
1 files changed, 66 insertions, 0 deletions
diff --git a/pkgs/games/uhexen2/default.nix b/pkgs/games/uhexen2/default.nix
new file mode 100644
index 00000000000..dac081cd7b4
--- /dev/null
+++ b/pkgs/games/uhexen2/default.nix
@@ -0,0 +1,66 @@
+{ lib, fetchgit, SDL, stdenv, libogg, libvorbis, libmad, xdelta }:
+
+stdenv.mkDerivation rec {
+  name = "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 -l$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; {
+    description = "A 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 = "http://uhexen2.sourceforge.net/";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ xdhampus ];
+    platforms = platforms.all;
+  };
+}