summaryrefslogtreecommitdiffstats
path: root/recipes-containers/kubernetes/go-native.inc
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2019-12-09 16:10:59 +0800
committerBruce Ashfield <bruce.ashfield@gmail.com>2019-12-10 02:26:15 -0500
commit06dad20a32c81b6a8b6e93c99cda6f1133abddc6 (patch)
tree330233c2bf4c12dfa7d2bed28384ca1ede512b38 /recipes-containers/kubernetes/go-native.inc
parentc31e46fce79f32a6692358105e15d77c652a9c9a (diff)
downloadmeta-virtualization-06dad20a32c81b6a8b6e93c99cda6f1133abddc6.tar.gz
go: add back 1.12 version to avoid compilation failure
go 1.12 was removed from oe-core, but currently k8s cannot be built successfully with go 1.13. See link below. https://github.com/kubernetes/kubernetes/issues/82531 We need to wait for k8s to support go 1.13 and update it to latest release, as well as its depedencies. Before this is done, add back go 1.12 and use it. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
Diffstat (limited to 'recipes-containers/kubernetes/go-native.inc')
-rw-r--r--recipes-containers/kubernetes/go-native.inc55
1 files changed, 55 insertions, 0 deletions
diff --git a/recipes-containers/kubernetes/go-native.inc b/recipes-containers/kubernetes/go-native.inc
new file mode 100644
index 00000000..20770874
--- /dev/null
+++ b/recipes-containers/kubernetes/go-native.inc
@@ -0,0 +1,55 @@
1inherit native
2
3SRC_URI_append = " https://dl.google.com/go/go1.4-bootstrap-20171003.tar.gz;name=bootstrap;subdir=go1.4"
4SRC_URI[bootstrap.md5sum] = "dbf727a4b0e365bf88d97cbfde590016"
5SRC_URI[bootstrap.sha256sum] = "f4ff5b5eb3a3cae1c993723f3eab519c5bae18866b5e5f96fe1102f0cb5c3e52"
6
7export GOOS = "${BUILD_GOOS}"
8export GOARCH = "${BUILD_GOARCH}"
9CC = "${@d.getVar('BUILD_CC').strip()}"
10
11GOMAKEARGS ?= "--no-banner"
12
13do_configure() {
14 cd ${WORKDIR}/go1.4/go/src
15 CGO_ENABLED=0 GOROOT=${WORKDIR}/go1.4/go ./make.bash
16}
17
18do_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}
26do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin"
27do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin"
28
29make_wrapper() {
30 rm -f ${D}${bindir}/$2$3
31 cat <<END >${D}${bindir}/$2$3
32#!/bin/bash
33here=\`dirname \$0\`
34export GOROOT="${GOROOT:-\`readlink -f \$here/../lib/go\`}"
35\$here/../lib/go/bin/$1 "\$@"
36END
37 chmod +x ${D}${bindir}/$2
38}
39
40do_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}