diff options
author | Zongchun Yu <zongchun.yu@nxp.com> | 2016-04-05 17:54:28 +0800 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2016-04-19 15:51:10 -0400 |
commit | 12c601cd2df52ad123b337647eeb990f46422a25 (patch) | |
tree | 9fd33cda1e85643fe6baa408ccb67bd0b4c166b4 /recipes-devtools/go-cross/go-native.inc | |
parent | 841dc6f3a2a77bda2a1cd2bb7bcd6f3e709699db (diff) | |
download | meta-virtualization-12c601cd2df52ad123b337647eeb990f46422a25.tar.gz |
go-cross: uprev to 1.5.2
* Add go-native as build bootstrap for go-cross.
* Upgrade go-cross to v1.5.2
Signed-off-by: Zongchun Yu <zongchun.yu@nxp.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'recipes-devtools/go-cross/go-native.inc')
-rw-r--r-- | recipes-devtools/go-cross/go-native.inc | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/recipes-devtools/go-cross/go-native.inc b/recipes-devtools/go-cross/go-native.inc new file mode 100644 index 00000000..ae3dc830 --- /dev/null +++ b/recipes-devtools/go-cross/go-native.inc | |||
@@ -0,0 +1,50 @@ | |||
1 | inherit native | ||
2 | |||
3 | export GOOS = "${BUILD_GOOS}" | ||
4 | export GOARCH = "${BUILD_GOARCH}" | ||
5 | export GOROOT_FINAL = "${STAGING_LIBDIR_NATIVE}/go" | ||
6 | export CGO_ENABLED = "1" | ||
7 | |||
8 | do_configure[noexec] = "1" | ||
9 | |||
10 | do_compile() { | ||
11 | export GOBIN="${B}/bin" | ||
12 | rm -rf ${GOBIN} | ||
13 | mkdir ${GOBIN} | ||
14 | cd src | ||
15 | ./make.bash --host-only | ||
16 | } | ||
17 | |||
18 | |||
19 | make_wrapper() { | ||
20 | rm -f ${D}${bindir}/$2 | ||
21 | cat <<END >${D}${bindir}/$2 | ||
22 | #!/bin/bash | ||
23 | here=\`dirname \$0\` | ||
24 | export GOROOT="${GOROOT:-\`readlink -f \$here/../lib/go\`}" | ||
25 | \$here/../lib/go/bin/$1 "\$@" | ||
26 | END | ||
27 | chmod +x ${D}${bindir}/$2 | ||
28 | } | ||
29 | |||
30 | do_install() { | ||
31 | install -d ${D}${libdir}/go | ||
32 | cp -a ${B}/pkg ${D}${libdir}/go/ | ||
33 | install -d ${D}${libdir}/go/src | ||
34 | (cd ${S}/src; for d in *; do \ | ||
35 | [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \ | ||
36 | done) | ||
37 | install -d ${D}${bindir} ${D}${libdir}/go/bin | ||
38 | for f in ${B}/bin/* | ||
39 | do | ||
40 | base=`basename $f` | ||
41 | install -m755 $f ${D}${libdir}/go/bin | ||
42 | make_wrapper $base $base | ||
43 | done | ||
44 | } | ||
45 | |||
46 | do_package[noexec] = "1" | ||
47 | do_packagedata[noexec] = "1" | ||
48 | do_package_write_ipk[noexec] = "1" | ||
49 | do_package_write_deb[noexec] = "1" | ||
50 | do_package_write_rpm[noexec] = "1" | ||