From 2dbdf0b7f1cf8745ce49c398fc4cd3ae614757ec Mon Sep 17 00:00:00 2001 From: Mauricio Scheffer Date: Sat, 9 Jul 2022 16:19:33 +0100 Subject: [PATCH] xu4: init at 1.3 --- pkgs/games/xu4/default.nix | 77 +++++++++++++++++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 79 insertions(+) create mode 100644 pkgs/games/xu4/default.nix diff --git a/pkgs/games/xu4/default.nix b/pkgs/games/xu4/default.nix new file mode 100644 index 000000000000000..e0024f38d2790db --- /dev/null +++ b/pkgs/games/xu4/default.nix @@ -0,0 +1,77 @@ +{ lib +, stdenv +, fetchFromGitHub +, makeWrapper +, zlib +, libpng +, boron +, libGL +, libX11 +, libXcursor +, faun +}: + +stdenv.mkDerivation rec { + pname = "xu4"; + version = "1.3"; + + src = fetchFromGitHub { + owner = "xu4-engine"; + repo = "u4"; + rev = "v${version}"; + hash = "sha256-3jyUSVfmjuKsHQKluFnQ8Gtg7aAI/WBjmY109BdNdyY="; + fetchSubmodules = true; + }; + + # this is not a standard Autotools-like `configure` script + dontAddPrefix = true; + + preConfigure = '' + patchShebangs configure + ''; + + postConfigure = '' + # need to report this upstream + sed --in-place 's/-Wall/-Wno-error=format-security/g' src/Makefile + + # disable git submodule init as part of build + sed --in-place 's/^\s*git submodule.*//g' src/Makefile.common + + # set binary version (ref https://github.com/NixOS/nixpkgs/commit/571e02812f5da12fd851557ebbacea72fc7b5121#r129407907 ) + sed --in-place 's/DR-1.0/${version}/' src/Makefile.common + ''; + + enableParallelBuilding = true; + + buildInputs = [ + zlib + libpng + boron + libGL + libX11 + libXcursor + faun + ]; + + nativeBuildInputs = [ makeWrapper ]; + + # The `install` target references some files with unknown license + installPhase = + '' + install -D -m 755 src/xu4 $out/share/xu4 + install -D -m 644 Ultima-IV.mod $out/share/Ultima-IV.mod + install -D -m 644 U4-Upgrade.mod $out/share/U4-Upgrade.mod + install -D -m 644 render.pak $out/share/render.pak + install -D icons/xu4.png $out/share/icons/hicolor/48x48/apps/xu4.png + install -D -m 644 dist/xu4.desktop $out/share/applications/xu4.desktop + makeWrapper $out/share/xu4 $out/bin/xu4 --chdir $out/share + ''; + + meta = with lib; { + homepage = "http://xu4.sourceforge.net/"; + description = "Remake of the computer game Ultima IV"; + license = licenses.gpl2Plus; + platforms = [ "x86_64-linux" ]; # aarch64 won't compile + maintainers = with maintainers; [ mausch ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 712867e7a0153b8..f1e0755e946b990 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -38605,6 +38605,8 @@ with pkgs; xtris = callPackage ../games/xtris { }; + xu4 = callPackage ../games/xu4 { }; + inherit (callPackage ../games/quake2/yquake2 { inherit (darwin.apple_sdk.frameworks) Cocoa OpenAL; })