Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
chromebrew
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
chromebrew
Commits
a75b5877
Commit
a75b5877
authored
Aug 13, 2017
by
Damian Montero
Committed by
GitHub
Aug 13, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1021 from jam7/update/go
Change go.rb to set pre-defined GOROOT
parents
26d6b3e7
7e89ddf1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
17 deletions
+18
-17
packages/go.rb
packages/go.rb
+18
-17
No files found.
packages/go.rb
View file @
a75b5877
...
...
@@ -3,15 +3,15 @@ require 'package'
class
Go
<
Package
description
'Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.'
homepage
'https://golang.org/'
version
'1.8.3'
version
'1.8.3
-1
'
source_url
'https://storage.googleapis.com/golang/go1.8.3.src.tar.gz'
source_sha256
'5f5dea2447e7dcfdc50fa6b94c512e58bfba5673c039259fd843f68829d99fa6'
# Tests requires perl
depends_on
'perl'
depends_on
'perl'
=>
:build
# go is required to build versions of go > 1.4
unless
File
.
exist?
"
#{
CREW_PREFIX
}
/lib/go/bin/go"
depends_on
'go_bootstrap'
depends_on
'go_bootstrap'
=>
:build
end
def
self
.
build
...
...
@@ -20,10 +20,13 @@ class Go < Package
unless
File
.
exist?
"
#{
CREW_PREFIX
}
/lib/go/bin/go"
system
"GOROOT_BOOTSTRAP=
#{
CREW_PREFIX
}
/lib/go_bootstrap/go \
TMPDIR=
#{
CREW_PREFIX
}
/tmp \
GOROOT_FINAL=
#{
CREW_PREFIX
}
/lib/go \
./make.bash"
else
system
"GOROOT_BOOTSTRAP=
#{
CREW_PREFIX
}
/lib/go \
TMPDIR=
#{
CREW_PREFIX
}
/tmp ./make.bash"
TMPDIR=
#{
CREW_PREFIX
}
/tmp \
GOROOT_FINAL=
#{
CREW_PREFIX
}
/lib/go \
./make.bash"
end
end
end
...
...
@@ -33,30 +36,28 @@ class Go < Package
system
"mkdir"
,
"-p"
,
dest
FileUtils
.
cp_r
Dir
.
pwd
,
dest
# make a symbolic link for /usr/local/bin/{go,gofmt}
system
"mkdir"
,
"-p"
,
"
#{
CREW_DEST_DIR
}#{
CREW_PREFIX
}
/bin"
system
"ln"
,
"-s"
,
"
#{
CREW_PREFIX
}
/lib/go/bin/go"
,
"
#{
CREW_DEST_DIR
}#{
CREW_PREFIX
}
/bin"
system
"ln"
,
"-s"
,
"
#{
CREW_PREFIX
}
/lib/go/bin/gofmt"
,
"
#{
CREW_DEST_DIR
}#{
CREW_PREFIX
}
/bin"
puts
"--------"
puts
"Installed Go for
#{
ARCH
}
in
#{
CREW_PREFIX
}
/lib/go"
puts
""
puts
"Make sure to set go environment variables."
puts
""
puts
"Minimal:"
puts
"
\t
export GOROOT=
#{
CREW_PREFIX
}
/lib/go"
puts
"
\t
export PATH=$PATH:$GOROOT/bin"
puts
""
puts
"To use `go run`:"
puts
"
\t
export TMPDIR=
#{
CREW_PREFIX
}
/tmp"
puts
""
puts
"To add environment variables, execute the following:"
.
lightblue
puts
""
puts
"echo 'export GOROOT=/usr/local/lib/go' >> ~/.bashrc"
.
lightblue
puts
"echo 'export PATH=$PATH:$GOROOT/bin' >> ~/.bashrc"
.
lightblue
puts
"echo 'export TMPDIR=/usr/local/tmp' >> ~/.bashrc"
.
lightblue
puts
"source ~/.bashrc"
.
lightblue
puts
"To develop with `go`:"
puts
"
\t
mkdir -p /usr/local/work/go"
puts
"
\t
ln -s /usr/local/work/go $HOME/go"
puts
"
\t
export PATH=
\"
$HOME/go/bin:$PATH
\"
"
puts
"
\t
export TMPDIR=
#{
CREW_PREFIX
}
/tmp"
puts
""
end
def
self
.
check
FileUtils
.
cd
(
'src'
)
do
system
"PATH=
\"
#{
Dir
.
pwd
}
/../bin:$PATH
\"
TMPDIR=
\"
#{
CREW_PREFIX
}
/tmp
\"
go tool dist test"
system
"PATH=
\"
#{
Dir
.
pwd
}
/../bin:$PATH
\"
GOROOT=
\"
#{
Dir
.
pwd
}
/..
\"
TMPDIR=
\"
#{
CREW_PREFIX
}
/tmp
\"
go tool dist test"
end
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment