<commit_before>{ fetchurl, stdenv }:

let
  name = "antiword-0.37";
in
stdenv.mkDerivation {
  inherit name;

  src = fetchurl {
    url = "http://www.winfield.demon.nl/linux/${name}.tar.gz";
    sha256 = "1b7mi1l20jhj09kyh0bq14qzz8vdhhyf35gzwsq43mn6rc7h0b4f";
  };

  preInstall = ''
    sed -i -e "s|/usr/local/bin|$out/bin|g" -e "s|/usr/share|$out/share|g" Makefile antiword.h
  '';

  patches = [ ./10_fix_buffer_overflow_wordole_c.patch ];

  installTargets = "global_install";

  meta = {
    homepage = "http://www.winfield.demon.nl/";
    description = "Convert MS Word documents to plain text or PostScript";
    license = stdenv.lib.licenses.gpl2;

    maintainers = [ stdenv.lib.maintainers.peti ];
    platforms = stdenv.lib.platforms.linux;
  };
}
<commit_msg>antiword: move sed to prePatch. fixes #18627<commit_after>{ fetchurl, stdenv }:

let
  name = "antiword-0.37";
in
stdenv.mkDerivation {
  inherit name;

  src = fetchurl {
    url = "http://www.winfield.demon.nl/linux/${name}.tar.gz";
    sha256 = "1b7mi1l20jhj09kyh0bq14qzz8vdhhyf35gzwsq43mn6rc7h0b4f";
  };

  prePatch = ''
    sed -i -e "s|/usr/local/bin|$out/bin|g" -e "s|/usr/share|$out/share|g" Makefile antiword.h
  '';

  patches = [ ./10_fix_buffer_overflow_wordole_c.patch ];

  installTargets = "global_install";

  meta = {
    homepage = "http://www.winfield.demon.nl/";
    description = "Convert MS Word documents to plain text or PostScript";
    license = stdenv.lib.licenses.gpl2;

    maintainers = [ stdenv.lib.maintainers.peti ];
    platforms = stdenv.lib.platforms.linux;
  };
}

{'fraction_non_alphanumeric': 0.15174603174603174, 'fraction_numerical': 0.03873015873015873, 'mean_word_length': 3.4269662921348316, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, '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': '4764928', 'n_tokens_mistral': 671, 'n_tokens_neox': 638, 'n_words': 102}