<commit_before>{ fetchurl, stdenv, libtool, gettext, zlib, bzip2, flac, libvorbis
, exiv2, libgsf, rpm, pkgconfig
, gtkSupport ? true, glib ? null, gtk ? null
, videoSupport ? true, ffmpeg ? null, libmpeg2 ? null}:

assert gtkSupport -> glib != null && gtk != null;
assert videoSupport -> ffmpeg != null && libmpeg2 != null;

stdenv.mkDerivation rec {
  name = "libextractor-0.6.2";

  src = fetchurl {
    url = "mirror://gnu/libextractor/${name}.tar.gz";
    sha256 = "1pyh599717vjblyjch95r76afdxfhrzqr7nx1pz1davy5fpsw5aw";
  };

  preConfigure =
    '' echo "patching installation directory in \`extractor.c'..."
       sed -i "src/main/extractor.c" \
           -e "s|pexe[[:blank:]]*=.*$|pexe = strdup(\"$out/lib/\");|g"
    '';

  buildInputs =
   [ libtool gettext zlib bzip2 flac libvorbis libmpeg2 exiv2 ffmpeg
     libgsf rpm
     pkgconfig
   ] ++ stdenv.lib.optionals gtkSupport [ glib gtk ]
     ++ stdenv.lib.optionals videoSupport [ ffmpeg gtkSupport ];

  configureFlags = "--disable-ltdl-install "
    + "--with-ltdl-include=${libtool}/include "
    + "--with-ltdl-lib=${libtool}/lib "
    + "--enable-xpdf";

  # Checks need to be run after "make install", otherwise plug-ins are not in
  # the search path, etc.
  # FIXME: Tests currently fail and the test framework appears to be deeply
  # broken anyway.
  doCheck = false;
  #postInstall = "make check";

  meta = {
    description = "GNU libextractor, a simple library for keyword extraction";

    longDescription =
      '' GNU libextractor is a library used to extract meta-data from files
         of arbitrary type.  It is designed to use helper-libraries to perform
         the actual extraction, and to be trivially extendable by linking
         against external extractors for additional file types.

         The goal is to provide developers of file-sharing networks or
         WWW-indexing bots with a universal library to obtain simple keywords
         to match against queries.  libextractor contains a shell-command<commit_msg>libextractor: fixing the videoSupport = false<commit_after>{ fetchurl, stdenv, libtool, gettext, zlib, bzip2, flac, libvorbis
, exiv2, libgsf, rpm, pkgconfig
, gtkSupport ? true, glib ? null, gtk ? null
, videoSupport ? true, ffmpeg ? null, libmpeg2 ? null}:

assert gtkSupport -> glib != null && gtk != null;
assert videoSupport -> ffmpeg != null && libmpeg2 != null;

stdenv.mkDerivation rec {
  name = "libextractor-0.6.2";

  src = fetchurl {
    url = "mirror://gnu/libextractor/${name}.tar.gz";
    sha256 = "1pyh599717vjblyjch95r76afdxfhrzqr7nx1pz1davy5fpsw5aw";
  };

  preConfigure =
    '' echo "patching installation directory in \`extractor.c'..."
       sed -i "src/main/extractor.c" \
           -e "s|pexe[[:blank:]]*=.*$|pexe = strdup(\"$out/lib/\");|g"
    '';

  buildInputs =
   [ libtool gettext zlib bzip2 flac libvorbis exiv2
     libgsf rpm
     pkgconfig
   ] ++ stdenv.lib.optionals gtkSupport [ glib gtk ]
     ++ stdenv.lib.optionals videoSupport [ ffmpeg gtkSupport ];

  configureFlags = "--disable-ltdl-install "
    + "--with-ltdl-include=${libtool}/include "
    + "--with-ltdl-lib=${libtool}/lib "
    + "--enable-xpdf";

  # Checks need to be run after "make install", otherwise plug-ins are not in
  # the search path, etc.
  # FIXME: Tests currently fail and the test framework appears to be deeply
  # broken anyway.
  doCheck = false;
  #postInstall = "make check";

  meta = {
    description = "GNU libextractor, a simple library for keyword extraction";

    longDescription =
      '' GNU libextractor is a library used to extract meta-data from files
         of arbitrary type.  It is designed to use helper-libraries to perform
         the actual extraction, and to be trivially extendable by linking
         against external extractors for additional file types.

         The goal is to provide developers of file-sharing networks or
         WWW-indexing bots with a universal library to obtain simple keywords
         to match against queries.  libextractor contains a shell-command
{'fraction_non_alphanumeric': 0.10908193484698914, 'fraction_numerical': 0.014067127344521224, 'mean_word_length': 3.1357142857142857, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '7654366', 'n_tokens_mistral': 1335, 'n_tokens_neox': 1294, 'n_words': 401}