You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.4 KiB
53 lines
1.4 KiB
8 years ago
|
name=go
|
||
8 years ago
|
version=1.7.4
|
||
8 years ago
|
bootstrap_version=1.4.3
|
||
|
update_url='https://golang.org/dl/'
|
||
|
|
||
8 years ago
|
define_option '!bootstrap: Bootstrap this program'
|
||
8 years ago
|
|
||
|
dlextract "https://storage.googleapis.com/golang/$name$version.src.tar.gz" \
|
||
8 years ago
|
'49c1076428a5d3b5ad7ac65233fcca2f'
|
||
8 years ago
|
|
||
|
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
|
||
|
|
||
8 years ago
|
# vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab:
|