<commit_before>{ haskellPackages, fetchpatch, haskell, removeReferencesTo }:

let
  static = haskell.lib.compose.justStaticExecutables haskellPackages.pandoc;

in
  (haskell.lib.compose.overrideCabal (drv: {
    configureFlags = drv.configureFlags or [] ++ ["-fembed_data_files"];
    buildDepends = drv.buildDepends or [] ++ [haskellPackages.file-embed];
    buildTools = (drv.buildTools or []) ++ [ removeReferencesTo ];

    postInstall = drv.postInstall or "" + ''
      remove-references-to \
        -t ${haskellPackages.pandoc-types} \
        $out/bin/pandoc
      remove-references-to \
        -t ${haskellPackages.HTTP} \
        $out/bin/pandoc
    '';
  }) static).overrideAttrs (drv: {
    # These libraries are still referenced, because they generate
    # a `Paths_*` module for figuring out their version.
    # The `Paths_*` module is generated by Cabal, and contains the
    # version, but also paths to e.g. the data directories, which
    # lead to a transitive runtime dependency on the whole GHC distribution.
    # This should ideally be fixed in haskellPackages (or even Cabal),
    # but a minimal pandoc is important enough to patch it manually.
    disallowedReferences = [ haskellPackages.pandoc-types haskellPackages.HTTP ];
  })<commit_msg>pandoc: don't use remove-references-to with haskellPackages.HTTP<commit_after>{ haskellPackages, fetchpatch, haskell, removeReferencesTo }:

let
  static = haskell.lib.compose.justStaticExecutables haskellPackages.pandoc;

in
  (haskell.lib.compose.overrideCabal (drv: {
    configureFlags = drv.configureFlags or [] ++ ["-fembed_data_files"];
    buildDepends = drv.buildDepends or [] ++ [haskellPackages.file-embed];
    buildTools = (drv.buildTools or []) ++ [ removeReferencesTo ];

    postInstall = drv.postInstall or "" + ''
      remove-references-to \
        -t ${haskellPackages.pandoc-types} \
        $out/bin/pandoc
    '';
  }) static).overrideAttrs (drv: {
    # These libraries are still referenced, because they generate
    # a `Paths_*` module for figuring out their version.
    # The `Paths_*` module is generated by Cabal, and contains the
    # version, but also paths to e.g. the data directories, which
    # lead to a transitive runtime dependency on the whole GHC distribution.
    # This should ideally be fixed in haskellPackages (or even Cabal),
    # but a minimal pandoc is important enough to patch it manually.
    disallowedReferences = [ haskellPackages.pandoc-types ];
  })
{'fraction_non_alphanumeric': 0.1031426269137792, 'fraction_numerical': 0.0, 'mean_word_length': 3.5063520871143377, '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': '7138028', 'n_tokens_mistral': 778, 'n_tokens_neox': 757, 'n_words': 216}