Commit 3688bf44 authored by Casey Strouse's avatar Casey Strouse Committed by GitHub

Merge pull request #3995 from uberhacker/update-go-package

Update go from 1.14 to 1.14.2
parents c1a70107 e6ca83b3
...@@ -3,16 +3,24 @@ require 'package' ...@@ -3,16 +3,24 @@ 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.14' version '1.14.2'
source_url 'https://dl.google.com/go/go1.14.src.tar.gz' source_url 'https://dl.google.com/go/go1.14.2.src.tar.gz'
source_sha256 '6d643e46ad565058c7a39dac01144172ef9bd476521f42148be59249e4b74389' source_sha256 '98de84e69726a66da7b4e58eac41b99cbe274d7e8906eeb8a5b7eb0aadee7f7c'
binary_url ({ binary_url ({
aarch64: 'https://dl.bintray.com/chromebrew/chromebrew/go-1.14.2-chromeos-armv7l.tar.xz',
armv7l: 'https://dl.bintray.com/chromebrew/chromebrew/go-1.14.2-chromeos-armv7l.tar.xz',
i686: 'https://dl.bintray.com/chromebrew/chromebrew/go-1.14.2-chromeos-i686.tar.xz',
x86_64: 'https://dl.bintray.com/chromebrew/chromebrew/go-1.14.2-chromeos-x86_64.tar.xz',
}) })
binary_sha256 ({ binary_sha256 ({
aarch64: '6370b16b60d922b2809ee02daa50001389d8a140e8d9205d78dea1051dd5862b',
armv7l: '6370b16b60d922b2809ee02daa50001389d8a140e8d9205d78dea1051dd5862b',
i686: 'c924075cfa74fd1055a9bca62308f131d522ae527eac082dc33ba95b7db2d23e',
x86_64: '8c6d89a1a321fc0e89d5a200cedec07145ffece37c0d42c8859c550b7bbef65d',
}) })
# Tests requires perl # Tests require perl
depends_on 'perl' => :build depends_on 'perl' => :build
# go is required to build versions of go > 1.4 # go is required to build versions of go > 1.4
unless File.exist? "#{CREW_PREFIX}/share/go/bin/go" unless File.exist? "#{CREW_PREFIX}/share/go/bin/go"
...@@ -20,33 +28,37 @@ class Go < Package ...@@ -20,33 +28,37 @@ class Go < Package
end end
def self.build def self.build
FileUtils.cd('src') do FileUtils.cd 'src' do
ENV['GOROOT'] = '..'
ENV['TMPDIR'] = "#{CREW_PREFIX}/tmp"
ENV['GOROOT_FINAL'] = "#{CREW_PREFIX}/share/go"
ENV['GOHOSTARCH'] = 'arm' if ARCH == 'aarch64'
# install with go_bootstrap if go is not in the path # install with go_bootstrap if go is not in the path
unless File.exist? "#{CREW_PREFIX}/share/go/bin/go" unless File.exist? "#{CREW_PREFIX}/share/go/bin/go"
system "GOROOT_BOOTSTRAP=#{CREW_PREFIX}/share/go_bootstrap/go \ ENV['GOROOT_BOOTSTRAP'] = "#{CREW_PREFIX}/share/go_bootstrap/go"
TMPDIR=#{CREW_PREFIX}/tmp \ ENV['PATH'] = ENV['PATH'] + ":#{CREW_PREFIX}/share/go_bootstrap/go/bin"
GOROOT_FINAL=#{CREW_PREFIX}/share/go \
%s \
./make.bash" % 'GOHOSTARCH=arm' if ARCH == 'aarch64'
else else
system "GOROOT_BOOTSTRAP=#{CREW_PREFIX}/share/go \ ENV['GOROOT_BOOTSTRAP'] = "#{CREW_PREFIX}/share/go"
TMPDIR=#{CREW_PREFIX}/tmp \
GOROOT_FINAL=#{CREW_PREFIX}/share/go \
%s \
./make.bash" % 'GOHOSTARCH=arm' if ARCH == 'aarch64'
end end
system './make.bash'
end
end
def self.check
FileUtils.cd 'src' do
system "PATH=\"#{Dir.pwd}/../bin:$PATH\" GOROOT=\"#{Dir.pwd}/..\" TMPDIR=\"#{CREW_PREFIX}/tmp\" go tool dist test"
end end
end end
def self.install def self.install
dest = "#{CREW_DEST_PREFIX}/share/" dest = "#{CREW_DEST_PREFIX}/share/"
system "mkdir", "-p", dest FileUtils.mkdir_p dest
FileUtils.cp_r Dir.pwd, dest FileUtils.cp_r Dir.pwd, dest
# make a symbolic link for #{CREW_PREFIX}/bin/{go,gofmt} # make a symbolic link for #{CREW_PREFIX}/bin/{go,gofmt}
system "mkdir", "-p", "#{CREW_DEST_PREFIX}/bin" FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/bin"
system "ln", "-s", "#{CREW_PREFIX}/share/go/bin/go", "#{CREW_DEST_PREFIX}/bin" FileUtils.ln_s "#{CREW_PREFIX}/share/go/bin/go", "#{CREW_DEST_PREFIX}/bin"
system "ln", "-s", "#{CREW_PREFIX}/share/go/bin/gofmt", "#{CREW_DEST_PREFIX}/bin" FileUtils.ln_s "#{CREW_PREFIX}/share/go/bin/gofmt", "#{CREW_DEST_PREFIX}/bin"
end end
def self.postinstall def self.postinstall
...@@ -63,10 +75,4 @@ class Go < Package ...@@ -63,10 +75,4 @@ class Go < Package
puts "export TMPDIR=#{CREW_PREFIX}/tmp".lightblue puts "export TMPDIR=#{CREW_PREFIX}/tmp".lightblue
puts puts
end end
def self.check
FileUtils.cd('src') do
system "PATH=\"#{Dir.pwd}/../bin:$PATH\" GOROOT=\"#{Dir.pwd}/..\" TMPDIR=\"#{CREW_PREFIX}/tmp\" go tool dist test"
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