homebrew-core/Formula/go.rb

33 lines
819 B
Ruby
Raw Normal View History

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
if ARGV.include? "--use-git-head"
head 'https://github.com/tav/go.git', :tag => 'release'
else
head 'http://go.googlecode.com/hg/', :revision => 'release'
end
2009-11-11 05:39:01 +00:00
homepage 'http://golang.org'
def options
2010-10-24 20:21:57 +00:00
[["--use-git-head", "Use git mirror instead of official hg repository"]]
end
2009-11-11 05:39:01 +00:00
skip_clean 'bin'
def install
ENV.j1 # https://github.com/mxcl/homebrew/issues/#issue/237
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]
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
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