summaryrefslogtreecommitdiffstats
path: root/recipes-containers/kubernetes/go-target.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-target.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-target.inc')
-rw-r--r--recipes-containers/kubernetes/go-target.inc54
1 files changed, 54 insertions, 0 deletions
diff --git a/recipes-containers/kubernetes/go-target.inc b/recipes-containers/kubernetes/go-target.inc
new file mode 100644
index 00000000..91efd3e9
--- /dev/null
+++ b/recipes-containers/kubernetes/go-target.inc
@@ -0,0 +1,54 @@
1DEPENDS = "virtual/${TUNE_PKGARCH}-go go-native"
2DEPENDS_class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk go-native"
3
4export GOHOSTOS = "${BUILD_GOOS}"
5export GOHOSTARCH = "${BUILD_GOARCH}"
6export GOOS = "${TARGET_GOOS}"
7export GOARCH = "${TARGET_GOARCH}"
8export GOARM = "${TARGET_GOARM}"
9export GO386 = "${TARGET_GO386}"
10export GOMIPS = "${TARGET_GOMIPS}"
11export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
12export GOROOT_FINAL = "${libdir}/go"
13export GOCACHE = "${B}/.cache"
14GO_LDFLAGS = ""
15GO_LDFLAGS_class-nativesdk = "-linkmode external"
16export GO_LDFLAGS
17
18CC_append_class-nativesdk = " ${SECURITY_NOPIE_CFLAGS}"
19
20do_configure[noexec] = "1"
21
22do_compile() {
23 export CC_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CC}"
24 export CXX_FOR_${TARGET_GOOS}_${TARGET_GOARCH}="${CXX}"
25
26 cd src
27 ./make.bash --target-only --no-banner
28 cd ${B}
29}
30do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg"
31do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg"
32
33do_install() {
34 install -d ${D}${libdir}/go/pkg/tool
35 cp --preserve=mode,timestamps -R ${B}/pkg/tool/${TARGET_GOTUPLE} ${D}${libdir}/go/pkg/tool/
36 install -d ${D}${libdir}/go/src
37 cp --preserve=mode,timestamps -R ${S}/src/cmd ${D}${libdir}/go/src/
38 find ${D}${libdir}/go/src -depth -type d -name testdata -exec rm -rf {} \;
39 install -d ${D}${libdir}/go/bin
40 install -d ${D}${bindir}
41 for f in ${B}/${GO_BUILD_BINDIR}/*; do
42 name=`basename $f`
43 install -m 0755 $f ${D}${libdir}/go/bin/
44 ln -sf ../${baselib}/go/bin/$name ${D}${bindir}/
45 done
46}
47
48PACKAGES = "${PN} ${PN}-dev"
49FILES_${PN} = "${libdir}/go/bin ${libdir}/go/pkg/tool/${TARGET_GOTUPLE} ${bindir}"
50FILES_${PN}-dev = "${libdir}/go"
51RDEPENDS_${PN}-dev = "perl bash"
52INSANE_SKIP_${PN} = "ldflags"
53
54BBCLASSEXTEND = "nativesdk"