2021-01-15 22:18:51 +00:00
|
|
|
{ stdenv, lib, fetchzip, ocaml, findlib, ocamlbuild, ounit, qcheck
|
2020-04-24 23:36:52 +00:00
|
|
|
# Optionally enable tests; test script use OCaml-4.01+ features
|
2021-01-15 22:18:51 +00:00
|
|
|
, doCheck ? lib.versionAtLeast (lib.getVersion ocaml) "4.01"
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let version = "1.4.3"; in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
name = "ocaml${ocaml.version}-stringext-${version}";
|
|
|
|
|
|
|
|
src = fetchzip {
|
|
|
|
url = "https://github.com/rgrinberg/stringext/archive/v${version}.tar.gz";
|
|
|
|
sha256 = "121k79vjazvsd254yg391fp4spsd1p32amccrahd0g6hjhf5w6sl";
|
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ ocaml findlib ocamlbuild ounit qcheck ];
|
|
|
|
|
|
|
|
configurePhase = "ocaml setup.ml -configure --prefix $out"
|
2021-01-15 22:18:51 +00:00
|
|
|
+ lib.optionalString doCheck " --enable-tests";
|
2020-04-24 23:36:52 +00:00
|
|
|
buildPhase = "ocaml setup.ml -build";
|
|
|
|
inherit doCheck;
|
|
|
|
checkPhase = "ocaml setup.ml -test";
|
|
|
|
installPhase = "ocaml setup.ml -install";
|
|
|
|
|
|
|
|
createFindlibDestdir = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/rgrinberg/stringext";
|
|
|
|
platforms = ocaml.meta.platforms or [];
|
|
|
|
description = "Extra string functions for OCaml";
|
2021-01-15 22:18:51 +00:00
|
|
|
license = lib.licenses.mit;
|
|
|
|
maintainers = with lib.maintainers; [ vbgl ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|