1{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, opam }:
2
3let
4 pname = "cmdliner";
5in
6
7assert stdenv.lib.versionAtLeast ocaml.version "3.12";
8
9stdenv.mkDerivation rec {
10
11 name = "ocaml-${pname}-${version}";
12 version = "0.9.8";
13
14 src = fetchurl {
15 url = "http://erratique.ch/software/${pname}/releases/${pname}-${version}.tbz";
16 sha256 = "0hdxlkgiwjml9dpaa80282a8350if7mc1m6yz2mrd7gci3fszykx";
17 };
18
19 unpackCmd = "tar xjf $src";
20 nativeBuildInputs = [ ocamlbuild opam ];
21 buildInputs = [ ocaml findlib ];
22
23 createFindlibDestdir = true;
24
25 configurePhase = "ocaml pkg/git.ml";
26 buildPhase = "ocaml pkg/build.ml native=true native-dynlink=true";
27 installPhase = ''
28 opam-installer --script --prefix=$out | sh
29 ln -s $out/lib/${pname} $out/lib/ocaml/${ocaml.version}/site-lib/
30 '';
31
32 meta = with stdenv.lib; {
33 homepage = http://erratique.ch/software/cmdliner;
34 description = "An OCaml module for the declarative definition of command line interfaces";
35 license = licenses.bsd3;
36 platforms = ocaml.meta.platforms or [];
37 maintainers = [ maintainers.vbgl ];
38 };
39}