1{
2 lib,
3 fetchurl,
4 buildDunePackage,
5 ocaml,
6 ounit,
7 ounit2,
8 seq,
9}:
10
11let
12 version_sha =
13 if lib.versionAtLeast ocaml.version "4.12" then
14 {
15 version = "1.12.0";
16 hash = "sha256-oB8r8i9ywvSrq9jT52NeNcG/a8WkGtbVoAdFTdq60dQ=";
17 }
18 else if lib.versionAtLeast ocaml.version "4.08" then
19 {
20 version = "1.11.0";
21 hash = "sha256-AfwkR4DA9r5yrnlrH7dQ82feGGJP110H7nl4LtbfjU8=";
22 }
23 else
24 {
25 version = "1.9.0";
26 hash = "sha256:1gas4ky49zgxph3870nffzkr6y41kkpqp4nj38pz1gh49zcf12aj";
27 };
28in
29
30buildDunePackage rec {
31 pname = "re";
32 version = version_sha.version;
33
34 minimalOCamlVersion = "4.02";
35
36 src = fetchurl {
37 url = "https://github.com/ocaml/ocaml-re/releases/download/${version}/re-${version}.tbz";
38 inherit (version_sha) hash;
39 };
40
41 propagatedBuildInputs = [ seq ];
42 doCheck = lib.versionAtLeast ocaml.version "4.08";
43 checkInputs = [ (if lib.versionAtLeast version "1.12" then ounit2 else ounit) ];
44
45 meta = {
46 homepage = "https://github.com/ocaml/ocaml-re";
47 description = "Pure OCaml regular expressions, with support for Perl and POSIX-style strings";
48 license = lib.licenses.lgpl2;
49 maintainers = with lib.maintainers; [ vbgl ];
50 };
51}