summaryrefslogtreecommitdiffstats
path: root/recipes-containers/kubernetes/go-crosssdk.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-crosssdk.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-crosssdk.inc')
-rw-r--r--recipes-containers/kubernetes/go-crosssdk.inc50
1 files changed, 50 insertions, 0 deletions
diff --git a/recipes-containers/kubernetes/go-crosssdk.inc b/recipes-containers/kubernetes/go-crosssdk.inc
new file mode 100644
index 00000000..94f6fb8e
--- /dev/null
+++ b/recipes-containers/kubernetes/go-crosssdk.inc
@@ -0,0 +1,50 @@
1inherit crosssdk
2
3DEPENDS = "go-native virtual/${TARGET_PREFIX}gcc-crosssdk virtual/nativesdk-${TARGET_PREFIX}compilerlibs virtual/${TARGET_PREFIX}binutils-crosssdk"
4PN = "go-crosssdk-${SDK_SYS}"
5PROVIDES = "virtual/${TARGET_PREFIX}go-crosssdk"
6
7export GOHOSTOS = "${BUILD_GOOS}"
8export GOHOSTARCH = "${BUILD_GOARCH}"
9export GOOS = "${TARGET_GOOS}"
10export GOARCH = "${TARGET_GOARCH}"
11export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
12export GOROOT_FINAL = "${libdir}/go"
13
14do_configure[noexec] = "1"
15
16do_compile() {
17 export CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}${SDKPATHNATIVE}"
18 export CXX_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}${SDKPATHNATIVE}"
19 cd src
20 ./make.bash --host-only --no-banner
21 cd ${B}
22}
23do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg"
24do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg"
25
26make_wrapper() {
27 rm -f ${D}${bindir}/$2
28 cat <<END >${D}${bindir}/$2
29#!/bin/bash
30here=\`dirname \$0\`
31export GOARCH="${TARGET_GOARCH}"
32export GOOS="${TARGET_GOOS}"
33\$here/../../lib/${CROSS_TARGET_SYS_DIR}/go/bin/$1 "\$@"
34END
35 chmod +x ${D}${bindir}/$2
36}
37
38do_install() {
39 install -d ${D}${libdir}/go
40 install -d ${D}${libdir}/go/bin
41 install -d ${D}${libdir}/go/pkg/tool
42 install -d ${D}${bindir}
43 cp --preserve=mode,timestamps -R ${S}/pkg/tool/${BUILD_GOTUPLE} ${D}${libdir}/go/pkg/tool/
44 for f in ${B}/bin/*
45 do
46 base=`basename $f`
47 install -m755 $f ${D}${libdir}/go/bin
48 make_wrapper $base ${TARGET_PREFIX}$base
49 done
50}