Browse Source

go: Update to 1.21

master
mid-kid 8 months ago
parent
commit
021f9a4b0e
  1. 11
      go/build.sh
  2. 2
      go/build_bootstrap.sh
  3. 8
      go/build_go.sh
  4. 32
      go/build_go19.sh
  5. 6
      go/download.sh
  6. 5
      go/download.sha256
  7. 11
      go/install_gentoo.txt

11
go/build.sh

@ -3,6 +3,11 @@ set -eu
export MAKEFLAGS="-j${NPROC:-$(nproc)}"
[ ! -d build/install-bootstrap ] && ./build_bootstrap.sh
[ ! -d build/install-go19 ] && ./build_go19.sh
[ ! -d build/install-go ] && ./build_go.sh
version_go=1.22.0 # https://golang.org/dl/
version_go21=1.21.7
version_go19=1.19.13
[ ! -d build/install-go1.4 ] && ./build_bootstrap.sh
[ ! -d build/install-go1.19 ] && ./build_go.sh 1.4 1.19 "$version_go19"
[ ! -d build/install-go1.21 ] && ./build_go.sh 1.19 1.21 "$version_go21"
[ ! -d build/install-go ] && ./build_go.sh 1.21 '' "$version_go"

2
go/build_bootstrap.sh

@ -5,7 +5,7 @@ version_bootstrap=20171003
dir_download="$PWD/download"
mkdir -p build; cd build
dir_install="$PWD/install-bootstrap"
dir_install="$PWD/install-go1.4"
# Prepare source
mkdir -p "go1.4-bootstrap-$version_bootstrap"

8
go/build_go.sh

@ -1,11 +1,13 @@
#!/bin/sh
set -eu
version_go=1.21.0
version_boot="$1"
version_dest="$2"
version_go="$3"
dir_download="$PWD/download"
mkdir -p build; cd build
dir_install="$PWD/install-go"
dir_install="$PWD/install-go$version_dest"
# Prepare source
mkdir -p "go$version_go"
@ -13,7 +15,7 @@ tar xf "$dir_download/go$version_go.src.tar.gz" -C "go$version_go" --strip-compo
cd "go$version_go"
# Build and install
(cd src; GOROOT_BOOTSTRAP="$PWD/../../install-go19" ./make.bash)
(cd src; GOROOT_BOOTSTRAP="$PWD/../../install-go$version_boot" ./make.bash)
find src -type f \( ! -name '*.go' \
-a ! -name '*.c' \

32
go/build_go19.sh

@ -1,32 +0,0 @@
#!/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

6
go/download.sh

@ -1,14 +1,16 @@
#!/bin/sh
set -eu
version_go=1.21.0 # https://golang.org/dl/
version_go19=1.19.12
version_go=1.22.0 # https://golang.org/dl/
version_go21=1.21.7
version_go19=1.19.13
version_bootstrap=20171003 # https://golang.org/doc/install/source#go14
mkdir -p download
cd download
wget -c "https://dl.google.com/go/go$version_go.src.tar.gz"
wget -c "https://dl.google.com/go/go$version_go21.src.tar.gz"
wget -c "https://dl.google.com/go/go$version_go19.src.tar.gz"
wget -c "https://dl.google.com/go/go1.4-bootstrap-$version_bootstrap.tar.gz"

5
go/download.sha256

@ -1,3 +1,4 @@
ee5d50e0a7fd74ba1b137cb879609aaaef9880bf72b5d1742100e38ae72bb557 go1.19.12.src.tar.gz
818d46ede85682dd551ad378ef37a4d247006f12ec59b5b755601d2ce114369a go1.21.0.src.tar.gz
ccf36b53fb0024a017353c3ddb22c1f00bc7a8073c6aac79042da24ee34434d3 go1.19.13.src.tar.gz
00197ab20f33813832bff62fd93cca1c42a08cc689a32a6672ca49591959bff6 go1.21.7.src.tar.gz
4d196c3d41a0d6c1dfc64d04e3cc1f608b0c436bd87b7060ce3e23234e1f4d5c go1.22.0.src.tar.gz
f4ff5b5eb3a3cae1c993723f3eab519c5bae18866b5e5f96fe1102f0cb5c3e52 go1.4-bootstrap-20171003.tar.gz

11
go/install_gentoo.txt

@ -0,0 +1,11 @@
# Update with GO_BOOTSTRAP_MIN version in dev-lang/go
GO_BOOTSTRAP_MIN=1.20.14
sudo rsync -rvP build/install-go/ /usr/lib/go-bootstrap
sudo mkdir -p /var/db/pkg/dev-lang/go-bootstrap-$GO_BOOTSTRAP_MIN
echo 0 | sudo tee /var/db/pkg/dev-lang/go-bootstrap-$GO_BOOTSTRAP_MIN/SLOT > /dev/null
sudo emerge dev-lang/go
sudo rm -rf /usr/lib/go-bootstrap
sudo rm -rf /var/db/pkg/dev-lang/go-bootstrap-$GO_BOOTSTRAP_MIN
Loading…
Cancel
Save