diff options
author | Peter Hoeg <peter@hoeg.com> | 2021-06-30 11:56:49 +0800 |
---|---|---|
committer | Peter Hoeg <peter@hoeg.com> | 2021-07-01 08:23:16 +0800 |
commit | 9bf8cea055a77659bf7cd5e3839cd7c619bd3d01 (patch) | |
tree | 0159390bfa49d80b0917d82319b7d9f7bc815a4a /pkgs/tools/games | |
parent | 7046ee9476e2408f1e83746c8d4d1e2660f5914b (diff) |
weidu: init at 247
Diffstat (limited to 'pkgs/tools/games')
-rw-r--r-- | pkgs/tools/games/weidu/default.nix | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/pkgs/tools/games/weidu/default.nix b/pkgs/tools/games/weidu/default.nix new file mode 100644 index 0000000000000..d325746dc8cac --- /dev/null +++ b/pkgs/tools/games/weidu/default.nix @@ -0,0 +1,65 @@ +{ stdenv +, lib +, fetchFromGitHub +, elkhound +, ocaml-ng +, perl +, which +}: + +let + # 1. Needs ocaml >= 4.04 and <= 4.11 + # 2. ocaml 4.10 defaults to safe (immutable) strings so we need a version with + # that disabled as weidu is strongly dependent on mutable strings + ocaml' = ocaml-ng.ocamlPackages_4_10.ocaml.overrideAttrs (old: { + configureFlags = old.configureFlags ++ [ + # https://github.com/WeiDUorg/weidu/issues/197 + "--disable-force-safe-string" + ]; + }); + +in +stdenv.mkDerivation rec { + pname = "weidu"; + version = "247.00"; + + src = fetchFromGitHub { + owner = "WeiDUorg"; + repo = pname; + rev = "v${version}"; + sha256 = "sha256-vAIIYn0urQnnL82mdfwJtahrS3uWPFferm+0F13TKcw="; + }; + + postPatch = '' + substitute sample.Configuration Configuration \ + --replace /usr/bin ${lib.makeBinPath [ ocaml' ]} \ + --replace elkhound ${elkhound}/bin/elkhound + + mkdir -p obj/{.depend,x86_LINUX} + ''; + + nativeBuildInputs = [ elkhound ocaml' perl which ]; + + buildFlags = [ "weidu" "weinstall" "tolower" ]; + + installPhase = '' + runHook preInstall + + for b in tolower weidu weinstall; do + install -Dm555 $b.asm.exe $out/bin/$b + done + + install -Dm444 -t $out/share/doc/weidu README* COPYING + + runHook postInstall + ''; + + meta = with lib; { + description = "InfinityEngine Modding Engine"; + homepage = "https://weidu.org"; + license = licenses.gpl2Only; + maintainers = with maintainers; [ peterhoeg ]; + # should work fine on both Darwin and Windows + platforms = platforms.linux; + }; +} |