@@ -0,0 +1,43 @@
1+{stdenv, fetchurl, buildOcaml, ocaml, findlib, ocamlbuild, topkg, opam}:
2+
3+buildOcaml rec {
4+ version = "0.8.3";
5+ name = "astring";
6+
7+ src = fetchurl {
8+ url = "http://erratique.ch/software/astring/releases/astring-${version}.tbz";
9+ sha256 = "0ixjwc3plrljvj24za3l9gy0w30lsbggp8yh02lwrzw61ls4cri0";
10+ };
11+
12+ unpackCmd = "tar -xf $curSrc";
13+
14+ buildInputs = [ ocaml findlib ocamlbuild topkg opam ];
15+
16+ buildPhase = ''
17+ ocaml -I ${findlib}/lib/ocaml/${ocaml.version}/site-lib/ pkg/pkg.ml build
18+ '';
19+
20+ installPhase = ''
21+ opam-installer --script --prefix=$out astring.install | sh
22+ ln -s $out/lib/astring $out/lib/ocaml/${ocaml.version}/site-lib/
23+ '';
24+
25+ meta = {
26+ homepage = http://erratique.ch/software/astring;
27+ description = "Alternative String module for OCaml";
28+ longDescription = ''
29+ Astring exposes an alternative String module for OCaml. This module tries
30+ to balance minimality and expressiveness for basic, index-free, string
31+ processing and provides types and functions for substrings, string sets
32+ and string maps.
33+
34+ Remaining compatible with the OCaml String module is a non-goal.
35+ The String module exposed by Astring has exception safe functions, removes
36+ deprecated and rarely used functions, alters some signatures and names,
37+ adds a few missing functions and fully exploits OCaml's newfound string
38+ immutability.
39+ '';
40+ license = stdenv.lib.licenses.isc;
41+ maintainers = with stdenv.lib.maintainers; [ sternenseemann ];
42+ };
43+}