diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2019-12-09 16:10:59 +0800 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@gmail.com> | 2019-12-10 02:26:15 -0500 |
commit | 06dad20a32c81b6a8b6e93c99cda6f1133abddc6 (patch) | |
tree | 330233c2bf4c12dfa7d2bed28384ca1ede512b38 /recipes-containers/kubernetes/go-target.inc | |
parent | c31e46fce79f32a6692358105e15d77c652a9c9a (diff) | |
download | meta-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.inc | 54 |
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 @@ | |||
1 | DEPENDS = "virtual/${TUNE_PKGARCH}-go go-native" | ||
2 | DEPENDS_class-nativesdk = "virtual/${TARGET_PREFIX}go-crosssdk go-native" | ||
3 | |||
4 | export GOHOSTOS = "${BUILD_GOOS}" | ||
5 | export GOHOSTARCH = "${BUILD_GOARCH}" | ||
6 | export GOOS = "${TARGET_GOOS}" | ||
7 | export GOARCH = "${TARGET_GOARCH}" | ||
8 | export GOARM = "${TARGET_GOARM}" | ||
9 | export GO386 = "${TARGET_GO386}" | ||
10 | export GOMIPS = "${TARGET_GOMIPS}" | ||
11 | export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" | ||
12 | export GOROOT_FINAL = "${libdir}/go" | ||
13 | export GOCACHE = "${B}/.cache" | ||
14 | GO_LDFLAGS = "" | ||
15 | GO_LDFLAGS_class-nativesdk = "-linkmode external" | ||
16 | export GO_LDFLAGS | ||
17 | |||
18 | CC_append_class-nativesdk = " ${SECURITY_NOPIE_CFLAGS}" | ||
19 | |||
20 | do_configure[noexec] = "1" | ||
21 | |||
22 | do_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 | } | ||
30 | do_compile[dirs] =+ "${GOTMPDIR} ${B}/bin ${B}/pkg" | ||
31 | do_compile[cleandirs] += "${GOTMPDIR} ${B}/bin ${B}/pkg" | ||
32 | |||
33 | do_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 | |||
48 | PACKAGES = "${PN} ${PN}-dev" | ||
49 | FILES_${PN} = "${libdir}/go/bin ${libdir}/go/pkg/tool/${TARGET_GOTUPLE} ${bindir}" | ||
50 | FILES_${PN}-dev = "${libdir}/go" | ||
51 | RDEPENDS_${PN}-dev = "perl bash" | ||
52 | INSANE_SKIP_${PN} = "ldflags" | ||
53 | |||
54 | BBCLASSEXTEND = "nativesdk" | ||