<commit_before>require 'formula'

class Pure < Formula
  homepage 'http://purelang.bitbucket.org/'
  url 'https://bitbucket.org/purelang/pure-lang/downloads/pure-0.57.tar.gz'
  sha1 '5c7441993752d0e2cba74912521d6df865e5dc0b'

  # Autotools are needed due to patching configure.ac. Remove on new releases.
  depends_on :autoconf
  depends_on :automake
  depends_on :libtool

  depends_on 'llvm'
  depends_on 'gmp'
  depends_on 'readline'
  depends_on 'mpfr'

  resource 'docs' do
    url 'https://bitbucket.org/purelang/pure-lang/downloads/pure-docs-0.57.tar.gz'
    sha1 '7f2c6051b831d3de887f2182e8b29b1716ab45fd'
  end

  # Patches backported from trunk for llvm 3.3 compatibility. Originally:
  # https://bitbucket.org/purelang/pure-lang/commits/2866a677f3362ccfd0ced24b9dd235bff627f4c5/raw/
  # removing changes to ChangeLog to apply.
  def patches
    {
      :p2 => [
        DATA, 
        'https://bitbucket.org/purelang/pure-lang/commits/387a67f2f9943640c05b3e8d796ddf7f06febe3f/raw/'
      ]
    }
  end

  def install
    # Force regenerate configure/Makefile due to patching
    # configure.ac. Remove when new release is available.
    system "autoreconf -fiv"

    system "./configure", "--disable-debug",
                          "--prefix=#{prefix}",
                          "--enable-release",
                          "--without-elisp"
    system "make"
    system "make check"
    system "make install"
    resource('docs').stage { system "make", "prefix=#{prefix}", "install" }
  end
end

__END__
# HG changeset patch
# User <NAME> <<EMAIL>>
# Date 1376480012 -7200
# Node ID 2866a677f3362ccfd0ced24b9dd235bff627f4c5
# Parent  356f97c14d61d49431c622e2ee1ece4bdc1fab54
LLVM 3.3 compatibility fixes.<commit_msg>pure: fix audit<commit_after>require 'formula'

class Pure < Formula
  homepage 'http://purelang.bitbucket.org/'
  url 'https://bitbucket.org/purelang/pure-lang/downloads/pure-0.57.tar.gz'
  sha1 '5c7441993752d0e2cba74912521d6df865e5dc0b'

  # Autotools are needed due to patching configure.ac. Remove on new releases.
  depends_on :autoconf
  depends_on :automake
  depends_on :libtool

  depends_on 'llvm'
  depends_on 'gmp'
  depends_on 'readline'
  depends_on 'mpfr'

  resource 'docs' do
    url 'https://bitbucket.org/purelang/pure-lang/downloads/pure-docs-0.57.tar.gz'
    sha1 '7f2c6051b831d3de887f2182e8b29b1716ab45fd'
  end

  # Patches backported from trunk for llvm 3.3 compatibility. Originally:
  # https://bitbucket.org/purelang/pure-lang/commits/2866a677f3362ccfd0ced24b9dd235bff627f4c5/raw/
  # removing changes to ChangeLog to apply.
  def patches
    {
      :p2 => [
        DATA,
        'https://bitbucket.org/purelang/pure-lang/commits/387a67f2f9943640c05b3e8d796ddf7f06febe3f/raw/'
      ]
    }
  end

  def install
    # Force regenerate configure/Makefile due to patching
    # configure.ac. Remove when new release is available.
    system "autoreconf -fiv"

    system "./configure", "--disable-debug",
                          "--prefix=#{prefix}",
                          "--enable-release",
                          "--without-elisp"
    system "make"
    system "make check"
    system "make install"
    resource('docs').stage { system "make", "prefix=#{prefix}", "install" }
  end
end

__END__
# HG changeset patch
# User <NAME> <<EMAIL>>
# Date 1376480012 -7200
# Node ID 2866a677f3362ccfd0ced24b9dd235bff627f4c5
# Parent  356f97c14d61d49431c622e2ee1ece4bdc1fab54
LLVM 3.3 compatibility fixes.
{'fraction_non_alphanumeric': 0.10649350649350649, 'fraction_numerical': 0.09985569985569985, 'mean_word_length': 3.0776470588235294, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 8, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7450640', 'n_tokens_mistral': 1461, 'n_tokens_neox': 1266, 'n_words': 249}