<commit_before>{ stdenv, fetchzip, pkgconfig, ncurses, libev, jbuilder
, ocaml, findlib, camlp4, cppo
, ocaml-migrate-parsetree, ppx_tools_versioned, result
}:

stdenv.mkDerivation rec {
  version = "3.3.0";
  name = "ocaml${ocaml.version}-lwt-${version}";

  src = fetchzip {
    url = "https://github.com/ocsigen/lwt/archive/${version}.tar.gz";
    sha256 = "0n87hcyl4svy0risj439wyfq6bl77qxq3nraqgdr1qbz5lskbq2j";
  };

  preConfigure = ''
    ocaml src/util/configure.ml -use-libev true -use-camlp4 true
  '';

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [ ncurses ocaml findlib jbuilder camlp4 cppo
    ocaml-migrate-parsetree ppx_tools_versioned ];
  propagatedBuildInputs = [ libev result ];

  installPhase = ''<commit_msg>ocamlPackages.lwt3: make dependency to camlp4 optional<commit_after>{ stdenv, fetchzip, pkgconfig, ncurses, libev, jbuilder
, ocaml, findlib, cppo
, ocaml-migrate-parsetree, ppx_tools_versioned, result
, withP4 ? !stdenv.lib.versionAtLeast ocaml.version "4.07"
, camlp4 ? null
}:

stdenv.mkDerivation rec {
  version = "3.3.0";
  name = "ocaml${ocaml.version}-lwt-${version}";

  src = fetchzip {
    url = "https://github.com/ocsigen/lwt/archive/${version}.tar.gz";
    sha256 = "0n87hcyl4svy0risj439wyfq6bl77qxq3nraqgdr1qbz5lskbq2j";
  };

  preConfigure = ''
    ocaml src/util/configure.ml -use-libev true -use-camlp4 ${if withP4 then "true" else "false"}
  '';

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [ ncurses ocaml findlib jbuilder cppo
    ocaml-migrate-parsetree ppx_tools_versioned ]
  ++ stdenv.lib.optional withP4 camlp4;
  propagatedBuildInputs = [ libev result ];

  installPhase = ''
{'fraction_non_alphanumeric': 0.13022410660205935, 'fraction_numerical': 0.03391883706844337, 'mean_word_length': 4.329032258064516, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, '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': '3623037', 'n_tokens_mistral': 685, 'n_tokens_neox': 661, 'n_words': 113}