<commit_before>require 'formula'

class Imlib2 < Formula
  homepage 'http://sourceforge.net/projects/enlightenment/files/'
  url 'http://downloads.sourceforge.net/project/enlightenment/imlib2-src/1.4.5/imlib2-1.4.5.tar.bz2'
  sha1 'af86a2c38f4bc3806db57e64e74dc9814ad474a0'

  depends_on 'pkg-config' => :build
  depends_on 'jpeg' => :recommended
  depends_on :x11

  def install
    system "./configure", "--disable-dependency-tracking",
                          "--prefix=#{prefix}",
                          "--enable-amd64=no",
                          "--with-x"
    system "make install"
  end

  def test
    mktemp do
      system "#{bin}/imlib2_conv", \
        "/System/Library/Frameworks/SecurityInterface.framework/Versions/A/Resources/Key_Large.png", \
        "imlib2_test.jpg"
    end
  end
end<commit_msg>imlib2: make X11 dependency optional.<commit_after>require 'formula'

class Imlib2 < Formula
  homepage 'http://sourceforge.net/projects/enlightenment/files/'
  url 'http://downloads.sourceforge.net/project/enlightenment/imlib2-src/1.4.5/imlib2-1.4.5.tar.bz2'
  sha1 'af86a2c38f4bc3806db57e64e74dc9814ad474a0'

  option "with-x", "Build with X support"

  depends_on :freetype
  depends_on :libpng => :recommended
  depends_on :x11 if MacOS::X11.installed? or build.include? "with-x"
  depends_on 'pkg-config' => :build
  depends_on 'jpeg' => :recommended

  def install
    args = %W[
      --disable-dependency-tracking
      --prefix=#{prefix}
      --enable-amd64=no
    ]
    args << "--without-x" unless build.include? "with-x"

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

  def test
    mktemp do
      system "#{bin}/imlib2_conv", \
        "/System/Library/Frameworks/SecurityInterface.framework/Versions/A/Resources/Key_Large.png", \
        "imlib2_test.jpg"
    end
  end
end
{'fraction_non_alphanumeric': 0.13373362445414846, 'fraction_numerical': 0.047489082969432314, 'mean_word_length': 2.842767295597484, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7187936', 'n_tokens_mistral': 698, 'n_tokens_neox': 641, 'n_words': 110}