2009-11-11 05:39:01 +00:00
|
|
|
require 'formula'
|
2010-05-21 03:06:46 +00:00
|
|
|
require 'hardware'
|
2009-11-11 05:39:01 +00:00
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Go < Formula
|
2010-10-22 23:22:16 +00:00
|
|
|
if ARGV.include? "--use-git-head"
|
2010-11-10 18:16:28 +00:00
|
|
|
head 'https://github.com/tav/go.git', :tag => 'release'
|
2010-10-22 23:22:16 +00:00
|
|
|
else
|
|
|
|
head 'http://go.googlecode.com/hg/', :revision => 'release'
|
|
|
|
end
|
2009-11-11 05:39:01 +00:00
|
|
|
homepage 'http://golang.org'
|
|
|
|
|
2010-10-22 23:22:16 +00:00
|
|
|
def options
|
2010-10-24 20:21:57 +00:00
|
|
|
[["--use-git-head", "Use git mirror instead of official hg repository"]]
|
2010-10-22 23:22:16 +00:00
|
|
|
end
|
|
|
|
|
2009-11-11 05:39:01 +00:00
|
|
|
skip_clean 'bin'
|
|
|
|
|
|
|
|
def install
|
2010-11-10 18:16:28 +00:00
|
|
|
ENV.j1 # https://github.com/mxcl/homebrew/issues/#issue/237
|
2011-05-05 21:30:49 +00:00
|
|
|
prefix.install %w[src include test doc misc lib favicon.ico AUTHORS]
|
2009-11-11 05:39:01 +00:00
|
|
|
Dir.chdir prefix
|
2010-09-19 18:21:15 +00:00
|
|
|
mkdir %w[pkg bin]
|
2009-11-11 05:39:01 +00:00
|
|
|
|
|
|
|
Dir.chdir 'src' do
|
|
|
|
system "./all.bash"
|
|
|
|
end
|
|
|
|
|
2011-02-22 06:05:21 +00:00
|
|
|
# Keep the makefiles - https://github.com/mxcl/homebrew/issues/issue/1404
|
2010-09-19 18:21:15 +00:00
|
|
|
Dir['src/*'].each{|f| rm_rf f unless f.match(/^src\/(pkg|Make)/) }
|
|
|
|
rm_rf %w[include test]
|
2009-11-11 05:39:01 +00:00
|
|
|
end
|
|
|
|
end
|