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