<commit_before>require 'formula'

class Go < Formula
  homepage 'http://golang.org'
  url 'https://go.googlecode.com/files/go1.1.2.src.tar.gz'
  version '1.1.2'
  sha1 'f5ab02bbfb0281b6c19520f44f7bc26f9da563fb'

  head 'https://go.googlecode.com/hg/'

  skip_clean 'bin'

  option 'cross-compile-all', "Build the cross-compilers and runtime support for all supported platforms"
  option 'cross-compile-common', "Build the cross-compilers and runtime support for darwin, linux and windows"
  option 'with-cgo', "Build with cgo"

  # the cgo module cannot build with clang
  # NOTE it is ridiculous that we put this stuff in the class
  # definition, it needs to be in a pre-install test function!
  if build.with? 'cgo'
    fails_with :clang do
      cause "clang: error: no such file or directory: 'libgcc.a'"
    end
  end

  def install
    # install the completion scripts
    bash_completion.install 'misc/bash/go' => 'go-completion.bash'
    zsh_completion.install 'misc/zsh/go' => 'go'

    if build.include? 'cross-compile-all'
      targets = [
        ['linux',   ['386', 'amd64', 'arm'], { :cgo => false }],
        ['freebsd', ['386', 'amd64'],        { :cgo => false }],
        ['netbsd',  ['386', 'amd64'],        { :cgo => false }],
        ['openbsd', ['386', 'amd64'],        { :cgo => false }],

        ['windows', ['386', 'amd64'],        { :cgo => false }],

        # Host platform (darwin/amd64) must always come last
        ['darwin',  ['386', 'amd64'],        { :cgo => build.with?('cgo')  }],
      ]
    elsif build.include? 'cross-compile-common'
      targets = [
        ['linux',   ['386', 'amd64', 'arm'], { :cgo => false }],<commit_msg>go: fails_with :clang when cross-compiling<commit_after>require 'formula'

class Go < Formula
  homepage 'http://golang.org'
  url 'https://go.googlecode.com/files/go1.1.2.src.tar.gz'
  version '1.1.2'
  sha1 'f5ab02bbfb0281b6c19520f44f7bc26f9da563fb'

  head 'https://go.googlecode.com/hg/'

  skip_clean 'bin'

  option 'cross-compile-all', "Build the cross-compilers and runtime support for all supported platforms"
  option 'cross-compile-common', "Build the cross-compilers and runtime support for darwin, linux and windows"
  option 'with-cgo', "Build with cgo"

  # the cgo module cannot build with clang
  # NOTE it is ridiculous that we put this stuff in the class
  # definition, it needs to be in a pre-install test function!
  if build.with? 'cgo'
    fails_with :clang do
      cause "clang: error: no such file or directory: 'libgcc.a'"
    end
  elsif build.include?('cross-compile-all') || build.include?('cross-compile-common')
    fails_with :clang do
      cause "error: no case matching constant switch condition '53' [-Werror]
        switch(thechar){"
    end
  end

  def install
    # install the completion scripts
    bash_completion.install 'misc/bash/go' => 'go-completion.bash'
    zsh_completion.install 'misc/zsh/go' => 'go'

    if build.include? 'cross-compile-all'
      targets = [
        ['linux',   ['386', 'amd64', 'arm'], { :cgo => false }],
        ['freebsd', ['386', 'amd64'],        { :cgo => false }],
        ['netbsd',  ['386', 'amd64'],        { :cgo => false }],
        ['openbsd', ['386', 'amd64'],        { :cgo => false }],

        ['windows', ['386', 'amd64'],        { :cgo => false }],

        # Host platform (darwin/amd64) must always come last
        ['darwin',  ['386', 'amd64'],        { :cgo => build.with?('cgo')  }],
      ]
    elsif build.include? 'cross-compile-common'
      targets = [
        ['linux',   ['386', 'amd64', 'arm'], { :cgo => false }],
{'fraction_non_alphanumeric': 0.1606347438752784, 'fraction_numerical': 0.037305122494432075, 'mean_word_length': 2.8801295896328294, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 21, 'https://': 4, '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': '2057887', 'n_tokens_mistral': 1308, 'n_tokens_neox': 1197, 'n_words': 338}