homebrew-core/Formula/go.rb

47 lines
1,016 B
Ruby
Raw Normal View History

2009-11-11 05:39:01 +00:00
require 'formula'
class Go <Formula
2009-12-16 21:40:54 +00:00
head 'https://go.googlecode.com/hg/', :revision => 'release'
2009-11-11 05:39:01 +00:00
homepage 'http://golang.org'
2009-12-04 10:48:21 +00:00
aka 'google-go'
2009-11-11 05:39:01 +00:00
skip_clean 'bin'
def cruft
%w[src include test doc]
end
def install
ENV.j1 # http://github.com/mxcl/homebrew/issues/#issue/237
2009-11-11 05:39:01 +00:00
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:
2010-02-18 21:32:20 +00:00
export GOROOT=`brew --cellar`/go/#{version}
2009-11-11 05:39:01 +00:00
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