<commit_before>require 'formula'

class ArgpStandalone <Formula
  url 'http://www.lysator.liu.se/~nisse/misc/argp-standalone-1.3.tar.gz'
  homepage 'http://www.freshports.org/devel/argp-standalone/?ref=darwinports.com'
  md5 '720704bac078d067111b32444e24ba69'
end

class Parsley <Formula
  head 'git://github.com/fizx/parsley.git'
  homepage 'http://github.com/fizx/parsley'

  depends_on 'json-c'
  depends_on 'pcre'

  def install
    argpwd = Pathname.getwd+'argp'
    argpwd.mkpath

    ArgpStandalone.new.brew do
        system "./configure", "--disable-debug", "--disable-dependency-tracking",
               "--prefix=#{argpwd}"
        system "make"
        argpwd.install ["libargp.a"]
        argpwd.install ["argp.h", "argp-fmtstream.h", "argp-namefrob.h"]
    end

    # remove the refs to /opt/local and use this opportunity to link to argp
    inreplace 'configure', '-L/opt/local/lib', "-L#{argpwd}"
    inreplace 'configure', '-I/opt/local/include', "-I#{argpwd}"
    system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
    system "make install"
  end
end
<commit_msg>parsley - use argp dep<commit_after>require 'formula'

class Parsley <Formula
  head 'git://github.com/fizx/parsley.git'
  homepage 'http://github.com/fizx/parsley'

  depends_on 'json-c'
  depends_on 'pcre'
  depends_on 'argp-standalone'

  def install
    argp = Formula.factory("argp-standalone").prefix

    # remove the refs to /opt/local and use this opportunity to link to argp
    inreplace 'configure', '-L/opt/local/lib', "-L#{argp}"
    inreplace 'configure', '-I/opt/local/include', "-I#{argp}"
    system "./configure", "--disable-dependency-tracking", "--prefix=#{prefix}"
    system "make install"
  end
end

{'fraction_non_alphanumeric': 0.1582900057770075, 'fraction_numerical': 0.01559792027729636, 'mean_word_length': 3.3848101265822783, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '3189007', 'n_tokens_mistral': 642, 'n_tokens_neox': 617, 'n_words': 126}