abuild (661B)
1 name=go 2 version=1.25.1 3 release=1 4 source="https://${name}lang.org/dl/${name}${version}.src.tar.gz 5 https://golang.org/dl/go${version}.linux-amd64.tar.gz::noextract 6 make.sh" 7 8 build() { 9 if [ ! "$(which go)" ]; then 10 mkdir $SRC/gobin 11 tar xf $SRC/go${version}.linux-amd64.tar.gz -C $SRC/gobin 12 export GOROOT_BOOTSTRAP=$SRC/gobin/go 13 else 14 export GOROOT_BOOTSTRAP=/usr/lib/go 15 fi 16 17 export GOCACHE=$SRC/.go 18 export GOROOT_FINAL=/usr/lib/go 19 20 cd src 21 cp $SRC/make.sh . 22 chmod +x make.sh 23 ./make.sh 24 25 install -d $PKG/usr/lib 26 mv $SRC/go $PKG/usr/lib/ 27 28 install -d $PKG/usr/bin 29 ln -s /usr/lib/go/bin/go $PKG/usr/bin/ 30 ln -s /usr/lib/go/bin/gofmt $PKG/usr/bin/ 31 }