2018-09-05 09:11:47 -07:00
|
|
|
{ stdenv, fetchzip, ocaml, findlib, dune, ounit, seq }:
|
2018-06-24 02:20:13 -07:00
|
|
|
|
|
|
|
if !stdenv.lib.versionAtLeast ocaml.version "4.02"
|
|
|
|
then throw "re is not available for OCaml ${ocaml.version}"
|
|
|
|
else
|
2015-01-07 04:56:38 -08:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2018-06-24 02:20:13 -07:00
|
|
|
name = "ocaml${ocaml.version}-re-${version}";
|
2018-09-05 10:14:47 -07:00
|
|
|
version = "1.8.0";
|
2015-01-07 04:56:38 -08:00
|
|
|
|
2015-03-19 11:13:39 -07:00
|
|
|
src = fetchzip {
|
2017-10-17 05:52:22 -07:00
|
|
|
url = "https://github.com/ocaml/ocaml-re/archive/${version}.tar.gz";
|
2018-09-05 10:14:47 -07:00
|
|
|
sha256 = "0ch6hvmm4ym3w2vghjxf3ka5j1023a37980fqi4zcb7sx756z20i";
|
2015-01-07 04:56:38 -08:00
|
|
|
};
|
|
|
|
|
2018-09-05 09:11:47 -07:00
|
|
|
buildInputs = [ ocaml findlib dune ounit ];
|
2018-09-05 10:14:47 -07:00
|
|
|
propagatedBuildInputs = [ seq ];
|
2015-01-07 04:56:38 -08:00
|
|
|
|
2018-06-24 02:20:13 -07:00
|
|
|
doCheck = true;
|
|
|
|
checkPhase = "jbuilder runtest";
|
2015-01-07 04:56:38 -08:00
|
|
|
|
2018-09-05 09:11:47 -07:00
|
|
|
inherit (dune) installPhase;
|
2015-01-07 04:56:38 -08:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = https://github.com/ocaml/ocaml-re;
|
2015-12-24 09:49:07 -08:00
|
|
|
platforms = ocaml.meta.platforms or [];
|
2015-01-07 04:56:38 -08: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 ];
|
|
|
|
};
|
|
|
|
}
|