homebrew-core/Formula/go.rb

36 lines
964 B
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
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
version 'r60.3'
2009-11-11 05:39:01 +00:00
homepage 'http://golang.org'
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]
2009-11-11 05:39:01 +00:00
Dir.chdir prefix
mkdir %w[pkg bin]
File.open('VERSION', 'w') {|f| f.write('release.r60.3 9516') }
2009-11-11 05:39:01 +00:00
Dir.chdir 'src' do
# Tests take a very long time to run. Build only
system "./make.bash"
2009-11-11 05:39:01 +00:00
end
# 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]
2009-11-11 05:39:01 +00:00
end
end