<commit_before>{stdenv, menhir, easy-format, buildOcaml, fetchurl, which}:

buildOcaml rec {
  name = "atd";
  version = "1.1.2";

  src = fetchurl {
    url = "https://github.com/mjambon/atd/archive/v${version}.tar.gz";
    sha256 = "0ef10c63192aed75e9a4274e89c5f9ca27efb1ef230d9949eda53ad4a9a37291";
  };

  installPhase = ''
    mkdir -p $out/bin
    make PREFIX=$out install
  '';

  buildInputs = [ which ];
  propagatedBuildInputs = [ menhir easy-format ];

  meta = with stdenv.lib; {
    homepage = https://github.com/mjambon/atd;
    description = "Syntax for cross-language type definitions";
    license = licenses.bsd3;
    maintainers = [ maintainers.jwilberding ];
  };
}<commit_msg>ocamlPackages.atd: 1.1.2 -> 1.12.0<commit_after>{ stdenv, menhir, easy-format, ocaml, findlib, fetchurl, jbuilder, which }:

let param =
  if stdenv.lib.versionAtLeast ocaml.version "4.02"
  then {
    version = "1.12.0";
    sha256 = "1pcd4fqbilv8zm2mc1nj2s26vc5y8vnisg1q1y6bjx23wxidb09y";
    buildPhase = "jbuilder build -p atd";
    inherit (jbuilder) installPhase;
  } else {
    version = "1.1.2";
    sha256 = "0ef10c63192aed75e9a4274e89c5f9ca27efb1ef230d9949eda53ad4a9a37291";
    buildPhase = "";
    installPhase = ''
      mkdir -p $out/bin
      make PREFIX=$out install
    '';
  };
in

stdenv.mkDerivation rec {
  inherit (param) version buildPhase installPhase;
  name = "ocaml${ocaml.version}-atd-${version}";

  src = fetchurl {
    url = "https://github.com/mjambon/atd/archive/v${version}.tar.gz";
    inherit (param) sha256;
  };

  createFindlibDestdir = true;

  buildInputs = [ which jbuilder ocaml findlib menhir ];
  propagatedBuildInputs = [ easy-format ];

  meta = with stdenv.lib; {
    homepage = https://github.com/mjambon/atd;
    description = "Syntax for cross-language type definitions";
    license = licenses.bsd3;
    maintainers = [ maintainers.jwilberding ];
  };
}
{'fraction_non_alphanumeric': 0.13354363827549948, 'fraction_numerical': 0.06677181913774974, 'mean_word_length': 3.509478672985782, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, 'https://': 4, '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': '4731426', 'n_tokens_mistral': 796, 'n_tokens_neox': 727, 'n_words': 130}