name=go majver=1.8 version=$majver.3 bootstrap_version=1.4.3 update_url='https://golang.org/dl/' # Go doesn't like being stripped options="!strip,$options" define_option '!bootstrap: Bootstrap this program' dlextract "https://storage.googleapis.com/golang/$name$version.src.tar.gz" \ '64e9380e07bba907e26a00cf5fcbe77e' if option bootstrap; then download "https://storage.googleapis.com/golang/$name$bootstrap_version.src.tar.gz" \ 'dfb604511115dd402a77a553a5923a04' fi _ if option bootstrap; then mkdir bootstrap; cd bootstrap extract "$name$bootstrap_version.src.tar.gz" cd "$name/src" CGO_ENABLED=0 ./make.bash cd .. export GOROOT_BOOTSTRAP="$PWD" cd ../.. else export GOROOT_BOOTSTRAP="$GOROOT" fi cd "$name" export GOROOT="$PWD" ( cd src GOROOT_FINAL="/$dir_prefix/$dir_lib/go/$name$majver" \ ./make.bash ../bin/go install -buildmode=shared -linkshared std ) # Clean up a bit rm -rf pkg/bootstrap pkg/obj find src -type f \( ! -name "*.go" -a ! -name "*.c" -a ! -name "*.s" -a ! -name "*.S" -a ! -name "*.h" \) -delete find src -type d -empty -delete mkdir -p "$dir_install/$dir_prefix/$dir_lib/go/$name$majver" cp -at "$dir_install/$dir_prefix/$dir_lib/go/$name$majver" bin pkg src # Set global GOPATH for external libraries cat > go.sh << EOF export GOROOT="/$dir_prefix/$dir_lib/go/$name$majver" export PATH="\$PATH:\$GOROOT/bin" EOF install -Dm755 -t "$dir_install/$dir_prefix/$dir_sysconf/profile.d" go.sh # vim:set tabstop=4 shiftwidth=4 syntax=sh expandtab: