2018-06-24 09:20:13 +00:00
|
|
|
{ stdenv, fetchzip, ocaml, findlib, jbuilder, ounit }:
|
|
|
|
|
|
|
|
if !stdenv.lib.versionAtLeast ocaml.version "4.02"
|
|
|
|
then throw "re is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
2015-01-07 12:56:38 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2018-06-24 09:20:13 +00:00
|
|
|
name = "ocaml${ocaml.version}-re-${version}";
|
|
|
|
version = "1.7.3";
|
2015-01-07 12:56:38 +00:00
|
|
|
|
2015-03-19 18:13:39 +00:00
|
|
|
src = fetchzip {
|
2017-10-17 12:52:22 +00:00
|
|
|
url = "https://github.com/ocaml/ocaml-re/archive/${version}.tar.gz";
|
2018-06-24 09:20:13 +00:00
|
|
|
sha256 = "1pb6w9wqg6gzcfaaw6ckv1bqjgjpmrzzqz7r0mp9w16qbf3i54zr";
|
2015-01-07 12:56:38 +00:00
|
|
|
};
|
|
|
|
|
2018-06-24 09:20:13 +00:00
|
|
|
buildInputs = [ ocaml findlib jbuilder ounit ];
|
2015-01-07 12:56:38 +00:00
|
|
|
|
2018-06-24 09:20:13 +00:00
|
|
|
doCheck = true;
|
|
|
|
checkPhase = "jbuilder runtest";
|
2015-01-07 12:56:38 +00:00
|
|
|
|
2018-06-24 09:20:13 +00:00
|
|
|
inherit (jbuilder) installPhase;
|
2015-01-07 12:56:38 +00:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = https://github.com/ocaml/ocaml-re;
|
2015-12-24 17:49:07 +00:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2015-01-07 12:56:38 +00:00
|
|
|
description = "Pure OCaml regular expressions, with support for Perl and POSIX-style strings";
|
|
|
|
license = stdenv.lib.licenses.lgpl2;
|
|
|
|
maintainers = with stdenv.lib.maintainers; [ vbgl ];
|
|
|
|
};
|
|
|
|
}
|