nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, topkg, result }:
2
3lib.throwIfNot (lib.versionAtLeast ocaml.version "4.08")
4 "cmdliner 1.1 is not available for OCaml ${ocaml.version}"
5
6stdenv.mkDerivation rec {
7 pname = "cmdliner";
8 version = "1.1.1";
9
10 src = fetchurl {
11 url = "https://erratique.ch/software/${pname}/releases/${pname}-${version}.tbz";
12 sha256 = "sha256-oa6Hw6eZQO+NHdWfdED3dtHckm4BmEbdMiAuRkYntfs=";
13 };
14
15 nativeBuildInputs = [ ocaml ];
16
17 makeFlags = [ "PREFIX=$(out)" ];
18 installTargets = "install install-doc";
19 installFlags = [
20 "LIBDIR=$(out)/lib/ocaml/${ocaml.version}/site-lib/${pname}"
21 "DOCDIR=$(out)/share/doc/${pname}"
22 ];
23 postInstall = ''
24 mv $out/lib/ocaml/${ocaml.version}/site-lib/${pname}/{opam,${pname}.opam}
25 '';
26
27 meta = with lib; {
28 homepage = "https://erratique.ch/software/cmdliner";
29 description = "An OCaml module for the declarative definition of command line interfaces";
30 license = licenses.isc;
31 inherit (ocaml.meta) platforms;
32 maintainers = [ maintainers.vbgl ];
33 };
34}