nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 54 lines 970 B view raw
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 ocaml, 6 findlib, 7 topkg, 8 ocamlbuild, 9 cmdliner, 10 odoc, 11 b0, 12}: 13 14{ 15 pname, 16 version, 17 nativeBuildInputs ? [ ], 18 buildInputs ? [ ], 19 ... 20}@args: 21 22lib.throwIf (args ? minimalOCamlVersion && lib.versionOlder ocaml.version args.minimalOCamlVersion) 23 "${pname}-${version} is not available for OCaml ${ocaml.version}" 24 25 stdenv.mkDerivation 26 ( 27 { 28 29 dontAddStaticConfigureFlags = true; 30 configurePlatforms = [ ]; 31 strictDeps = true; 32 inherit (topkg) buildPhase installPhase; 33 34 } 35 // (builtins.removeAttrs args [ "minimalOCamlVersion" ]) 36 // { 37 38 name = "ocaml${ocaml.version}-${pname}-${version}"; 39 40 nativeBuildInputs = [ 41 ocaml 42 findlib 43 ocamlbuild 44 topkg 45 ] 46 ++ nativeBuildInputs; 47 buildInputs = [ topkg ] ++ buildInputs; 48 49 meta = (args.meta or { }) // { 50 platforms = args.meta.platforms or ocaml.meta.platforms; 51 }; 52 53 } 54 )