<commit_before>require 'formula'

class Go <Formula
  head 'https://go.googlecode.com/hg/', :revision => 'release'
  homepage 'http://golang.org'

  aka 'google-go'

  skip_clean 'bin'

  def cruft
    %w[src include test doc]
  end

  def install
    ENV.j1 # http://github.com/mxcl/homebrew/issues/#issue/237
    prefix.install cruft<<'misc'
    Dir.chdir prefix
    FileUtils.mkdir %w[pkg bin lib]

    ENV['GOROOT'] = Dir.getwd
    ENV['GOBIN'] = bin.to_s
    ENV['GOARCH'] = Hardware.is_64_bit? ? 'amd64' : '386'
    ENV['GOOS'] = 'darwin'

    ENV.prepend 'PATH', ENV['GOBIN'], ':'

    Dir.chdir 'src' do
      system "./all.bash"
    end

    FileUtils.rm_rf cruft
  end

  def caveats; <<-EOS
In order to use Go you need to set the following in your ~/.profile:

    export GOROOT=`brew --cellar`/go/#{version}
    export GOARCH=#{ENV['GOARCH']}
    export GOOS=#{ENV['GOOS']}

Presumably at some point the Go developers won't require us to mutilate our
shell environments in order to compile Go code...
    EOS
  end
end
<commit_msg>Go - keep make files and export GOBIN<commit_after>require 'formula'
require 'hardware'

class Go <Formula
  head 'http://go.googlecode.com/hg/', :revision => 'release'
  homepage 'http://golang.org'

  aka 'google-go'

  skip_clean 'bin'

  def cruft
    %w[src include test doc]
  end

  def which_arch
    Hardware.is_64_bit? ? 'amd64' : '386'
  end

  def install
    ENV.j1 # http://github.com/mxcl/homebrew/issues/#issue/237
    prefix.install %w[src include test doc misc]
    Dir.chdir prefix
    mkdir %w[pkg bin lib]

    ENV['GOROOT'] = Dir.getwd
    ENV['GOBIN'] = bin
    ENV['GOARCH'] = which_arch
    ENV['GOOS'] = 'darwin'

    ENV.prepend 'PATH', ENV['GOBIN'], ':'

    Dir.chdir 'src' do
      system "./all.bash"
      # Keep the makefiles - http://github.com/mxcl/homebrew/issues/issue/1404
    end

    Dir['src/*'].each{|f| rm_rf f unless f.match(/^src\/Make/) }
    rm_rf %w[include test doc]
  end

  def caveats
    <<-EOS.undent
      In order to use Go, set the following in your ~/.profile:

        export GOROOT=`brew --cellar`/go/#{version}
        export GOBIN=#{HOMEBREW_PREFIX}/bin
        export GOARCH=#{which_arch}
        export GOOS=darwin

      Presumably at some point the Go developers won't require us to
      mutilate our shell environments in order to compile Go code...
    EOS
  end
end

{'fraction_non_alphanumeric': 0.13577133249264398, 'fraction_numerical': 0.01092896174863388, 'mean_word_length': 2.789808917197452, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 5, 'https://': 1, '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': '1620661', 'n_tokens_mistral': 916, 'n_tokens_neox': 842, 'n_words': 234}