<commit_before>{ lib, stdenv, ocaml, findlib, dune_1, dune_2 }:

{ pname, version, buildInputs ? [], enableParallelBuilding ? true, ... }@args:

let Dune = if args.useDune2 or false then dune_2 else dune_1; in

if args ? minimumOCamlVersion &&
   ! lib.versionAtLeast ocaml.version args.minimumOCamlVersion
then throw "${pname}-${version} is not available for OCaml ${ocaml.version}"
else

stdenv.mkDerivation ({

  inherit enableParallelBuilding;

  buildPhase = ''
    runHook preBuild
    dune build -p ${pname} ''${enableParallelBuilding:+-j $NIX_BUILD_CORES}
    runHook postBuild
  '';
  checkPhase = ''
    runHook preCheck
    dune runtest -p ${pname} ''${enableParallelBuilding:+-j $NIX_BUILD_CORES}
    runHook postCheck
  '';
  installPhase = ''
    runHook preInstall
    dune install --prefix $out --libdir $OCAMLFIND_DESTDIR ${pname}
    runHook postInstall
  '';

} // args // {

  name = "ocaml${ocaml.version}-${pname}-${version}";

  buildInputs = [ ocaml Dune findlib ] ++ buildInputs;

  meta = (args.meta or {}) // { platforms = args.meta.platforms or ocaml.meta.platforms; };

})<commit_msg>build-support.ocaml.dune: handle minimalOCamlVersion typo<commit_after>{ lib, stdenv, ocaml, findlib, dune_1, dune_2 }:

{ pname, version, buildInputs ? [], enableParallelBuilding ? true, ... }@args:

let Dune = if args.useDune2 or false then dune_2 else dune_1; in

if (args ? minimumOCamlVersion && ! lib.versionAtLeast ocaml.version args.minimumOCamlVersion) ||
   (args ? minimalOCamlVersion && ! lib.versionAtLeast ocaml.version args.minimalOCamlVersion)
then throw "${pname}-${version} is not available for OCaml ${ocaml.version}"
else

stdenv.mkDerivation ({

  inherit enableParallelBuilding;

  buildPhase = ''
    runHook preBuild
    dune build -p ${pname} ''${enableParallelBuilding:+-j $NIX_BUILD_CORES}
    runHook postBuild
  '';
  checkPhase = ''
    runHook preCheck
    dune runtest -p ${pname} ''${enableParallelBuilding:+-j $NIX_BUILD_CORES}
    runHook postCheck
  '';
  installPhase = ''
    runHook preInstall
    dune install --prefix $out --libdir $OCAMLFIND_DESTDIR ${pname}
    runHook postInstall
  '';

} // (builtins.removeAttrs args [ "minimalOCamlVersion" ]) // {

  name = "ocaml${ocaml.version}-${pname}-${version}";

  buildInputs = [ ocaml Dune findlib ] ++ buildInputs;

  meta = (args.meta or {}) // { platforms = args.meta.platforms or ocaml.meta.platforms; };

})
{'fraction_non_alphanumeric': 0.13658940397350994, 'fraction_numerical': 0.0041390728476821195, 'mean_word_length': 4.014522821576763, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3377549', 'n_tokens_mistral': 855, 'n_tokens_neox': 842, 'n_words': 194}