lol
1{ stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, menhir, yojson, ulex, pprint, fix, functory }:
2
3let
4 check-ocaml-version = with stdenv.lib; versionAtLeast (getVersion ocaml);
5in
6
7assert check-ocaml-version "4";
8
9stdenv.mkDerivation {
10
11 name = "mezzo-0.0.m8";
12
13 src = fetchFromGitHub {
14 owner = "protz";
15 repo = "mezzo";
16 rev = "m8";
17 sha256 = "0yck5r6di0935s3iy2mm9538jkf77ssr789qb06ms7sivd7g3ip6";
18 };
19
20 buildInputs = [ ocaml findlib ocamlbuild yojson menhir ulex pprint fix functory ];
21
22 # Sets warning 3 as non-fatal
23 prePatch = stdenv.lib.optionalString (check-ocaml-version "4.02") ''
24 substituteInPlace myocamlbuild.pre.ml \
25 --replace '@1..3' '@1..2+3'
26 '';
27
28 createFindlibDestdir = true;
29
30 postInstall = ''
31 mkdir $out/bin
32 cp mezzo $out/bin/
33 '';
34
35 meta = with stdenv.lib; {
36 homepage = http://protz.github.io/mezzo/;
37 description = "A programming language in the ML tradition, which places strong emphasis on the control of aliasing and access to mutable memory";
38 license = licenses.gpl2;
39 platforms = ocaml.meta.platforms or [];
40 };
41}
42
43