12 # 1. Needs ocaml >= 4.04 and <= 4.11 (patched against 4.14)
13 # 2. ocaml 4.10 defaults to safe (immutable) strings so we need a version with
14 # that disabled as weidu is strongly dependent on mutable strings
15 ocaml' = ocaml-ng.ocamlPackages_4_14_unsafe_string.ocaml;
18 stdenv.mkDerivation rec {
22 src = fetchFromGitHub {
26 sha256 = "sha256-+vkKTzFZdAzY2dL+mZ4A0PDxhTKGgs9bfArz7S6b4m4=";
30 substitute sample.Configuration Configuration \
31 --replace /usr/bin ${lib.makeBinPath [ ocaml' ]} \
32 --replace elkhound ${elkhound}/bin/elkhound
34 mkdir -p obj/{.depend,x86_LINUX}
36 # undefined reference to `caml_hash_univ_param'
37 sed -i "20,21d;s/old_hash_param/hash_param/" hashtbl-4.03.0/myhashtbl.ml
40 nativeBuildInputs = [ elkhound ocaml' perl which gnumake42 ];
42 buildFlags = [ "weidu" "weinstall" "tolower" ];
47 for b in tolower weidu weinstall; do
48 install -Dm555 $b.asm.exe $out/bin/$b
51 install -Dm444 -t $out/share/doc/weidu README* COPYING
57 description = "InfinityEngine Modding Engine";
58 homepage = "https://weidu.org";
59 license = licenses.gpl2Only;
60 maintainers = with maintainers; [ peterhoeg ];
61 # should work fine on both Darwin and Windows
62 platforms = platforms.linux;