diff --git a/go.be0 b/go.be0 index 163eb58e1..c28c35bf2 100755 --- a/go.be0 +++ b/go.be0 @@ -1,8 +1,9 @@ #!/usr/bin/env beesh -# BEE_VERSION go-1.9.2-0 +# BEE_VERSION go-1.9.2-1 -SRCURL[0]="https://redirector.gvt1.com/edgedl/go/go${PKGVERSION}.src.tar.gz" +SRCURL[0]="https://storage.googleapis.com/golang/go1.4-bootstrap-20170531.tar.gz" +SRCURL[1]="https://redirector.gvt1.com/edgedl/go/go${PKGVERSION}.src.tar.gz" # PATCHURL+=() @@ -12,10 +13,13 @@ build_in_sourcedir sourcesubdir_append src - -#mee_extract() { -# bee_extract "${@}" -#} +mee_extract() { + # extract bootstrap version of go-1.4 to arbitrary location + mkdir ${S}/bootstrap + bee_extract_do_tar "${1}" ${S}/bootstrap --strip-components 1 + shift + bee_extract "${@}" +} #mee_patch() { # bee_patch "${@}" @@ -26,39 +30,48 @@ sourcesubdir_append src #} mee_build() { - export GOROOT_BOOTSTRAP=${PREFIX} \ - GOROOT_FINAL=${LIBDIR}/go-${PKGVERSION} - start_cmd ${S}/make.bash #${BEE_MAKEFLAGS} - exit + + cd ${S}/../bootstrap/src + ./make.bash + + cd ${S} + + export GOROOT_BOOTSTRAP=${S}/../bootstrap + export GOROOT_FINAL=${LIBDIR}/go + + ./make.bash } + mee_install() { - # Install Binaries - start_cmd mkdir -p ${D}${BINDIR} - start_cmd mkdir -p ${D}${LIBDIR}/go-${PKGVERSION} - start_cmd cp -r ${S}/../bin ${D}${LIBDIR}/go-${PKGVERSION} - cd ${D}${BINDIR} - start_cmd ln -s ../lib/go-${PKGVERSION}/bin/go go - start_cmd ln -s ../lib/go-${PKGVERSION}/bin/gofmt gofmt + # The binaries expect /scratch/local/bee-root/go/go-1.9.2-1/source to be copied or moved to /usr/lib/go + mkdir -p ${D}${BINDIR} + + cp -r ${S}/../bin/. ${D}${BINDIR} + + mkdir -p ${D}${LIBDIR}/go + + # strace -s 200 -e file ${S}/../bin/go install -buildmode=shared std # Install standardlibs https://golang.org/pkg/#stdlib - LIBS="archive bufio builtin bytes compress container context crypto database \ - debug encoding errors expvar flag fmt go hash html image index internal io \ - log math mime net os path plugin reflect regexp runtime sort strconv strings \ - sync syscall testing text time unicode unsafe" - start_cmd ${S}/../bin/go install -buildmode=shared std + LIBS="builtin context debug expvar go image io math \ + path runtime strings testing unicode bufio bytes \ + compress crypto encoding flag hash index mime net plugin reflect \ + sort sync text unsafe archive cmd container database errors \ + fmt html internal log os regexp strconv syscall time vendor" - start_cmd mkdir -p ${D}${LIBDIR}/go-${PKGVERSION}/src + echo "LIBS=${LIBS}" + + mkdir -p ${D}${LIBDIR}/go/src for i in $LIBS; do - start_cmd cp -r ${S}/${i} ${D}${LIBDIR}/go-${PKGVERSION}/src + cp -r ${S}/${i} ${D}${LIBDIR}/go/src done #Install tools for go - start_cmd mkdir -p ${D}${LIBDIR}/go-${PKGVERSION}/pkg - start_cmd cp -r ${S}/../pkg/tool ${D}${LIBDIR}/go-${PKGVERSION}/pkg - start_cmd cp -r ${S}/../pkg/include ${D}${LIBDIR}/go-${PKGVERSION}/pkg - start_cmd cp -r ${S}/../pkg/linux_amd64 ${D}${LIBDIR}/go-${PKGVERSION}/pkg - start_cmd cp -r ${S}/../pkg/linux_amd64_dynlink ${D}${LIBDIR}/go-${PKGVERSION}/pkg + mkdir -p ${D}${LIBDIR}/go/pkg + cp -r ${S}/../pkg/tool ${D}${LIBDIR}/go/pkg + cp -r ${S}/../pkg/include ${D}${LIBDIR}/go/pkg + cp -r ${S}/../pkg/linux_amd64 ${D}${LIBDIR}/go/pkg + } -## by default this may be 'make install DESTDIR="${D}"'