|
|
|
name=go
|
|
|
|
version=1.7.3
|
|
|
|
bootstrap_version=1.4.3
|
|
|
|
update_url='https://golang.org/dl/'
|
|
|
|
|
|
|
|
define_option '!bootstrap: Build for the first time'
|
|
|
|
|
|
|
|
dlextract "https://storage.googleapis.com/golang/$name$version.src.tar.gz" \
|
|
|
|
'83d1b7bd4281479ab7d153e5152c9fc9'
|
|
|
|
|
|
|
|
if option bootstrap; then
|
|
|
|
download "https://storage.googleapis.com/golang/$name$bootstrap_version.src.tar.gz" \
|
|
|
|
'dfb604511115dd402a77a553a5923a04'
|
|
|
|
fi
|
|
|
|
header_end
|
|
|
|
|
|
|
|
if option bootstrap; then
|
|
|
|
mkdir bootstrap; cd bootstrap
|
|
|
|
extract "$name$bootstrap_version.src.tar.gz"
|
|
|
|
|
|
|
|
cd "$name/src"
|
|
|
|
CGO_ENABLED=0 ./make.bash
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
GOROOT_BOOTSTRAP="$PWD"
|
|
|
|
cd ../..
|
|
|
|
else
|
|
|
|
GOROOT_BOOTSTRAP="$dir_sysroot/$dir_prefix/$dir_libdir/$name"
|
|
|
|
fi
|
|
|
|
|
|
|
|
cd "$name/src"
|
|
|
|
GOROOT_BOOTSTRAP="$GOROOT_BOOTSTRAP" \
|
|
|
|
GOROOT_FINAL="$dir_sysroot/$dir_prefix/$dir_libdir/$name" \
|
|
|
|
./make.bash
|
|
|
|
cd ..
|
|
|
|
|
|
|
|
rm -rf pkg/bootstrap pkg/obj
|
|
|
|
|
|
|
|
mkdir -p "$dir_install/$dir_prefix/$dir_libdir/$name"
|
|
|
|
cp -at "$dir_install/$dir_prefix/$dir_libdir/$name" bin pkg src
|
|
|
|
|
|
|
|
# Create symlinks
|
|
|
|
mkdir -p "$dir_install/$dir_prefix/$dir_bindir"
|
|
|
|
for x in bin/*; do
|
|
|
|
ln -s "$dir_sysroot/$dir_prefix/$dir_libdir/$name/$x" "$dir_install/$dir_prefix/$dir_bindir/$(basename "$x")"
|
|
|
|
done
|
|
|
|
|
|
|
|
# Set global GOPATH for external libraries
|
|
|
|
echo "export GOPATH=\"$dir_sysroot/$dir_prefix/$dir_libdir/$name/site\"" > go.sh
|
|
|
|
install -Dm755 -t "$dir_install/$dir_sysconfdir/profile.d" go.sh
|
|
|
|
|
|
|
|
# vim:set tabstop=4 shiftwidth=4 syntax=sh et:
|