summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/re/default.nix
blob: 5244aaf9edd054a82592d3c71036ee41df8db8fc (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{ lib, fetchurl, buildDunePackage, ocaml, ounit, seq }:

let version_sha = if lib.versionAtLeast ocaml.version "4.08"
  then
    {
      version = "1.10.4";
      sha256 = "sha256-g+s+QwCqmx3HggdJAQ9DYuqDUkdCEwUk14wgzpnKdHw=";
    }
  else
    {
      version = "1.9.0";
      sha256 = "1gas4ky49zgxph3870nffzkr6y41kkpqp4nj38pz1gh49zcf12aj";
    };
in

buildDunePackage (rec {
  pname = "re";
  version = version_sha.version;

  minimalOCamlVersion = "4.02";

  src = fetchurl {
    url = "https://github.com/ocaml/ocaml-re/releases/download/${version}/re-${version}.tbz";
    sha256 = version_sha.sha256;
  };

  buildInputs = lib.optional doCheck ounit;
  propagatedBuildInputs = [ seq ];
  doCheck = lib.versionAtLeast ocaml.version "4.08";

  meta = {
    homepage = "https://github.com/ocaml/ocaml-re";
    description = "Pure OCaml regular expressions, with support for Perl and POSIX-style strings";
    license = lib.licenses.lgpl2;
    maintainers = with lib.maintainers; [ vbgl ];
  };
} // lib.optionalAttrs (!lib.versionAtLeast ocaml.version "4.08") {
  duneVersion = "1";
})