Luke Granger-Brown
57725ef3ec
git-subtree-dir: third_party/nixpkgs git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
28 lines
827 B
Nix
28 lines
827 B
Nix
{ lib, stdenv, fetchurl, ocaml, findlib, topkg, ocamlbuild, cmdliner, odoc, b0
|
|
}:
|
|
|
|
{ pname, version, nativeBuildInputs ? [ ], buildInputs ? [ ], ... }@args:
|
|
|
|
lib.throwIf (args ? minimalOCamlVersion
|
|
&& lib.versionOlder ocaml.version args.minimalOCamlVersion)
|
|
"${pname}-${version} is not available for OCaml ${ocaml.version}"
|
|
|
|
stdenv.mkDerivation ({
|
|
|
|
dontAddStaticConfigureFlags = true;
|
|
configurePlatforms = [ ];
|
|
strictDeps = true;
|
|
inherit (topkg) buildPhase installPhase;
|
|
|
|
} // (builtins.removeAttrs args [ "minimalOCamlVersion" ]) // {
|
|
|
|
name = "ocaml${ocaml.version}-${pname}-${version}";
|
|
|
|
nativeBuildInputs = [ ocaml findlib ocamlbuild topkg ] ++ nativeBuildInputs;
|
|
buildInputs = [ topkg ] ++ buildInputs;
|
|
|
|
meta = (args.meta or { }) // {
|
|
platforms = args.meta.platforms or ocaml.meta.platforms;
|
|
};
|
|
|
|
})
|