1 { lib, stdenv, fetchurl, ocaml, findlib, topkg, ocamlbuild, cmdliner, odoc, b0
4 { pname, version, nativeBuildInputs ? [ ], buildInputs ? [ ], ... }@args:
6 lib.throwIf (args ? minimalOCamlVersion
7 && lib.versionOlder ocaml.version args.minimalOCamlVersion)
8 "${pname}-${version} is not available for OCaml ${ocaml.version}"
10 stdenv.mkDerivation ({
12 dontAddStaticConfigureFlags = true;
13 configurePlatforms = [ ];
15 inherit (topkg) buildPhase installPhase;
17 } // (builtins.removeAttrs args [ "minimalOCamlVersion" ]) // {
19 name = "ocaml${ocaml.version}-${pname}-${version}";
21 nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ] ++ nativeBuildInputs;
22 buildInputs = [ topkg ] ++ buildInputs;
24 meta = (args.meta or { }) // {
25 platforms = args.meta.platforms or ocaml.meta.platforms;