aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula
diff options
context:
space:
mode:
authorJonathon Klobucar2013-05-13 15:00:57 -0700
committerMisty De Meo2013-05-15 16:28:05 -0500
commit150ff590ad41e257be38c77e2d815c64b5ac8d38 (patch)
treecce45e6b7ebaad1c7d2a5b8709875068f99a631a /Library/Formula
parent2e134437e223ac4fb89621a3d6fe60f446a424a3 (diff)
downloadhomebrew-150ff590ad41e257be38c77e2d815c64b5ac8d38.tar.bz2
go 1.1
Removes the now-outdated devel block. Also require the use of the correct clang compiler by default. This change was needed when using --devel and now needed in stable. A new caveat has also been added explaining how a $GOPATH must be set and cannot be the same as $GOROOT From the 1.1 release notes listed below. http://golang.org/doc/go1.1#gocmd Closes #19782. Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
Diffstat (limited to 'Library/Formula')
-rw-r--r--Library/Formula/go.rb49
1 files changed, 32 insertions, 17 deletions
diff --git a/Library/Formula/go.rb b/Library/Formula/go.rb
index e30487a99..984fd7917 100644
--- a/Library/Formula/go.rb
+++ b/Library/Formula/go.rb
@@ -2,9 +2,9 @@ require 'formula'
class Go < Formula
homepage 'http://golang.org'
- url 'http://go.googlecode.com/files/go1.0.3.src.tar.gz'
- version '1.0.3'
- sha1 '1a67293c10d6c06c633c078a7ca67e98c8b58471'
+ url 'https://go.googlecode.com/files/go1.1.src.tar.gz'
+ version '1.1'
+ sha1 'a464704ebbbdd552a39b5f9429b059c117d165b3'
head 'https://go.googlecode.com/hg/'
skip_clean 'bin'
@@ -12,16 +12,8 @@ class Go < Formula
option 'cross-compile-all', "Build the cross-compilers and runtime support for all supported platforms"
option 'cross-compile-common', "Build the cross-compilers and runtime support for darwin, linux and windows"
- devel do
- url 'https://go.googlecode.com/files/go1.1rc3.src.tar.gz'
- version '1.1rc3'
- sha1 '211d0e17d3d3d2d57c2b93a4d5a3b450403044f1'
- end
-
- unless build.stable?
- fails_with :clang do
- cause "clang: error: no such file or directory: 'libgcc.a'"
- end
+ fails_with :clang do
+ cause "clang: error: no such file or directory: 'libgcc.a'"
end
def install
@@ -82,15 +74,38 @@ class Go < Formula
Pathname.new('pkg/obj').rmtree
# Don't install header files; they aren't necessary and can
- # cause problems with other builds. See:
+ # cause problems with other builds.
+ # See:
# http://trac.macports.org/ticket/30203
# http://code.google.com/p/go/issues/detail?id=2407
prefix.install(Dir['*'] - ['include'])
end
+ def caveats; <<-EOS.undent
+ The go get command no longer allows $GOROOT as
+ the default destination in Go 1.1 when downloading package source.
+ To use the go get command, a valid $GOPATH is now required.
+
+ As a result of the previous change, the go get command will also fail
+ when $GOPATH and $GOROOT are set to the same value.
+
+ More information here: http://golang.org/doc/code.html#GOPATH
+ EOS
+ end
+
test do
- cd "#{prefix}/src" do
- system "./run.bash", "--no-rebuild"
- end
+ (testpath/'hello.go').write <<-EOS.undent
+ package main
+
+ import "fmt"
+
+ func main() {
+ fmt.Println("Hello World")
+ }
+ EOS
+ # Run go vet check for no errors then run the program.
+ # This is a a bare minimum of go working as it uses vet, build, and run.
+ `#{bin}/go vet hello.go` == ""
+ `#{bin}/go run hello.go` == "Hello World\n"
end
end