about summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/astring/default.nix
blob: 3c603b659a200c14205231c49ecf0a0962906ef9 (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
40
41
42
43
{stdenv, fetchurl, buildOcaml, ocaml, findlib, ocamlbuild, topkg, opam}:

buildOcaml rec {
  version = "0.8.3";
  name = "astring";

  src = fetchurl {
    url = "http://erratique.ch/software/astring/releases/astring-${version}.tbz";
    sha256 = "0ixjwc3plrljvj24za3l9gy0w30lsbggp8yh02lwrzw61ls4cri0";
  };

  unpackCmd = "tar -xf $curSrc";

  buildInputs = [ ocaml findlib ocamlbuild topkg opam ];

  buildPhase = ''
    ocaml -I ${findlib}/lib/ocaml/${ocaml.version}/site-lib/ pkg/pkg.ml build
  '';

  installPhase = ''
    opam-installer --script --prefix=$out astring.install | sh
    ln -s $out/lib/astring $out/lib/ocaml/${ocaml.version}/site-lib/
  '';

  meta = {
    homepage = http://erratique.ch/software/ptime;
    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.
    '';
    license = stdenv.lib.licenses.isc;
    maintainers = with stdenv.lib.maintainers; [ sternenseemann ];
  };
}