diff options
Diffstat (limited to 'meta/recipes-devtools/go/go-native.inc')
-rw-r--r-- | meta/recipes-devtools/go/go-native.inc | 48 |
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. | ||
3 | nonstaging_libdir := "${libdir}" | ||
4 | |||
1 | inherit native | 5 | inherit native |
2 | 6 | ||
3 | BOOTSTRAP ?= "" | 7 | SRC_URI_append = " http://golang.org/dl/go1.4.3.src.tar.gz;name=bootstrap;subdir=go1.4" |
8 | SRC_URI[bootstrap.md5sum] = "dfb604511115dd402a77a553a5923a04" | ||
9 | SRC_URI[bootstrap.sha256sum] = "9947fc705b0b841b5938c48b22dc33e9647ec0752bae66e50278df4f23f64959" | ||
10 | |||
4 | export GOOS = "${BUILD_GOOS}" | 11 | export GOOS = "${BUILD_GOOS}" |
5 | export GOARCH = "${BUILD_GOARCH}" | 12 | export GOARCH = "${BUILD_GOARCH}" |
6 | export GOROOT_FINAL = "${STAGING_LIBDIR_NATIVE}/go${BOOTSTRAP}" | 13 | CC = "${@d.getVar('BUILD_CC', True).strip()}" |
7 | export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go1.4" | 14 | |
8 | export CGO_ENABLED = "1" | 15 | export CGO_ENABLED = "1" |
9 | 16 | ||
10 | do_configure[noexec] = "1" | 17 | do_configure() { |
18 | cd ${WORKDIR}/go1.4/go/src | ||
19 | CGO_ENABLED=0 GOROOT=${WORKDIR}/go1.4/go ./make.bash | ||
20 | } | ||
11 | 21 | ||
12 | do_compile() { | 22 | do_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 | ||
24 | make_wrapper() { | 36 | make_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 |
28 | here=\`dirname \$0\` | 40 | here=\`dirname \$0\` |
29 | export GOROOT="${GOROOT:-\`readlink -f \$here/../lib/go$3\`}" | 41 | export GOROOT="${GOROOT:-\`readlink -f \$here/../lib/go\`}" |
30 | \$here/../lib/go$3/bin/$1 "\$@" | 42 | \$here/../lib/go/bin/$1 "\$@" |
31 | END | 43 | END |
32 | chmod +x ${D}${bindir}/$2$3 | 44 | chmod +x ${D}${bindir}/$2 |
33 | } | 45 | } |
34 | 46 | ||
35 | do_install() { | 47 | do_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 | |||
52 | do_package[noexec] = "1" | ||
53 | do_packagedata[noexec] = "1" | ||
54 | do_package_write_ipk[noexec] = "1" | ||
55 | do_package_write_deb[noexec] = "1" | ||
56 | do_package_write_rpm[noexec] = "1" | ||