2021-05-29 15:50:56 +02:00
|
|
|
{ lib, stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, menhir, menhirLib, yojson, ulex, pprint, fix, functory }:
|
2015-07-23 21:45:14 +02:00
|
|
|
|
2021-01-22 12:25:31 +01:00
|
|
|
if lib.versionAtLeast ocaml.version "4.06"
|
2018-08-21 21:20:23 +02:00
|
|
|
then throw "mezzo is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
2015-07-23 21:45:14 +02:00
|
|
|
let
|
2021-01-22 12:25:31 +01:00
|
|
|
check-ocaml-version = with lib; versionAtLeast (getVersion ocaml);
|
2015-07-23 21:45:14 +02:00
|
|
|
in
|
|
|
|
|
|
|
|
assert check-ocaml-version "4";
|
2014-09-13 09:33:17 +02:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
|
2021-08-15 16:28:33 +02:00
|
|
|
pname = "mezzo";
|
|
|
|
version = "0.0.m8";
|
2014-09-13 09:33:17 +02:00
|
|
|
|
2015-07-23 21:45:14 +02:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "protz";
|
|
|
|
repo = "mezzo";
|
|
|
|
rev = "m8";
|
|
|
|
sha256 = "0yck5r6di0935s3iy2mm9538jkf77ssr789qb06ms7sivd7g3ip6";
|
2014-09-13 09:33:17 +02:00
|
|
|
};
|
|
|
|
|
2021-05-29 15:50:56 +02:00
|
|
|
buildInputs = [ ocaml findlib ocamlbuild yojson menhir menhirLib ulex pprint fix functory ];
|
2014-09-13 09:33:17 +02:00
|
|
|
|
2015-07-23 21:45:14 +02:00
|
|
|
# Sets warning 3 as non-fatal
|
2021-01-22 12:25:31 +01:00
|
|
|
prePatch = lib.optionalString (check-ocaml-version "4.02") ''
|
2015-07-23 21:45:14 +02:00
|
|
|
substituteInPlace myocamlbuild.pre.ml \
|
|
|
|
--replace '@1..3' '@1..2+3'
|
|
|
|
'';
|
|
|
|
|
2014-09-13 09:33:17 +02:00
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir $out/bin
|
|
|
|
cp mezzo $out/bin/
|
|
|
|
'';
|
|
|
|
|
2021-01-22 12:25:31 +01:00
|
|
|
meta = with lib; {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "http://protz.github.io/mezzo/";
|
2014-09-13 09:33:17 +02:00
|
|
|
description = "A programming language in the ML tradition, which places strong emphasis on the control of aliasing and access to mutable memory";
|
|
|
|
license = licenses.gpl2;
|
2015-12-24 18:49:07 +01:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2014-09-13 09:33:17 +02:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|