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 Homebrew/homebrew#19782. Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
This commit is contained in:
parent
90d207d817
commit
cd09fd396f
1 changed files with 32 additions and 17 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue