1{ lib, fetchurl, buildDunePackage, ocaml, ounit, seq }:
2
3let version_sha = if lib.versionAtLeast ocaml.version "4.08"
4 then
5 {
6 version = "1.11.0";
7 sha256 = "sha256-AfwkR4DA9r5yrnlrH7dQ82feGGJP110H7nl4LtbfjU8=";
8 }
9 else
10 {
11 version = "1.9.0";
12 sha256 = "1gas4ky49zgxph3870nffzkr6y41kkpqp4nj38pz1gh49zcf12aj";
13 };
14in
15
16buildDunePackage rec {
17 pname = "re";
18 version = version_sha.version;
19
20 minimalOCamlVersion = "4.02";
21
22 src = fetchurl {
23 url = "https://github.com/ocaml/ocaml-re/releases/download/${version}/re-${version}.tbz";
24 sha256 = version_sha.sha256;
25 };
26
27 buildInputs = lib.optional doCheck ounit;
28 propagatedBuildInputs = [ seq ];
29 doCheck = lib.versionAtLeast ocaml.version "4.08";
30
31 meta = {
32 homepage = "https://github.com/ocaml/ocaml-re";
33 description = "Pure OCaml regular expressions, with support for Perl and POSIX-style strings";
34 license = lib.licenses.lgpl2;
35 maintainers = with lib.maintainers; [ vbgl ];
36 };
37}