Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
bee-files/go.be0
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
executable file
153 lines (108 sloc)
4.47 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env beesh | |
# BEE_VERSION go-1.23.2-0 | |
# see also: https://golang.org/doc/install/source | |
# Go <= 1.4: a C toolchain. | |
# 1.5 <= Go <= 1.19: a Go 1.4 compiler. | |
# 1.20 <= Go <= 1.21: a Go 1.17 compiler. | |
# 1.22 <= Go <= 1.23: a Go 1.20 compiler. | |
# Going forward, Go version 1.N will require a Go 1.M compiler, where M is N-2 rounded down to an even number. Example: Go 1.24 and 1.25 require Go 1.22. | |
# SRCURL[0]="https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz" | |
#SRCURL[1]="https://redirector.gvt1.com/edgedl/go/go${PKGVERSION}.src.tar.gz" | |
SRCURL[0]="https://beehive.molgen.mpg.de/dbf727a4b0e365bf88d97cbfde590016/go1.4-bootstrap-20171003.tar.gz" | |
SRCURL[1]="https://beehive.molgen.mpg.de/4476707f05cf6915ec1173038dc357a9/go1.17.13.src.tar.gz" | |
#SRCURL[2]="https://go.dev/dl/go1.20.6.src.tar.gz" | |
SRCURL[2]="https://beehive.molgen.mpg.de/1dc2d18790cfaede7df1e73a1eff8b7b/go1.20.6.src.tar.gz" | |
# SRCURL[3]="https://go.dev/dl/go1.22.0.src.tar.gz" | |
SRCURL[3]="https://beehive.molgen.mpg.de/a1918eb3b5daba5b9eb58090944db1bd/go1.22.0.src.tar.gz" | |
# SRCURL[4]="https://go.dev/dl/go1.23.2.src.tar.gz" | |
SRCURL[4]="https://beehive.molgen.mpg.de/12f74843bb7a1d0abfcd41c65c0e6372/go1.23.2.src.tar.gz" | |
# PATCHURL+=() | |
# build_in_sourcedir | |
# sourcesubdir_append src | |
mee_extract() { | |
# extract bootstrap version of go-1.4 to arbitrary location | |
mkdir -p ${B}/bootstrap-1.4 | |
bee_extract_do_tar "${1}" ${B}/bootstrap-1.4 --strip-components 1 | |
shift | |
mkdir ${B}/bootstrap-1.17.13 | |
bee_extract_do_tar "${1}" ${B}/bootstrap-1.17.13 --strip-components 1 | |
shift | |
mkdir ${B}/bootstrap-1.20.6 | |
bee_extract_do_tar "${1}" ${B}/bootstrap-1.20.6 --strip-components 1 | |
shift | |
mkdir ${B}/bootstrap-1.22.0 | |
bee_extract_do_tar "${1}" ${B}/bootstrap-1.22.0 --strip-components 1 | |
shift | |
bee_extract "${@}" | |
} | |
#mee_patch() { | |
# bee_patch "${@}" | |
#} | |
#mee_configure() { | |
# bee_configure | |
#}mee_install() | |
mee_build() { | |
# going to build 1.4 | |
cd ${B}/bootstrap-1.4/src | |
# https://github.com/golang/go/issues/16906 "cannot load DWARF output ..." | |
CGO_ENABLED=0 \ | |
CFLAGS='-Wno-implicit-fallthrough -Wno-shift-negative-value' \ | |
./make.bash | |
echo "---- bootstrap 1.4 built ----" | |
# going to build 1.17.13 with 1.4 | |
cd ${B}/bootstrap-1.17.13/src | |
# https://github.com/golang/go/issues/16906 "cannot load DWARF output ..." | |
export GOROOT_BOOTSTRAP=${B}/bootstrap-1.4 | |
CGO_ENABLED=0 \ | |
CFLAGS='-Wno-implicit-fallthrough -Wno-shift-negative-value' \ | |
./make.bash | |
echo "---- bootstrap 1.17.13 built ----" | |
# going to build 1.20.6 with 1.17.13 with 1.4 | |
cd ${B}/bootstrap-1.20.6/src | |
# https://github.com/golang/go/issues/16906 "cannot load DWARF output ..." | |
export GOROOT_BOOTSTRAP=${B}/bootstrap-1.17.13 | |
CGO_ENABLED=0 \ | |
CFLAGS='-Wno-implicit-fallthrough -Wno-shift-negative-value' \ | |
./make.bash | |
echo "---- bootstrap 1.20.6 built ----" | |
# going to build 1.22.0 with 1.20.6 with 1.17.13 with 1.4 | |
cd ${B}/bootstrap-1.22.0/src | |
export GOROOT_BOOTSTRAP=${B}/bootstrap-1.20.6 | |
CGO_ENABLED=0 \ | |
CFLAGS='-Wno-implicit-fallthrough -Wno-shift-negative-value' \ | |
./make.bash | |
echo "---- bootstrap 1.22.0 built ----" | |
# going to build 1.23.2. with 1.22.0 with 1.20.6 with 1.17.13 with 1.4 | |
cd ${S}/src | |
# export GOROOT_BOOTSTRAP=${B}/bootstrap-1.22.0 | |
GOROOT_BOOTSTRAP=${B}/bootstrap-1.22.0 \ | |
./make.bash --no-banner | |
# $GOTOOLDIR/dist banner | |
} | |
mee_install() { | |
# The binaries expect /scratch/local/bee-root/go/go-1.10-0/source to be copied or moved to /usr/lib/go | |
# GOROOT_FINAL soll weg | |
# https://github.com/golang/go/issues/61921 | |
mkdir -pv ${D}${LIBDIR}/go/bin | |
cp -rv ${S}/bin/. ${D}${LIBDIR}/go/bin | |
mkdir -pv ${D}${BINDIR} | |
ln -vs ${LIBDIR}/go/bin/go ${D}${BINDIR} | |
ln -vs ${LIBDIR}/go/bin/gofmt ${D}${BINDIR} | |
mkdir -pv ${D}${LIBDIR}/go/src | |
# Install standardlibs https://golang.org/pkg/#stdlib | |
mkdir -pv ${D}${LIBDIR}/go/src | |
cd ${S}/src | |
for i in *; do | |
if [ -d "${i}" ]; then | |
cp -rv ${i} ${D}${LIBDIR}/go/src | |
fi | |
done | |
# fix "golang.org/x/mod@v0.12.0: GOPROXY list is not the empty string, but contains no entries" | |
# Install env | |
cp -v ${S}/go.env ${D}${LIBDIR}/go | |
# Install tools for go | |
mkdir -pv ${D}${LIBDIR}/go/pkg | |
cp -rv ${S}/pkg/tool ${D}${LIBDIR}/go/pkg | |
cp -rv ${S}/pkg/include ${D}${LIBDIR}/go/pkg | |
GOBIN=${D}${BINDIR} GO111MODULE=on ${D}${BINDIR}/go install golang.org/x/tools/cmd/goimports@latest | |
} |