<commit_before>require 'formula'

class Ghc < Formula
  homepage 'http://haskell.org/ghc/'
  if ARGV.include? '--64bit'
    url "http://www.haskell.org/ghc/dist/7.0.4/ghc-7.0.4-x86_64-apple-darwin.tar.bz2"
    md5 'af89d3d2ca6e9b23384baacb7d8161dd'
  else
    url "http://www.haskell.org/ghc/dist/7.0.4/ghc-7.0.4-i386-apple-darwin.tar.bz2"
    md5 'ce297e783d113cf1547386703d1b1061'
  end

  devel do
    if ARGV.include? '--64bit'
      url "http://www.haskell.org/ghc/dist/7.4.1/ghc-7.4.1-x86_64-apple-darwin.tar.bz2"
      md5 '04a572f72c25e9d8fcbd7e9363d276bf'
    else
      url "http://www.haskell.org/ghc/dist/7.4.1/ghc-7.4.1-i386-apple-darwin.tar.bz2"
      md5 '80243578b243224800f217e5e3060836'
    end
  end

  # Avoid stripping the Haskell binaries & libraries.
  # See: http://hackage.haskell.org/trac/ghc/ticket/2458
  skip_clean ['bin', 'lib']

  fails_with :clang do
    build 318
    cause <<-EOS.undent
      Building with Clang configures GHC to use Clang as its preprocessor,
      which causes subsequent GHC-based builds to fail.
      EOS
  end

  def options
    [['--64bit', 'Install 64-bit version of GHC (experimental).']]
  end

  def install
    if ARGV.build_devel?
      opoo "The current version of haskell-platform will NOT work with this version of GHC!"
    end
    if ARGV.include? '--64bit'
      if Hardware.is_64_bit?
        opoo "The x86_64 version is experimental!"
      else<commit_msg>GHC: Refuse to install on Leopard<commit_after>require 'formula'

class Ghc < Formula
  homepage 'http://haskell.org/ghc/'
  if ARGV.include? '--64bit'
    url "http://www.haskell.org/ghc/dist/7.0.4/ghc-7.0.4-x86_64-apple-darwin.tar.bz2"
    md5 'af89d3d2ca6e9b23384baacb7d8161dd'
  else
    url "http://www.haskell.org/ghc/dist/7.0.4/ghc-7.0.4-i386-apple-darwin.tar.bz2"
    md5 'ce297e783d113cf1547386703d1b1061'
  end

  devel do
    if ARGV.include? '--64bit'
      url "http://www.haskell.org/ghc/dist/7.4.1/ghc-7.4.1-x86_64-apple-darwin.tar.bz2"
      md5 '04a572f72c25e9d8fcbd7e9363d276bf'
    else
      url "http://www.haskell.org/ghc/dist/7.4.1/ghc-7.4.1-i386-apple-darwin.tar.bz2"
      md5 '80243578b243224800f217e5e3060836'
    end
  end

  # Avoid stripping the Haskell binaries & libraries.
  # See: http://hackage.haskell.org/trac/ghc/ticket/2458
  skip_clean ['bin', 'lib']

  fails_with :clang do
    build 318
    cause <<-EOS.undent
      Building with Clang configures GHC to use Clang as its preprocessor,
      which causes subsequent GHC-based builds to fail.
      EOS
  end

  def options
    [['--64bit', 'Install 64-bit version of GHC (experimental).']]
  end

  def install
    if MacOS.leopard?
      onoe <<-EOS.undent
        GHC requires OS X 10.6 or newer. The binary releases no longer work on
        Leopard. See the following issue for details:

          http://hackage.haskell.org/trac/ghc/ticket/6009
      EOS
      exit 1
    end

    if ARGV.build_devel?
      opoo "The current version of haskell-platform will NOT work with this version of GHC!"
    end
    if ARGV.include? '--64bit'
      if Hardware.is_64_bit?
        opoo "The x86_64 version is experimental!"
      else
{'fraction_non_alphanumeric': 0.11996191685179308, 'fraction_numerical': 0.10155506188511583, 'mean_word_length': 2.6651162790697676, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 8, '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': '1917663', 'n_tokens_mistral': 1470, 'n_tokens_neox': 1270, 'n_words': 264}