<commit_before>{ stdenv, fetchurl, pkgconfig, libuuid, gettext }:

stdenv.mkDerivation rec {
  name = "e2fsprogs-1.43.4";

  src = fetchurl {
    url = "mirror://sourceforge/e2fsprogs/${name}.tar.gz";
    sha256 = "a648a90a513f1b25113c7f981af978b8a19f832b3a32bd10707af3ff682ba66d";
  };

  outputs = [ "bin" "dev" "out" "man" ];

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [ libuuid gettext ];

  crossAttrs = {
    preConfigure = ''
      export CC=$crossConfig-gcc
    '';
  };

  configureFlags =
    if stdenv.isLinux then [
      "--enable-elf-shlibs" "--enable-symlink-install" "--enable-relative-symlinks"
      # libuuid, libblkid, uuidd and fsck are in util-linux-ng (the "libuuid" dependency).
      "--disable-libuuid" "--disable-uuidd" "--disable-libblkid" "--disable-fsck"
    ] else [
      "--enable-libuuid --disable-e2initrd-helper"
    ]
  ;

  # hacky way to make it install *.pc
  postInstall = ''<commit_msg>e2fsprogs: avoid larger rebuild on Linux<commit_after>{ stdenv, fetchurl, pkgconfig, libuuid, gettext }:

stdenv.mkDerivation rec {
  name = "e2fsprogs-1.43.4";

  src = fetchurl {
    url = "mirror://sourceforge/e2fsprogs/${name}.tar.gz";
    sha256 = "a648a90a513f1b25113c7f981af978b8a19f832b3a32bd10707af3ff682ba66d";
  };

  outputs = [ "bin" "dev" "out" "man" ];

  nativeBuildInputs = [ pkgconfig ];
  buildInputs = [ libuuid ] ++ stdenv.lib.optional (!stdenv.isLinux) gettext;

  crossAttrs = {
    preConfigure = ''
      export CC=$crossConfig-gcc
    '';
  };

  configureFlags =
    if stdenv.isLinux then [
      "--enable-elf-shlibs" "--enable-symlink-install" "--enable-relative-symlinks"
      # libuuid, libblkid, uuidd and fsck are in util-linux-ng (the "libuuid" dependency).
      "--disable-libuuid" "--disable-uuidd" "--disable-libblkid" "--disable-fsck"
    ] else [
      "--enable-libuuid --disable-e2initrd-helper"
    ]
  ;

  # hacky way to make it install *.pc
  postInstall = ''
{'fraction_non_alphanumeric': 0.1526207605344296, 'fraction_numerical': 0.052929085303186026, 'mean_word_length': 3.107594936708861, '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': '6192256', 'n_tokens_mistral': 796, 'n_tokens_neox': 725, 'n_words': 133}