<commit_before>require 'formula'

class PopplerData < Formula
  url 'http://poppler.freedesktop.org/poppler-data-0.4.6.tar.gz'
  sha1 'f030563eed9f93912b1a546e6d87936d07d7f27d'
end

class Poppler < Formula
  homepage 'http://poppler.freedesktop.org'
  url 'http://poppler.freedesktop.org/poppler-0.22.4.tar.gz'
  sha1 '26586bcd41a01adca00bf5929e11c49419bd21fa'

  option 'with-qt4', 'Build Qt backend'
  option 'with-glib', 'Build Glib backend'

  depends_on 'pkg-config' => :build

  depends_on :fontconfig
  depends_on 'openjpeg'

  depends_on 'qt' if build.include? 'with-qt4'
  depends_on 'glib' if build.include? 'with-glib'
  depends_on 'cairo' if build.include? 'with-glib' # Needs a newer Cairo build than OS X 10.6.7 provides

  def install
    if build.include? 'with-qt4'
      ENV['POPPLER_QT4_CFLAGS'] = `#{HOMEBREW_PREFIX}/bin/pkg-config QtCore QtGui --libs`.chomp
      ENV.append 'LDFLAGS', "-Wl,-F#{HOMEBREW_PREFIX}/lib"
    end

    args = ["--disable-dependency-tracking", "--prefix=#{prefix}", "--enable-xpdf-headers"]
    # Explicitly disable Qt if not requested because `POPPLER_QT4_CFLAGS` won't
    # be set and the build will fail.
    #
    # Also, explicitly disable Glib as Poppler will find it and set up to
    # build, but Superenv will have stripped the Glib utilities out of the
    # PATH.
    args << ( build.include?('with-qt4') ? '--enable-poppler-qt4' : '--disable-poppler-qt4' )
    args << ( build.include?('with-glib') ? '--enable-poppler-glib' : '--disable-poppler-glib' )

    system "./configure", *args
    system "make install"

    # Install poppler font data.
    PopplerData.new.brew do
      system "make", "install", "prefix=#{prefix}"
    end
  end
end
<commit_msg>poppler 0.22.5<commit_after>require 'formula'

class PopplerData < Formula
  url 'http://poppler.freedesktop.org/poppler-data-0.4.6.tar.gz'
  sha1 'f030563eed9f93912b1a546e6d87936d07d7f27d'
end

class Poppler < Formula
  homepage 'http://poppler.freedesktop.org'
  url 'http://poppler.freedesktop.org/poppler-0.22.5.tar.gz'
  sha1 '9491bb33788d7f0ee67da572dc4798004f98323a'

  option 'with-qt4', 'Build Qt backend'
  option 'with-glib', 'Build Glib backend'

  depends_on 'pkg-config' => :build

  depends_on :fontconfig
  depends_on 'openjpeg'

  depends_on 'qt' if build.include? 'with-qt4'
  depends_on 'glib' if build.include? 'with-glib'
  depends_on 'cairo' if build.include? 'with-glib' # Needs a newer Cairo build than OS X 10.6.7 provides

  def install
    if build.include? 'with-qt4'
      ENV['POPPLER_QT4_CFLAGS'] = `#{HOMEBREW_PREFIX}/bin/pkg-config QtCore QtGui --libs`.chomp
      ENV.append 'LDFLAGS', "-Wl,-F#{HOMEBREW_PREFIX}/lib"
    end

    args = ["--disable-dependency-tracking", "--prefix=#{prefix}", "--enable-xpdf-headers"]
    # Explicitly disable Qt if not requested because `POPPLER_QT4_CFLAGS` won't
    # be set and the build will fail.
    #
    # Also, explicitly disable Glib as Poppler will find it and set up to
    # build, but Superenv will have stripped the Glib utilities out of the
    # PATH.
    args << ( build.include?('with-qt4') ? '--enable-poppler-qt4' : '--disable-poppler-qt4' )
    args << ( build.include?('with-glib') ? '--enable-poppler-glib' : '--disable-poppler-glib' )

    system "./configure", *args
    system "make install"

    # Install poppler font data.
    PopplerData.new.brew do
      system "make", "install", "prefix=#{prefix}"
    end
  end
end

{'fraction_non_alphanumeric': 0.13799126637554585, 'fraction_numerical': 0.04425036390101892, 'mean_word_length': 3.5210526315789474, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 5, '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': '2235411', 'n_tokens_mistral': 1357, 'n_tokens_neox': 1262, 'n_words': 297}