2009-11-11 05:39:01 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Go < Formula
|
2012-02-21 06:04:21 +00:00
|
|
|
homepage 'http://golang.org'
|
|
|
|
version 'r60.3'
|
|
|
|
|
2011-06-16 13:24:55 +00:00
|
|
|
if ARGV.include? "--use-git"
|
2011-11-13 14:27:46 +00:00
|
|
|
url 'https://github.com/tav/go.git', :tag => 'release.r60.3'
|
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-11-13 14:27:46 +00:00
|
|
|
url 'http://go.googlecode.com/hg/', :revision => 'release.r60.3'
|
2011-06-16 13:24:55 +00:00
|
|
|
head 'http://go.googlecode.com/hg/'
|
2010-10-22 23:22:16 +00:00
|
|
|
end
|
2009-11-11 05:39:01 +00:00
|
|
|
|
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]
|
2012-02-21 06:04:21 +00:00
|
|
|
cd prefix do
|
|
|
|
mkdir %w[pkg bin]
|
2012-02-24 09:21:43 +00:00
|
|
|
|
|
|
|
# The version check is due to:
|
|
|
|
# http://codereview.appspot.com/5654068
|
|
|
|
version = ARGV.build_head? ? 'default' : 'release.r60.3 9516'
|
|
|
|
File.open('VERSION', 'w') {|f| f.write(version) }
|
2009-11-11 05:39:01 +00:00
|
|
|
|
2011-08-06 03:00:25 +00:00
|
|
|
# Tests take a very long time to run. Build only
|
2012-02-21 06:04:21 +00:00
|
|
|
cd 'src' do
|
|
|
|
system "./make.bash"
|
|
|
|
end
|
2009-11-11 05:39:01 +00:00
|
|
|
|
2012-02-21 06:04:21 +00:00
|
|
|
# Don't need the src folder, but do keep the Makefiles as Go projects use these
|
|
|
|
Dir['src/*'].each{|f| rm_rf f unless f.match(/^src\/(pkg|Make)/) }
|
|
|
|
rm_rf %w[include test]
|
|
|
|
end
|
2009-11-11 05:39:01 +00:00
|
|
|
end
|
|
|
|
end
|