2017-10-31 01:06:17 +00:00
|
|
|
{ stdenv, fetchzip, ocaml, findlib, ocamlbuild, topkg, opam, jbuilder
|
|
|
|
, cmdliner, astring, fmt, result
|
|
|
|
}:
|
|
|
|
|
|
|
|
let param =
|
|
|
|
if stdenv.lib.versionAtLeast ocaml.version "4.02" then {
|
|
|
|
version = "0.8.1";
|
|
|
|
sha256 = "1bjhgwmshlaz9xncrrkknys7prigf8vlg1kqvfx9l8kn92mlf10b";
|
|
|
|
buildInputs = [ jbuilder ];
|
|
|
|
buildPhase = "jbuilder build -p alcotest";
|
|
|
|
inherit (jbuilder) installPhase;
|
|
|
|
} else {
|
|
|
|
version = "0.7.2";
|
|
|
|
sha256 = "1qgsz2zz5ky6s5pf3j3shc4fjc36rqnjflk8x0wl1fcpvvkr52md";
|
|
|
|
buildInputs = [ ocamlbuild opam topkg ];
|
|
|
|
inherit (topkg) buildPhase installPhase;
|
|
|
|
};
|
|
|
|
in
|
2015-05-15 15:36:16 +01:00
|
|
|
|
2016-10-25 18:32:16 +01:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "ocaml${ocaml.version}-alcotest-${version}";
|
2017-10-31 01:06:17 +00:00
|
|
|
inherit (param) version buildPhase installPhase;
|
2015-05-15 15:36:16 +01:00
|
|
|
|
2015-10-13 02:46:01 +01:00
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/mirage/alcotest/archive/${version}.tar.gz";
|
2017-10-31 01:06:17 +00:00
|
|
|
inherit (param) sha256;
|
2015-05-15 15:36:16 +01:00
|
|
|
};
|
|
|
|
|
2017-10-31 01:06:17 +00:00
|
|
|
buildInputs = [ ocaml findlib ] ++ param.buildInputs;
|
2016-10-25 18:32:16 +01:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ cmdliner astring fmt result ];
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
2015-05-15 15:36:16 +01:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2015-10-13 02:46:01 +01:00
|
|
|
homepage = https://github.com/mirage/alcotest;
|
2015-05-15 15:36:16 +01:00
|
|
|
description = "A lightweight and colourful test framework";
|
|
|
|
license = stdenv.lib.licenses.isc;
|
|
|
|
maintainers = [ maintainers.ericbmerritt ];
|
|
|
|
};
|
|
|
|
}
|