@@ -0,0 +1,34 @@
1+{ stdenv, fetchzip, ocaml, findlib, obuild }:
2+
3+let version = "2.0.1"; in
4+
5+stdenv.mkDerivation {
6+ name = "ocaml${ocaml.version}-ptmap-${version}";
7+
8+ src = fetchzip {
9+ url = "https://github.com/UnixJunkie/ptmap/archive/v${version}.tar.gz";
10+ sha256 = "09ib4q5amkac2yy0hr7yn1n1j6y10v08chh82qc70wl7s473if15";
11+ };
12+
13+ buildInputs = [ ocaml findlib obuild ];
14+
15+ createFindlibDestdir = true;
16+
17+ buildPhase = ''
18+ substituteInPlace ptmap.obuild --replace 'build-deps: qcheck' ""
19+ obuild configure
20+ obuild build lib-ptmap
21+ '';
22+
23+ installPhase = ''
24+ obuild install --destdir $out/lib/ocaml/${ocaml.version}/site-lib
25+ '';
26+
27+ meta = {
28+ homepage = https://www.lri.fr/~filliatr/software.en.html;
29+ platforms = ocaml.meta.platforms or [];
30+ description = "Maps over integers implemented as Patricia trees";
31+ license = stdenv.lib.licenses.lgpl21;
32+ maintainers = with stdenv.lib.maintainers; [ volth ];
33+ };
34+}