Commit 8a6ed2ac authored by Damian Montero's avatar Damian Montero Committed by GitHub

Merge pull request #703 from jam7/update/go

Update go to 1.8.3 and etc.
parents 9f38190e d2226341
...@@ -3,39 +3,49 @@ require 'package' ...@@ -3,39 +3,49 @@ require 'package'
class Go < Package class Go < Package
description 'Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.' description 'Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.'
homepage 'https://golang.org/' homepage 'https://golang.org/'
version '1.8.0' version '1.8.3'
source_url 'https://storage.googleapis.com/golang/go1.8.src.tar.gz' source_url 'https://storage.googleapis.com/golang/go1.8.3.src.tar.gz'
source_sha1 '37945c372140c3a46c2c5b4b9ce382b6c8d88811' source_sha1 '7c3b942c58a44396ff1d205d0e6e72770792d626'
# Tests requires perl
depends_on 'perl'
# go is required to build versions of go > 1.4 # go is required to build versions of go > 1.4
if `which go` == '' unless File.exist? "#{CREW_PREFIX}/lib/go/bin/go"
depends_on 'go_bootstrap' depends_on 'go_bootstrap'
end end
def self.build def self.build
FileUtils.cd('src') do FileUtils.cd('src') do
# install with go_bootstrap if go is not in the path # install with go_bootstrap if go is not in the path
if `which go` == '' unless File.exist? "#{CREW_PREFIX}/lib/go/bin/go"
system "GOROOT_BOOTSTRAP=/usr/local/lib/go_bootstrap/go \ system "GOROOT_BOOTSTRAP=#{CREW_PREFIX}/lib/go_bootstrap/go \
TMPDIR=/usr/local/tmp \ TMPDIR=#{CREW_PREFIX}/tmp \
./make.bash" ./make.bash"
else else
system "GOROOT_BOOTSTRAP=/usr/local/lib/go \ system "GOROOT_BOOTSTRAP=#{CREW_PREFIX}/lib/go \
TMPDIR=/usr/local/tmp ./make.bash" TMPDIR=#{CREW_PREFIX}/tmp ./make.bash"
end end
end end
end end
def self.install def self.install
dest = "#{CREW_DEST_DIR}/usr/local/lib/" dest = "#{CREW_DEST_DIR}#{CREW_PREFIX}/lib/"
system "mkdir", "-p", dest system "mkdir", "-p", dest
FileUtils.mv Dir.pwd, dest FileUtils.cp_r Dir.pwd, dest
puts "--------" puts "--------"
puts "Installed Go for #{ARCH} in /usr/local/lib/go" puts "Installed Go for #{ARCH} in #{CREW_PREFIX}/lib/go"
puts "Make sure to set go environment variables." puts "Make sure to set go environment variables."
puts "Minimal:" puts "Minimal:"
puts "\texport GOROOT=/usr/local/lib/go" puts "\texport GOROOT=#{CREW_PREFIX}/lib/go"
puts "\texport PATH=$PATH:$GOROOT/bin" puts "\texport PATH=$PATH:$GOROOT/bin"
puts "To use `go run`:"
puts "\texport TMPDIR=#{CREW_PREFIX}/tmp"
end
def self.check
FileUtils.cd('src') do
system "PATH=\"#{Dir.pwd}/../bin:$PATH\" TMPDIR=\"#{CREW_PREFIX}/tmp\" go tool dist test"
end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment