depot/third_party/nixpkgs/pkgs/development/ocaml-modules/re/default.nix
Default email c594a97518 Project import generated by Copybara.
GitOrigin-RevId: 301aada7a64812853f2e2634a530ef5d34505048
2022-10-21 20:38:19 +02:00

39 lines
1 KiB
Nix

{ 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";
useDune2 = lib.versionAtLeast ocaml.version "4.08";
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.04";
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 ];
};
}