diff options
| author | Ross Burton <ross.burton@arm.com> | 2020-06-16 18:04:59 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-06-24 18:06:43 +0100 |
| commit | 38d4e3725981c9f285496cda506989a6f1173131 (patch) | |
| tree | 35c5885d7bd26084747e371cb92d93a64e079997 /meta/recipes-devtools/go | |
| parent | 8ea016b0efc22e7b4bf54d8a9dce63de855ae9bb (diff) | |
| download | poky-38d4e3725981c9f285496cda506989a6f1173131.tar.gz | |
go-native: merge bb/inc and add comment
Merge the .bb/.inc, and add an explanatory comment.
(From OE-Core rev: cb9eda76f53efa901d8eaadaedc456b9d29cd748)
Signed-off-by: Ross Burton <ross.burton@arm.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/go')
| -rw-r--r-- | meta/recipes-devtools/go/go-native.inc | 55 | ||||
| -rw-r--r-- | meta/recipes-devtools/go/go-native_1.14.bb | 60 |
2 files changed, 59 insertions, 56 deletions
diff --git a/meta/recipes-devtools/go/go-native.inc b/meta/recipes-devtools/go/go-native.inc deleted file mode 100644 index 207708745e..0000000000 --- a/meta/recipes-devtools/go/go-native.inc +++ /dev/null | |||
| @@ -1,55 +0,0 @@ | |||
| 1 | inherit native | ||
| 2 | |||
| 3 | SRC_URI_append = " https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz;name=bootstrap;subdir=go1.4" | ||
| 4 | SRC_URI[bootstrap.md5sum] = "dbf727a4b0e365bf88d97cbfde590016" | ||
| 5 | SRC_URI[bootstrap.sha256sum] = "f4ff5b5eb3a3cae1c993723f3eab519c5bae18866b5e5f96fe1102f0cb5c3e52" | ||
| 6 | |||
| 7 | export GOOS = "${BUILD_GOOS}" | ||
| 8 | export GOARCH = "${BUILD_GOARCH}" | ||
| 9 | CC = "${@d.getVar('BUILD_CC').strip()}" | ||
| 10 | |||
| 11 | GOMAKEARGS ?= "--no-banner" | ||
| 12 | |||
| 13 | do_configure() { | ||
| 14 | cd ${WORKDIR}/go1.4/go/src | ||
| 15 | CGO_ENABLED=0 GOROOT=${WORKDIR}/go1.4/go ./make.bash | ||
| 16 | } | ||
| 17 | |||
| 18 | do_compile() { | ||
| 19 | export GOROOT_FINAL="${libdir_native}/go" | ||
| 20 | export GOROOT_BOOTSTRAP="${WORKDIR}/go1.4/go" | ||
| 21 | |||
| 22 | cd src | ||
| 23 | ./make.bash ${GOMAKEARGS} | ||
| 24 | cd ${B} | ||
| 25 | } | ||
| 26 | do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin" | ||
| 27 | do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin" | ||
| 28 | |||
| 29 | make_wrapper() { | ||
| 30 | rm -f ${D}${bindir}/$2$3 | ||
| 31 | cat <<END >${D}${bindir}/$2$3 | ||
| 32 | #!/bin/bash | ||
| 33 | here=\`dirname \$0\` | ||
| 34 | export GOROOT="${GOROOT:-\`readlink -f \$here/../lib/go\`}" | ||
| 35 | \$here/../lib/go/bin/$1 "\$@" | ||
| 36 | END | ||
| 37 | chmod +x ${D}${bindir}/$2 | ||
| 38 | } | ||
| 39 | |||
| 40 | do_install() { | ||
| 41 | install -d ${D}${libdir}/go | ||
| 42 | cp --preserve=mode,timestamps -R ${B}/pkg ${D}${libdir}/go/ | ||
| 43 | install -d ${D}${libdir}/go/src | ||
| 44 | (cd ${S}/src; for d in *; do \ | ||
| 45 | [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \ | ||
| 46 | done) | ||
| 47 | find ${D}${libdir}/go/src -depth -type d -name testdata -exec rm -rf {} \; | ||
| 48 | install -d ${D}${bindir} ${D}${libdir}/go/bin | ||
| 49 | for f in ${B}/bin/* | ||
| 50 | do | ||
| 51 | base=`basename $f` | ||
| 52 | install -m755 $f ${D}${libdir}/go/bin | ||
| 53 | make_wrapper $base $base | ||
| 54 | done | ||
| 55 | } | ||
diff --git a/meta/recipes-devtools/go/go-native_1.14.bb b/meta/recipes-devtools/go/go-native_1.14.bb index bbf3c0dd73..c5cb97e73e 100644 --- a/meta/recipes-devtools/go/go-native_1.14.bb +++ b/meta/recipes-devtools/go/go-native_1.14.bb | |||
| @@ -1,2 +1,60 @@ | |||
| 1 | require ${PN}.inc | 1 | # This recipe builds a native Go (written in Go) by first building an old Go 1.4 |
| 2 | # (written in C). However this old Go does not support all hosts platforms. | ||
| 3 | |||
| 2 | require go-${PV}.inc | 4 | require go-${PV}.inc |
| 5 | |||
| 6 | inherit native | ||
| 7 | |||
| 8 | SRC_URI_append = " https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz;name=bootstrap;subdir=go1.4" | ||
| 9 | SRC_URI[bootstrap.md5sum] = "dbf727a4b0e365bf88d97cbfde590016" | ||
| 10 | SRC_URI[bootstrap.sha256sum] = "f4ff5b5eb3a3cae1c993723f3eab519c5bae18866b5e5f96fe1102f0cb5c3e52" | ||
| 11 | |||
| 12 | export GOOS = "${BUILD_GOOS}" | ||
| 13 | export GOARCH = "${BUILD_GOARCH}" | ||
| 14 | CC = "${@d.getVar('BUILD_CC').strip()}" | ||
| 15 | |||
| 16 | GOMAKEARGS ?= "--no-banner" | ||
| 17 | |||
| 18 | do_configure() { | ||
| 19 | cd ${WORKDIR}/go1.4/go/src | ||
| 20 | CGO_ENABLED=0 GOROOT=${WORKDIR}/go1.4/go ./make.bash | ||
| 21 | } | ||
| 22 | |||
| 23 | do_compile() { | ||
| 24 | export GOROOT_FINAL="${libdir_native}/go" | ||
| 25 | export GOROOT_BOOTSTRAP="${WORKDIR}/go1.4/go" | ||
| 26 | |||
| 27 | cd src | ||
| 28 | ./make.bash ${GOMAKEARGS} | ||
| 29 | cd ${B} | ||
| 30 | } | ||
| 31 | do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin" | ||
| 32 | do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin" | ||
| 33 | |||
| 34 | make_wrapper() { | ||
| 35 | rm -f ${D}${bindir}/$2$3 | ||
| 36 | cat <<END >${D}${bindir}/$2$3 | ||
| 37 | #!/bin/bash | ||
| 38 | here=\`dirname \$0\` | ||
| 39 | export GOROOT="${GOROOT:-\`readlink -f \$here/../lib/go\`}" | ||
| 40 | \$here/../lib/go/bin/$1 "\$@" | ||
| 41 | END | ||
| 42 | chmod +x ${D}${bindir}/$2 | ||
| 43 | } | ||
| 44 | |||
| 45 | do_install() { | ||
| 46 | install -d ${D}${libdir}/go | ||
| 47 | cp --preserve=mode,timestamps -R ${B}/pkg ${D}${libdir}/go/ | ||
| 48 | install -d ${D}${libdir}/go/src | ||
| 49 | (cd ${S}/src; for d in *; do \ | ||
| 50 | [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \ | ||
| 51 | done) | ||
| 52 | find ${D}${libdir}/go/src -depth -type d -name testdata -exec rm -rf {} \; | ||
| 53 | install -d ${D}${bindir} ${D}${libdir}/go/bin | ||
| 54 | for f in ${B}/bin/* | ||
| 55 | do | ||
| 56 | base=`basename $f` | ||
| 57 | install -m755 $f ${D}${libdir}/go/bin | ||
| 58 | make_wrapper $base $base | ||
| 59 | done | ||
| 60 | } | ||
