1 { stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg }:
4 # Use astring 0.8.3 for OCaml < 4.05
6 if lib.versionAtLeast ocaml.version "4.05"
9 sha256 = "1ykhg9gd3iy7zsgyiy2p9b1wkpqg9irw5pvcqs3sphq71iir4ml6";
12 sha256 = "0ixjwc3plrljvj24za3l9gy0w30lsbggp8yh02lwrzw61ls4cri0";
17 pname = "ocaml${ocaml.version}-astring";
18 inherit (param) version;
21 url = "https://erratique.ch/software/astring/releases/astring-${param.version}.tbz";
22 inherit (param) sha256;
25 nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
26 buildInputs = [ topkg ];
30 inherit (topkg) buildPhase installPhase;
33 homepage = "https://erratique.ch/software/astring";
34 description = "Alternative String module for OCaml";
36 Astring exposes an alternative String module for OCaml. This module tries
37 to balance minimality and expressiveness for basic, index-free, string
38 processing and provides types and functions for substrings, string sets
41 Remaining compatible with the OCaml String module is a non-goal.
42 The String module exposed by Astring has exception safe functions, removes
43 deprecated and rarely used functions, alters some signatures and names,
44 adds a few missing functions and fully exploits OCaml's newfound string
47 license = lib.licenses.isc;
48 maintainers = with lib.maintainers; [ sternenseemann ];