#!/bin/sh set -eu version_go19=1.19.12 dir_download="$PWD/download" mkdir -p build; cd build dir_install="$PWD/install-go19" # Prepare source mkdir -p "go$version_go19" tar xf "$dir_download/go$version_go19.src.tar.gz" -C "go$version_go19" --strip-components 1 cd "go$version_go19" # Build and install (cd src; GOROOT_BOOTSTRAP="$PWD/../../install-bootstrap" ./make.bash) find src -type f \( ! -name '*.go' \ -a ! -name '*.c' \ -a ! -name '*.h' \ -a ! -name '*.s' \ -a ! -name '*.S' \ -a ! -name 'p256_asm_table.bin' \ \) -print -delete find src -type f -name '*_test.go' -print -delete find src -type d -name 'testdata' -print0 | xargs -0 rm -vrf find src -type d -empty -print -delete find pkg -type f -name '*.a' -print -delete find pkg -type d -empty -print -delete mkdir -p "$dir_install" cp -at "$dir_install" bin pkg src