Skip to content

Commit

Permalink
Merge pull request #2971 from mariux64/update-go-1211
Browse files Browse the repository at this point in the history
go: update from 1.20.4 to 1.21.1
  • Loading branch information
wwwutz authored Sep 7, 2023
2 parents 7995f77 + cf44d7e commit a0ea472
Showing 1 changed file with 31 additions and 22 deletions.
53 changes: 31 additions & 22 deletions go.be0
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
#!/usr/bin/env beesh

# BEE_VERSION go-1.20.4-0
# BEE_VERSION go-1.21.1-0

# see also: https://golang.org/doc/install/source

# 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"
# https://go.dev/dl/go1.20.4.src.tar.gz
SRCURL[2]="https://beehive.molgen.mpg.de/2ea74f4e87758e0fbeb4cc6d04d2e020/go1.20.4.src.tar.gz"
#SRCURL[2]="https://go.dev/dl/go1.21.1.src.tar.gz"
SRCURL[2]="https://beehive.molgen.mpg.de/00ef7b2f4c47990c37dd60bd15fa8c0f/go1.21.1.src.tar.gz"

# PATCHURL+=()

build_in_sourcedir
# build_in_sourcedir

sourcesubdir_append src
# sourcesubdir_append src

mee_extract() {
# extract bootstrap version of go-1.4 to arbitrary location
mkdir ${S}/bootstrap-1.4
bee_extract_do_tar "${1}" ${S}/bootstrap-1.4 --strip-components 1
mkdir -p ${B}/bootstrap-1.4
bee_extract_do_tar "${1}" ${B}/bootstrap-1.4 --strip-components 1
shift
mkdir ${S}/bootstrap-1.17.13
bee_extract_do_tar "${1}" ${S}/bootstrap-1.17.13 --strip-components 1
mkdir ${B}/bootstrap-1.17.13
bee_extract_do_tar "${1}" ${B}/bootstrap-1.17.13 --strip-components 1
shift
bee_extract "${@}"
}
Expand All @@ -38,7 +38,7 @@ mee_extract() {

mee_build() {

cd ${S}/../bootstrap-1.4/src
cd ${B}/bootstrap-1.4/src

# https://github.com/golang/go/issues/16906 "cannot load DWARF output ..."
CGO_ENABLED=0 \
Expand All @@ -47,39 +47,49 @@ mee_build() {

echo "---- bootstrap 1.4 built ----"

cd ${S}/../bootstrap-1.17.13/src
cd ${B}/bootstrap-1.17.13/src

# https://github.com/golang/go/issues/16906 "cannot load DWARF output ..."
export GOROOT_BOOTSTRAP=${S}/../bootstrap-1.4
export GOROOT_FINAL=${LIBDIR}/go
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 ----"

cd ${S}
cd ${S}/src

export GOROOT_BOOTSTRAP=${S}/../bootstrap-1.17.13
export GOROOT_BOOTSTRAP=${B}/bootstrap-1.17.13
export GOROOT_FINAL=${LIBDIR}/go
./make.bash --no-clean
. ./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}

cp -rv ${S}/../bin/. ${D}${BINDIR}
mkdir -pv ${D}${LIBDIR}/go/src

# strace -s 200 -e file ${S}/../bin/go install -buildmode=shared std

# Install standardlibs https://golang.org/pkg/#stdlib

mkdir -pv ${D}${LIBDIR}/go/src

cd ${S}
cd ${S}/src
for i in *; do
if [ -d "${i}" ]; then
cp -rv ${i} ${D}${LIBDIR}/go/src
Expand All @@ -88,7 +98,6 @@ mee_install() {

#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
# cp -rv ${S}/../pkg/linux_amd64 ${D}${LIBDIR}/go/pkg
cp -rv ${S}/pkg/tool ${D}${LIBDIR}/go/pkg
cp -rv ${S}/pkg/include ${D}${LIBDIR}/go/pkg
}

0 comments on commit a0ea472

Please sign in to comment.