homebrew-core/Formula/go.rb

42 lines
1.1 KiB
Ruby
Raw Normal View History

2009-11-11 05:39:01 +00:00
require 'formula'
2011-03-10 05:11:03 +00:00
class Go < Formula
homepage 'http://golang.org'
version 'r60.3'
if ARGV.include? "--use-git"
url 'https://github.com/tav/go.git', :tag => 'release.r60.3'
head 'https://github.com/tav/go.git'
else
url 'http://go.googlecode.com/hg/', :revision => 'release.r60.3'
head 'http://go.googlecode.com/hg/'
end
2009-11-11 05:39:01 +00:00
skip_clean 'bin'
def options
[["--use-git", "Use git mirror instead of official hg repository"]]
end
2009-11-11 05:39:01 +00:00
def install
prefix.install %w[src include test doc misc lib favicon.ico AUTHORS]
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
# Tests take a very long time to run. Build only
cd 'src' do
system "./make.bash"
end
2009-11-11 05:39:01 +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