2017-11-12 08:28:02 +00:00
|
|
|
{ stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, cppo, gen, sequence, qtest, ounit, result
|
2016-08-03 17:35:06 +01:00
|
|
|
, qcheck }:
|
2016-02-17 17:54:58 +00:00
|
|
|
|
2016-03-16 20:50:11 +00:00
|
|
|
let
|
|
|
|
|
|
|
|
mkpath = p:
|
2016-10-24 03:09:17 +01:00
|
|
|
"${p}/lib/ocaml/${ocaml.version}/site-lib";
|
2016-03-16 20:50:11 +00:00
|
|
|
|
2018-03-31 06:53:08 +01:00
|
|
|
version = "1.4";
|
2016-03-16 20:50:11 +00:00
|
|
|
|
|
|
|
in
|
2016-02-17 17:54:58 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2017-07-31 18:19:19 +01:00
|
|
|
name = "ocaml${ocaml.version}-containers-${version}";
|
2016-02-17 17:54:58 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "c-cube";
|
|
|
|
repo = "ocaml-containers";
|
|
|
|
rev = "${version}";
|
2018-03-31 06:53:08 +01:00
|
|
|
sha256 = "1wbarxphdrxvy7qsdp4p837h1zrv0z83pgs5lbz2h3kdnyvz2f1i";
|
2016-02-17 17:54:58 +00:00
|
|
|
};
|
|
|
|
|
2017-11-12 08:28:02 +00:00
|
|
|
buildInputs = [ ocaml findlib ocamlbuild cppo gen sequence qtest ounit qcheck ];
|
2016-03-16 20:50:11 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [ result ];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
# The following is done so that the '#use "topfind"' directive works in the ocaml top-level
|
|
|
|
export HOME="$(mktemp -d)"
|
|
|
|
export OCAML_TOPLEVEL_PATH="${mkpath findlib}"
|
|
|
|
cat <<EOF > $HOME/.ocamlinit
|
|
|
|
let () =
|
|
|
|
try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH")
|
|
|
|
with Not_found -> ()
|
|
|
|
;;
|
|
|
|
EOF
|
|
|
|
'';
|
2016-02-17 17:54:58 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-unix"
|
|
|
|
"--enable-thread"
|
|
|
|
"--enable-tests"
|
2017-05-30 13:48:07 +01:00
|
|
|
"--enable-docs"
|
2016-02-17 17:54:58 +00:00
|
|
|
"--disable-bench"
|
|
|
|
];
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkTarget = "test";
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = https://github.com/c-cube/ocaml-containers;
|
|
|
|
description = "A modular standard library focused on data structures";
|
|
|
|
longDescription = ''
|
|
|
|
Containers is a standard library (BSD license) focused on data structures,
|
|
|
|
combinators and iterators, without dependencies on unix. Every module is
|
|
|
|
independent and is prefixed with 'CC' in the global namespace. Some modules
|
|
|
|
extend the stdlib (e.g. CCList provides safe map/fold_right/append, and
|
|
|
|
additional functions on lists).
|
|
|
|
|
|
|
|
It also features optional libraries for dealing with strings, and
|
|
|
|
helpers for unix and threads.
|
|
|
|
'';
|
|
|
|
license = stdenv.lib.licenses.bsd2;
|
2015-12-24 17:49:07 +00:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2016-02-17 17:54:58 +00:00
|
|
|
};
|
|
|
|
}
|