2018-09-05 16:11:47 +00:00
|
|
|
{ stdenv, fetchzip, ocaml, findlib, ocamlbuild, topkg, dune
|
2019-01-18 15:44:41 +00:00
|
|
|
, cmdliner, astring, fmt, result, uuidm
|
2017-10-31 01:06:17 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let param =
|
|
|
|
if stdenv.lib.versionAtLeast ocaml.version "4.02" then {
|
2019-01-18 15:44:41 +00:00
|
|
|
version = "0.8.5";
|
|
|
|
sha256 = "1mhckvdcxkikbzgvy24kjz4265l15b86a6swz7m3ynbgvqdcfzqn";
|
2019-10-31 10:16:15 +00:00
|
|
|
nativeBuildInputs = [ dune ];
|
2019-01-18 15:44:41 +00:00
|
|
|
propagatedBuildInputs = [ uuidm ];
|
2018-09-05 16:11:47 +00:00
|
|
|
buildPhase = "dune build -p alcotest";
|
|
|
|
inherit (dune) installPhase;
|
2017-10-31 01:06:17 +00:00
|
|
|
} else {
|
|
|
|
version = "0.7.2";
|
|
|
|
sha256 = "1qgsz2zz5ky6s5pf3j3shc4fjc36rqnjflk8x0wl1fcpvvkr52md";
|
2019-10-31 10:16:15 +00:00
|
|
|
buildInputs = [ topkg ];
|
|
|
|
nativeBuildInputs = [ ocamlbuild ];
|
2017-10-31 01:06:17 +00:00
|
|
|
inherit (topkg) buildPhase installPhase;
|
|
|
|
};
|
|
|
|
in
|
2015-05-15 14:36:16 +00:00
|
|
|
|
2016-10-25 17:32:16 +00: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 14:36:16 +00:00
|
|
|
|
2015-10-13 01:46:01 +00: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 14:36:16 +00:00
|
|
|
};
|
|
|
|
|
2019-10-31 10:16:15 +00:00
|
|
|
nativeBuildInputs = [ ocaml findlib ] ++ (param.nativeBuildInputs or []);
|
|
|
|
buildInputs = [ findlib ] ++ (param.buildInputs or []);
|
2016-10-25 17:32:16 +00:00
|
|
|
|
2019-01-18 15:44:41 +00:00
|
|
|
propagatedBuildInputs = [ cmdliner astring fmt result ]
|
|
|
|
++ (param.propagatedBuildInputs or []);
|
2016-10-25 17:32:16 +00:00
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
2015-05-15 14:36:16 +00:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/mirage/alcotest";
|
2015-05-15 14:36:16 +00:00
|
|
|
description = "A lightweight and colourful test framework";
|
|
|
|
license = stdenv.lib.licenses.isc;
|
|
|
|
maintainers = [ maintainers.ericbmerritt ];
|
|
|
|
};
|
|
|
|
}
|