summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/go/go-crosssdk.inc55
-rw-r--r--meta/recipes-devtools/go/go-crosssdk_1.8.bb2
2 files changed, 57 insertions, 0 deletions
diff --git a/meta/recipes-devtools/go/go-crosssdk.inc b/meta/recipes-devtools/go/go-crosssdk.inc
new file mode 100644
index 0000000000..e9bc677131
--- /dev/null
+++ b/meta/recipes-devtools/go/go-crosssdk.inc
@@ -0,0 +1,55 @@
1inherit crosssdk
2
3DEPENDS = "go-native virtual/${TARGET_PREFIX}gcc-crosssdk virtual/nativesdk-${TARGET_PREFIX}compilerlibs virtual/${TARGET_PREFIX}binutils-crosssdk"
4PN = "go-crosssdk-${TARGET_ARCH}"
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"
13export CGO_ENABLED = "1"
14export CC_FOR_TARGET="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
15export CXX_FOR_TARGET="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}"
16CC = "${@d.getVar('BUILD_CC', True).strip()}"
17
18do_configure[noexec] = "1"
19
20do_compile() {
21 export GOBIN="${B}/bin"
22 rm -rf ${GOBIN} ${B}/pkg
23 mkdir ${GOBIN}
24 cd src
25 ./make.bash --host-only
26 cd ${B}
27}
28
29make_wrapper() {
30 rm -f ${D}${bindir}/$2
31 cat <<END >${D}${bindir}/$2
32#!/bin/bash
33here=\`dirname \$0\`
34export GOARCH="${TARGET_GOARCH}"
35export GOOS="${TARGET_GOOS}"
36\$here/../../lib/${CROSS_TARGET_SYS_DIR}/go/bin/$1 "\$@"
37END
38 chmod +x ${D}${bindir}/$2
39}
40
41do_install() {
42 install -d ${D}${libdir}/go
43 install -d ${D}${libdir}/go/bin
44 install -d ${D}${libdir}/go/pkg/tool
45 install -d ${D}${bindir}
46 cp --preserve=mode,timestamps -R ${S}/pkg/tool/${TARGET_GOTUPLE} ${D}${libdir}/go/pkg/tool/
47 for f in ${B}/${GO_BUILD_BINDIR}/*
48 do
49 base=`basename $f`
50 install -m755 $f ${D}${libdir}/go/bin
51 make_wrapper $base ${TARGET_PREFIX}$base
52 done
53}
54
55FILES_${PN}-staticdev = "${libdir}/go/pkg"
diff --git a/meta/recipes-devtools/go/go-crosssdk_1.8.bb b/meta/recipes-devtools/go/go-crosssdk_1.8.bb
new file mode 100644
index 0000000000..1857c8a577
--- /dev/null
+++ b/meta/recipes-devtools/go/go-crosssdk_1.8.bb
@@ -0,0 +1,2 @@
1require go-crosssdk.inc
2require go-${PV}.inc