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