<commit_before>require 'formula'

def postgres?
    ARGV.include? "--with-postgres"
end

def mysql?
    ARGV.include? "--with-mysql"
end

class Grass < Formula
  homepage 'http://grass.osgeo.org/'
  url 'http://grass.osgeo.org/grass64/source/grass-6.4.0.tar.gz'
  md5 'ac3233aa3351f8e060ea48246aa01c7f'

  depends_on "pkg-config" => :build
  depends_on "gettext"
  depends_on "readline"
  depends_on "gdal"
  depends_on "libtiff"
  depends_on "unixodbc"
  depends_on "fftw"

  depends_on "cairo" if MacOS.leopard?

  def patches
    DATA
  end

  def options
    [
      ['--with-postgres', 'Specify PostgreSQL as a dependency'],
      ['--with-mysql', 'Specify MySQL as a dependency']
    ]
  end

  def install
    readline = Formula.factory( 'readline' )
    gettext = Formula.factory( 'gettext' )

    args = [
      "--disable-debug", "--disable-dependency-tracking",
      "--with-libs=/usr/X11/lib #{HOMEBREW_PREFIX}/lib",
      "--with-includes=#{HOMEBREW_PREFIX}/include",
      "--enable-largefile",
      "--enable-shared",
      "--with-cxx",
      "--with-opengl=aqua",
      "--with-x",
      "--without-motif",
      "--with-python=/usr/bin/python-config",
      "--with-wxwidgets=/usr/bin/wx-config",
      "--with-blas",
      "--with-lapack",
      "--with-sqlite",
      "--with-odbc",
      "--with-png-includes=/usr/X11/include",
      "--with-png",
      "--with-readline-includes=#{readline.include}",
      "--with-readline-libs=#{readline.lib}",
      "--with-readline",
      "--with-nls-includes=#{gettext.include}",
      "--with-nls-libs=#{gettext.lib}",
      "--with-nls",
      "--with-freetype-includes=/usr/X11/include /usr/X11/include/freetype2",
      "--with-freetype",
      "--without-ffmpeg", # Disabled because NVIZ needs Tcl and wxNVIZ is not shipping yet.
      "--without-tcltk" # Disabled due to compatibility issues with OS X Tcl/Tk
    ]

    if MacOS.prefer_64_bit?
      args << "--enable-64bit"
      args << "--with-macosx-archs=x86_64"
    else
      args << "--with-macosx-archs=i386"
    end
<commit_msg>GRASS 6.4.1<commit_after>require 'formula'

def postgres?
    ARGV.include? "--with-postgres"
end

def mysql?
    ARGV.include? "--with-mysql"
end

class Grass < Formula
  homepage 'http://grass.osgeo.org/'
  url 'http://grass.osgeo.org/grass64/source/grass-6.4.1.tar.gz'
  md5 'd8ca83d416b5b0cf2aa9d36c81a77b23'

  depends_on "pkg-config" => :build
  depends_on "gettext"
  depends_on "readline"
  depends_on "gdal"
  depends_on "libtiff"
  depends_on "unixodbc"
  depends_on "fftw"
  depends_on "ffmpeg"

  depends_on "cairo" if MacOS.leopard?

  def patches
    DATA
  end

  def options
    [
      ['--with-postgres', 'Specify PostgreSQL as a dependency'],
      ['--with-mysql', 'Specify MySQL as a dependency']
    ]
  end

  def install
    readline = Formula.factory('readline')
    gettext = Formula.factory('gettext')
    ffmpeg = Formula.factory('ffmpeg')
    ffmpeg_includes = ffmpeg.include.subdirs.map do |dir|
      dir.to_s.gsub(ffmpeg.prefix, HOMEBREW_PREFIX) + " "
    end

    args = [
      "--disable-debug", "--disable-dependency-tracking",
      "--with-libs=/usr/X11/lib #{HOMEBREW_PREFIX}/lib",
      "--with-includes=#{HOMEBREW_PREFIX}/include",
      "--enable-largefile",
      "--enable-shared",
      "--with-cxx",
      "--with-opengl=aqua",
      "--with-x",
      "--without-motif",
      "--with-python=/usr/bin/python-config",
      "--with-wxwidgets=/usr/bin/wx-config",
      "--with-blas",
      "--with-lapack",
      "--with-sqlite",
      "--with-odbc",
      "--with-geos=#{HOMEBREW_PREFIX}/bin/geos-config",
      "--with-png-includes=/usr/X11/include",
      "--with-png",
      "--with-readline-includes=#{readline.include}",
      "--with-readline-libs=#{readline.lib}",
      "--with-readline",
      "--with-nls-includes=#{gettext.include}",
      "--with-nls-libs=#{gettext.lib}",
      "--with-nls",
      "--with-freetype-includes=/usr/X11/include /usr/X11/include/freetype2",
      "--with-freetype",
      "--with-ffmpeg-includes=#{ffmpeg_includes}",
      "--with-ffmpeg",
      "--without-tcltk" # Disabled due to compatibility issues with OS X Tcl/Tk
    ]

    if MacOS.prefer_64_bit?
      args << "--enable-64bit"
      args << "--with-macosx-archs=x86_64"
    else
      args << "--with-macosx-archs=i386"
    end

{'fraction_non_alphanumeric': 0.18070620816985922, 'fraction_numerical': 0.02146318947611355, 'mean_word_length': 2.4951612903225806, 'pattern_counts': {'":': 0, '<': 17, '<?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': '7009602', 'n_tokens_mistral': 1676, 'n_tokens_neox': 1591, 'n_words': 257}