1 { lib, stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, camlp4, menhir
2 , menhirLib, yojson, ulex, pprint, fix, functory
5 if lib.versionAtLeast ocaml.version "4.06"
6 then throw "mezzo is not available for OCaml ${ocaml.version}"
10 check-ocaml-version = with lib; versionAtLeast (getVersion ocaml);
13 assert check-ocaml-version "4";
20 src = fetchFromGitHub {
24 sha256 = "0yck5r6di0935s3iy2mm9538jkf77ssr789qb06ms7sivd7g3ip6";
29 nativeBuildInputs = [ ocaml findlib ocamlbuild camlp4 menhir ];
30 buildInputs = [ yojson menhirLib ulex pprint fix functory ocamlbuild ];
32 # Sets warning 3 as non-fatal
33 prePatch = lib.optionalString (check-ocaml-version "4.02") ''
34 substituteInPlace myocamlbuild.pre.ml \
35 --replace '@1..3' '@1..2+3'
37 # Compatibility with PPrint ≥ 20220103
39 substituteInPlace typing/Fact.ml --replace PPrintOCaml PPrint.OCaml
42 createFindlibDestdir = true;
50 homepage = "http://protz.github.io/mezzo/";
51 description = "A programming language in the ML tradition, which places strong emphasis on the control of aliasing and access to mutable memory";
52 license = licenses.gpl2;
53 platforms = ocaml.meta.platforms or [];