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