2018-09-05 16:11:47 +00:00
|
|
|
{ stdenv, fetchFromGitHub, ocaml, findlib, dune, qtest, result }:
|
2016-02-17 17:54:23 +00:00
|
|
|
|
2018-08-07 19:28:46 +00:00
|
|
|
if !stdenv.lib.versionAtLeast ocaml.version "4.02"
|
|
|
|
then throw "sequence is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
|
|
|
|
|
|
|
let version = "1.1"; in
|
2016-02-17 17:54:23 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2017-07-08 09:14:16 +00:00
|
|
|
name = "ocaml${ocaml.version}-sequence-${version}";
|
2016-02-17 17:54:23 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "c-cube";
|
|
|
|
repo = "sequence";
|
2017-07-08 09:14:16 +00:00
|
|
|
rev = version;
|
2018-08-07 19:28:46 +00:00
|
|
|
sha256 = "08j37nldw47syq3yw4mzhhvya43knl0d7biddp0q9hwbaxhzgi44";
|
2016-02-17 17:54:23 +00:00
|
|
|
};
|
|
|
|
|
2018-09-05 16:11:47 +00:00
|
|
|
buildInputs = [ ocaml findlib dune qtest ];
|
2018-08-07 19:28:46 +00:00
|
|
|
propagatedBuildInputs = [ result ];
|
2016-02-17 17:54:23 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
2018-09-05 16:11:47 +00:00
|
|
|
checkPhase = "dune runtest";
|
2016-02-17 17:54:23 +00:00
|
|
|
|
2018-09-05 16:11:47 +00:00
|
|
|
inherit (dune) installPhase;
|
2016-02-17 17:54:23 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = https://github.com/c-cube/sequence;
|
|
|
|
description = "Simple sequence (iterator) datatype and combinators";
|
|
|
|
longDescription = ''
|
|
|
|
Simple sequence datatype, intended to transfer a finite number of
|
|
|
|
elements from one data structure to another. Some transformations on sequences,
|
|
|
|
like `filter`, `map`, `take`, `drop` and `append` can be performed before the
|
|
|
|
sequence is iterated/folded on.
|
|
|
|
'';
|
|
|
|
license = stdenv.lib.licenses.bsd2;
|
2015-12-24 17:49:07 +00:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2016-02-17 17:54:23 +00:00
|
|
|
};
|
|
|
|
}
|