summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/go/go-native.inc
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/go/go-native.inc')
-rw-r--r--meta/recipes-devtools/go/go-native.inc48
1 files changed, 27 insertions, 21 deletions
diff --git a/meta/recipes-devtools/go/go-native.inc b/meta/recipes-devtools/go/go-native.inc
index c21f8fda78..9eb2b3211f 100644
--- a/meta/recipes-devtools/go/go-native.inc
+++ b/meta/recipes-devtools/go/go-native.inc
@@ -1,16 +1,28 @@
1# Use immediate assingment here to get the original (/usr/lib)
2# instead of the one rewritten by native.bbclass.
3nonstaging_libdir := "${libdir}"
4
1inherit native 5inherit native
2 6
3BOOTSTRAP ?= "" 7SRC_URI_append = " http://golang.org/dl/go1.4.3.src.tar.gz;name=bootstrap;subdir=go1.4"
8SRC_URI[bootstrap.md5sum] = "dfb604511115dd402a77a553a5923a04"
9SRC_URI[bootstrap.sha256sum] = "9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959"
10
4export GOOS = "${BUILD_GOOS}" 11export GOOS = "${BUILD_GOOS}"
5export GOARCH = "${BUILD_GOARCH}" 12export GOARCH = "${BUILD_GOARCH}"
6export GOROOT_FINAL = "${STAGING_LIBDIR_NATIVE}/go${BOOTSTRAP}" 13CC = "${@d.getVar('BUILD_CC', True).strip()}"
7export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go1.4" 14
8export CGO_ENABLED = "1" 15export CGO_ENABLED = "1"
9 16
10do_configure[noexec] = "1" 17do_configure() {
18 cd ${WORKDIR}/go1.4/go/src
19 CGO_ENABLED=0 GOROOT=${WORKDIR}/go1.4/go ./make.bash
20}
11 21
12do_compile() { 22do_compile() {
13 export GOBIN="${B}/bin" 23 export GOBIN="${B}/bin"
24 export GOROOT_FINAL="${nonstaging_libdir}/go"
25 export GOROOT_BOOTSTRAP="${WORKDIR}/go1.4/go"
14 rm -rf ${GOBIN} 26 rm -rf ${GOBIN}
15 mkdir ${GOBIN} 27 mkdir ${GOBIN}
16 28
@@ -18,7 +30,7 @@ do_compile() {
18 mkdir -p ${WORKDIR}/build-tmp 30 mkdir -p ${WORKDIR}/build-tmp
19 31
20 cd src 32 cd src
21 CGO_ENABLED=0 ./make.bash --host-only 33 ./make.bash --host-only
22} 34}
23 35
24make_wrapper() { 36make_wrapper() {
@@ -26,31 +38,25 @@ make_wrapper() {
26 cat <<END >${D}${bindir}/$2$3 38 cat <<END >${D}${bindir}/$2$3
27#!/bin/bash 39#!/bin/bash
28here=\`dirname \$0\` 40here=\`dirname \$0\`
29export GOROOT="${GOROOT:-\`readlink -f \$here/../lib/go$3\`}" 41export GOROOT="${GOROOT:-\`readlink -f \$here/../lib/go\`}"
30\$here/../lib/go$3/bin/$1 "\$@" 42\$here/../lib/go/bin/$1 "\$@"
31END 43END
32 chmod +x ${D}${bindir}/$2$3 44 chmod +x ${D}${bindir}/$2
33} 45}
34 46
35do_install() { 47do_install() {
36 install -d ${D}${libdir}/go${BOOTSTRAP} 48 install -d ${D}${libdir}/go
37 cp -a ${B}/pkg ${D}${libdir}/go${BOOTSTRAP}/ 49 cp --preserve=mode,timestamps -R ${B}/pkg ${D}${libdir}/go/
38 install -d ${D}${libdir}/go${BOOTSTRAP}/src 50 install -d ${D}${libdir}/go/src
39 (cd ${S}/src; for d in *; do \ 51 (cd ${S}/src; for d in *; do \
40 [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go${BOOTSTRAP}/src/; \ 52 [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \
41 done) 53 done)
42 54
43 install -d ${D}${bindir} ${D}${libdir}/go${BOOTSTRAP}/bin 55 install -d ${D}${bindir} ${D}${libdir}/go/bin
44 for f in ${B}/bin/* 56 for f in ${B}/bin/*
45 do 57 do
46 base=`basename $f` 58 base=`basename $f`
47 install -m755 $f ${D}${libdir}/go${BOOTSTRAP}/bin 59 install -m755 $f ${D}${libdir}/go/bin
48 make_wrapper $base $base ${BOOTSTRAP} 60 make_wrapper $base $base
49 done 61 done
50} 62}
51
52do_package[noexec] = "1"
53do_packagedata[noexec] = "1"
54do_package_write_ipk[noexec] = "1"
55do_package_write_deb[noexec] = "1"
56do_package_write_rpm[noexec] = "1"