2021-01-11 13:49:15 +01:00
|
|
|
{ stdenv, lib, fetchurl, ocaml, findlib, ocamlbuild, topkg }:
|
2016-11-03 02:12:14 +01:00
|
|
|
|
2020-12-02 12:53:55 +01:00
|
|
|
let
|
|
|
|
# Use astring 0.8.3 for OCaml < 4.05
|
|
|
|
param =
|
2021-01-11 13:49:15 +01:00
|
|
|
if lib.versionAtLeast ocaml.version "4.05"
|
2020-12-02 12:53:55 +01:00
|
|
|
then {
|
|
|
|
version = "0.8.5";
|
|
|
|
sha256 = "1ykhg9gd3iy7zsgyiy2p9b1wkpqg9irw5pvcqs3sphq71iir4ml6";
|
|
|
|
} else {
|
|
|
|
version = "0.8.3";
|
|
|
|
sha256 = "0ixjwc3plrljvj24za3l9gy0w30lsbggp8yh02lwrzw61ls4cri0";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2022-02-10 01:28:00 +01:00
|
|
|
pname = "ocaml${ocaml.version}-astring";
|
2020-12-02 12:53:55 +01:00
|
|
|
inherit (param) version;
|
2016-11-03 02:12:14 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2020-12-02 12:53:55 +01:00
|
|
|
url = "https://erratique.ch/software/astring/releases/astring-${param.version}.tbz";
|
|
|
|
inherit (param) sha256;
|
2016-11-03 02:12:14 +01:00
|
|
|
};
|
|
|
|
|
2022-02-22 10:59:04 +01:00
|
|
|
nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ];
|
|
|
|
buildInputs = [ topkg ];
|
|
|
|
|
|
|
|
strictDeps = true;
|
2016-11-03 02:12:14 +01:00
|
|
|
|
2017-12-14 08:36:29 +01:00
|
|
|
inherit (topkg) buildPhase installPhase;
|
2016-11-03 02:12:14 +01:00
|
|
|
|
|
|
|
meta = {
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://erratique.ch/software/astring";
|
2016-11-03 02:12:14 +01:00
|
|
|
description = "Alternative String module for OCaml";
|
|
|
|
longDescription = ''
|
|
|
|
Astring exposes an alternative String module for OCaml. This module tries
|
|
|
|
to balance minimality and expressiveness for basic, index-free, string
|
|
|
|
processing and provides types and functions for substrings, string sets
|
|
|
|
and string maps.
|
|
|
|
|
|
|
|
Remaining compatible with the OCaml String module is a non-goal.
|
|
|
|
The String module exposed by Astring has exception safe functions, removes
|
|
|
|
deprecated and rarely used functions, alters some signatures and names,
|
|
|
|
adds a few missing functions and fully exploits OCaml's newfound string
|
|
|
|
immutability.
|
|
|
|
'';
|
2021-01-11 13:49:15 +01:00
|
|
|
license = lib.licenses.isc;
|
|
|
|
maintainers = with lib.maintainers; [ sternenseemann ];
|
2016-11-03 02:12:14 +01:00
|
|
|
};
|
|
|
|
}
|