1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-19 04:02:10 +00:00
nixpkgs/pkgs/build-support/ocaml/topkg.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
827 B
Nix
Raw Normal View History

{ 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;
};
})