<commit_before>require 'formula'

# todo: Use graphite loop optimizations? (would depends_on 'cloog')

class Gfortran < Formula
  homepage 'http://gcc.gnu.org/wiki/GFortran'
  url 'http://ftpmirror.gnu.org/gcc/gcc-4.7.2/gcc-4.7.2.tar.bz2'
  mirror 'http://ftp.gnu.org/gnu/gcc/gcc-4.7.2/gcc-4.7.2.tar.bz2'
  sha1 'a464ba0f26eef24c29bcd1e7489421117fb9ee35'

  bottle do
    sha1 '684879d100c02ac9ba5c23ded4860da19c02650d' => :mountainlion
    sha1 '3d958ffe0f126d1add6e2f5236b333870b1a826b' => :lion
    sha1 '9708ac5fa35db9789b8e050fbe410acee9ec9e45' => :snowleopard
  end

  depends_on 'gmp'
  depends_on 'libmpc'
  depends_on 'mpfr'

  option 'enable-profiled-build', 'Make use of profile guided optimization when bootstrapping GCC'
  option 'check', 'Run the make check fortran. This is for maintainers.'

  begin
    depends_on 'dejagnu'
    depends_on 'expect'
  end if build.include? 'check'  # http://gcc.gnu.org/install/test.html

  fails_with :clang do
    build 421
    cause <<-EOS.undent
      "fatal error: error in backend: ran out of registers during register allocation"

      If you have any knowledge to share or can provide a fix, please open an issue.
      Thanks!
      EOS
  end

  def install
    # Sandbox the GCC lib, libexec and include directories so they don't wander
    # around telling small children there is no Santa Claus. This results in a
    # partially keg-only brew following suggestions outlined in the "How to
    # install multiple versions of GCC" section of the GCC FAQ:
    #     http://gcc.gnu.org/faq.html#multiple
    gfortran_prefix = prefix/'gfortran'

    args = [
      # Sandbox everything...
      "--prefix=#{gfortran_prefix}",
      # ...except the stuff in share...
      "--datarootdir=#{share}",
      # ...and the binaries...<commit_msg>gfortran: remove dependency on nonexistent "expect" formula<commit_after>require 'formula'

# todo: Use graphite loop optimizations? (would depends_on 'cloog')

class Gfortran < Formula
  homepage 'http://gcc.gnu.org/wiki/GFortran'
  url 'http://ftpmirror.gnu.org/gcc/gcc-4.7.2/gcc-4.7.2.tar.bz2'
  mirror 'http://ftp.gnu.org/gnu/gcc/gcc-4.7.2/gcc-4.7.2.tar.bz2'
  sha1 'a464ba0f26eef24c29bcd1e7489421117fb9ee35'

  bottle do
    sha1 '684879d100c02ac9ba5c23ded4860da19c02650d' => :mountainlion
    sha1 '3d958ffe0f126d1add6e2f5236b333870b1a826b' => :lion
    sha1 '9708ac5fa35db9789b8e050fbe410acee9ec9e45' => :snowleopard
  end

  depends_on 'gmp'
  depends_on 'libmpc'
  depends_on 'mpfr'

  option 'enable-profiled-build', 'Make use of profile guided optimization when bootstrapping GCC'
  option 'check', 'Run the make check fortran. This is for maintainers.'

  begin
    depends_on 'dejagnu'
  end if build.include? 'check'  # http://gcc.gnu.org/install/test.html

  fails_with :clang do
    build 421
    cause <<-EOS.undent
      "fatal error: error in backend: ran out of registers during register allocation"

      If you have any knowledge to share or can provide a fix, please open an issue.
      Thanks!
      EOS
  end

  def install
    # Sandbox the GCC lib, libexec and include directories so they don't wander
    # around telling small children there is no Santa Claus. This results in a
    # partially keg-only brew following suggestions outlined in the "How to
    # install multiple versions of GCC" section of the GCC FAQ:
    #     http://gcc.gnu.org/faq.html#multiple
    gfortran_prefix = prefix/'gfortran'

    args = [
      # Sandbox everything...
      "--prefix=#{gfortran_prefix}",
      # ...except the stuff in share...
      "--datarootdir=#{share}",
      # ...and the binaries...
{'fraction_non_alphanumeric': 0.10364842454394693, 'fraction_numerical': 0.0652294085129906, 'mean_word_length': 3.252643948296122, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '5294877', 'n_tokens_mistral': 1428, 'n_tokens_neox': 1269, 'n_words': 347}