summaryrefslogtreecommitdiffstats
path: root/recipes-containers/kubernetes/go-target.inc
diff options
context:
space:
mode:
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"