added go build script
This commit is contained in:
parent
5c37849ce8
commit
b6e9552845
1 changed files with 51 additions and 0 deletions
51
build-go.sh
Executable file
51
build-go.sh
Executable file
|
|
@ -0,0 +1,51 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
GITHUB="https://github.com/golang/go/archive/"
|
||||||
|
|
||||||
|
V14="go1.4.3"
|
||||||
|
TGZ14="${V14}.tar.gz"
|
||||||
|
|
||||||
|
Vnew="go1.5.1"
|
||||||
|
TGZnew="${Vnew}.tar.gz"
|
||||||
|
|
||||||
|
INSTALL="/usr/local"
|
||||||
|
|
||||||
|
cd ${INSTALL}
|
||||||
|
|
||||||
|
rm -rf go*
|
||||||
|
|
||||||
|
wget -q ${GITHUB}${TGZ14}
|
||||||
|
tar xfz ${TGZ14}
|
||||||
|
mv go-${V14} ${V14}
|
||||||
|
|
||||||
|
wget -q ${GITHUB}${TGZnew}
|
||||||
|
tar xfz ${TGZnew}
|
||||||
|
mv go-${Vnew} ${Vnew}
|
||||||
|
|
||||||
|
export CGO_ENABLED=0
|
||||||
|
|
||||||
|
cd ${INSTALL}/${V14}/src
|
||||||
|
./make.bash &> /dev/null
|
||||||
|
|
||||||
|
export GOROOT_BOOTSTRAP=${INSTALL}/${V14}
|
||||||
|
|
||||||
|
cd ${INSTALL}/${Vnew}/src
|
||||||
|
./make.bash &> /dev/null
|
||||||
|
|
||||||
|
cd ${INSTALL}
|
||||||
|
rm -rf go
|
||||||
|
mv ${Vnew} go
|
||||||
|
|
||||||
|
export GOROOT="${INSTALL}/go"
|
||||||
|
export PATH="${PATH}:${GOROOT}/bin"
|
||||||
|
|
||||||
|
echo "add this to your .bashrc/.profile:"
|
||||||
|
echo ""
|
||||||
|
echo "export CGO_ENABLED=0"
|
||||||
|
echo "export GOPATH=~/go"
|
||||||
|
echo "export PATH=\${PATH}:${GOROOT}"
|
||||||
|
echo ""
|
||||||
|
|
||||||
|
go version
|
||||||
Loading…
Add table
Add a link
Reference in a new issue