summary refs log tree commit diff
path: root/pkgs/development/ocaml-modules/ptmap/default.nix
blob: d6637d23052ce1a04feb0ddcbacb3889250ed19c (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, fetchzip, ocaml, findlib, obuild }:

let param =
  if stdenv.lib.versionAtLeast ocaml.version "4.07"
  then {
    version = "2.0.4";
    sha256 = "05a391m1l04zigi6ghywj7f5kxy2w6186221k7711wmg56m94yjw";
  } else {
    version = "2.0.3";
    sha256 = "19xykhqk7q25r1pj8rpfj53j2r9ls8mxi1w5m2wqshrf20gf078h";
  }
; in

stdenv.mkDerivation {
  name = "ocaml${ocaml.version}-ptmap-${param.version}";

  src = fetchzip {
    url = "https://github.com/backtracking/ptmap/archive/v${param.version}.tar.gz";
    inherit (param) sha256;
  };

  buildInputs = [ ocaml findlib obuild ];

  createFindlibDestdir = true;

  buildPhase = ''
    substituteInPlace ptmap.obuild --replace 'build-deps: qcheck' ""
    obuild configure
    obuild build lib-ptmap
  '';

  installPhase = ''
    obuild install --destdir $out/lib/ocaml/${ocaml.version}/site-lib
  '';

  meta = {
    homepage = https://www.lri.fr/~filliatr/software.en.html;
    platforms = ocaml.meta.platforms or [];
    description = "Maps over integers implemented as Patricia trees";
    license = stdenv.lib.licenses.lgpl21;
    maintainers = with stdenv.lib.maintainers; [ volth ];
  };
}