diff options
| author | José MartÃnez | 2011-06-16 15:24:55 +0200 |
|---|---|---|
| committer | Adam Vandenberg | 2011-06-16 08:24:28 -0700 |
| commit | a7b1645e0afb7812627e050af4c8f7eb9aff0e77 (patch) | |
| tree | f87601b4ec7fac983125b13c354d4e76b01b2e84 /Library/Formula | |
| parent | 6c741754cd14055974174b25301bf4d5fdb01b6d (diff) | |
| download | homebrew-a7b1645e0afb7812627e050af4c8f7eb9aff0e77.tar.bz2 | |
go: use stable release and fix build
Signed-off-by: Adam Vandenberg <flangy@gmail.com>
Diffstat (limited to 'Library/Formula')
| -rw-r--r-- | Library/Formula/go.rb | 56 |
1 files changed, 48 insertions, 8 deletions
diff --git a/Library/Formula/go.rb b/Library/Formula/go.rb index e1d92cba9..66042e438 100644 --- a/Library/Formula/go.rb +++ b/Library/Formula/go.rb @@ -2,31 +2,71 @@ require 'formula' require 'hardware' class Go < Formula - if ARGV.include? "--use-git-head" - head 'https://github.com/tav/go.git', :tag => 'release' + if ARGV.include? "--use-git" + url 'https://github.com/tav/go.git', :tag => 'release.r57.2' + head 'https://github.com/tav/go.git' else - head 'http://go.googlecode.com/hg/', :revision => 'release' + url 'http://go.googlecode.com/hg/', :revision => 'release.r57.2' + head 'http://go.googlecode.com/hg/' end + version 'r57.2' homepage 'http://golang.org' + skip_clean 'bin' + def options - [["--use-git-head", "Use git mirror instead of official hg repository"]] + [["--use-git", "Use git mirror instead of official hg repository"]] end - skip_clean 'bin' + def patches + # Fix an egrep error; already present upstream. + # Remove when r58 is tagged. + DATA unless ARGV.build_head? + end def install - ENV.j1 # https://github.com/mxcl/homebrew/issues/#issue/237 + ENV.j1 # Building in parallel fails prefix.install %w[src include test doc misc lib favicon.ico AUTHORS] Dir.chdir prefix mkdir %w[pkg bin] Dir.chdir 'src' do - system "./all.bash" + # Some tests fail on Lion, so do this instead of "./all.bash" + system "./make.bash" end - # Keep the makefiles - https://github.com/mxcl/homebrew/issues/issue/1404 + # 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 end + +__END__ +diff --git a/src/pkg/deps.bash b/src/pkg/deps.bash +index a8e3dfc..2095ec1 100755 +--- a/src/pkg/deps.bash ++++ b/src/pkg/deps.bash +@@ -15,7 +15,13 @@ fi + + # Get list of directories from Makefile + dirs=$(gomake --no-print-directory echo-dirs) +-dirpat=$(echo $dirs C | sed 's/ /|/g; s/.*/^(&)$/') ++dirpat=$(echo $dirs C | awk '{ ++ for(i=1;i<=NF;i++){ ++ x=$i ++ gsub("/", "\\/", x) ++ printf("/^(%s)$/\n", x) ++ } ++}') + + for dir in $dirs; do ( + cd $dir || exit 1 +@@ -30,7 +36,7 @@ for dir in $dirs; do ( + deps=$( + sed -n '/^import.*"/p; /^import[ \t]*(/,/^)/p' $sources /dev/null | + cut -d '"' -f2 | +- egrep "$dirpat" | ++ awk "$dirpat" | + grep -v "^$dir\$" | + sed 's/$/.install/' | + sed 's;^C\.install;runtime/cgo.install;' | |
