2009-11-11 05:39:01 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Go < Formula
|
2011-06-16 13:24:55 +00:00
|
|
|
if ARGV.include? "--use-git"
|
2011-08-06 03:00:25 +00:00
|
|
|
url 'https://github.com/tav/go.git', :tag => 'release.r59'
|
2011-06-16 13:24:55 +00:00
|
|
|
head 'https://github.com/tav/go.git'
|
2010-10-22 23:22:16 +00:00
|
|
|
else
|
2011-08-06 03:00:25 +00:00
|
|
|
url 'http://go.googlecode.com/hg/', :revision => 'release.r59'
|
2011-06-16 13:24:55 +00:00
|
|
|
head 'http://go.googlecode.com/hg/'
|
2010-10-22 23:22:16 +00:00
|
|
|
end
|
2011-08-06 03:00:25 +00:00
|
|
|
version 'r59'
|
2009-11-11 05:39:01 +00:00
|
|
|
homepage 'http://golang.org'
|
|
|
|
|
2011-06-16 13:24:55 +00:00
|
|
|
skip_clean 'bin'
|
|
|
|
|
2010-10-22 23:22:16 +00:00
|
|
|
def options
|
2011-06-16 13:24:55 +00:00
|
|
|
[["--use-git", "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
|
|
|
def install
|
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
|
2011-08-06 03:00:25 +00:00
|
|
|
# Tests take a very long time to run. Build only
|
2011-06-16 13:24:55 +00:00
|
|
|
system "./make.bash"
|
2009-11-11 05:39:01 +00:00
|
|
|
end
|
|
|
|
|
2011-06-16 13:24:55 +00:00
|
|
|
# Don't need the src folder, but do keep the Makefiles as Go projects use these
|
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
|