summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/go
diff options
context:
space:
mode:
authorMatt Madison <matt@madison.systems>2017-09-12 09:50:19 -0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-09-12 23:55:29 +0100
commit4a11f8e98c7802ae578ad6010be35e18a8b06f15 (patch)
treebb072f54ea0b5c311ef6d147da430030897704f7 /meta/recipes-devtools/go
parent7fd27e8e333347737557948a4e93797650a126d0 (diff)
downloadpoky-4a11f8e98c7802ae578ad6010be35e18a8b06f15.tar.gz
go-native: remove dependency on go-bootstrap-native
The go1.4 toolchain is only required for bootstrapping go-native, and should not be used for anything else, so build it as part of the go-native build. This way, we don't have to carry around its built artifacts in the native sysroot. The go-cross and target toolchains can then just depend on go-native, using that for their 'bootstrap' toolchain. Also removed some unnecessary package-related noexec settings, since native recipes inherit nopackages. (From OE-Core rev: 9dc9d457fb9a456bc18c7789b91f40e1f6a999fe) Signed-off-by: Matt Madison <matt@madison.systems> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/go')
-rw-r--r--meta/recipes-devtools/go/go-1.8.inc4
-rw-r--r--meta/recipes-devtools/go/go-common.inc2
-rw-r--r--meta/recipes-devtools/go/go-native.inc48
-rw-r--r--meta/recipes-devtools/go/go-native_1.8.bb1
-rw-r--r--meta/recipes-devtools/go/go.inc4
5 files changed, 32 insertions, 27 deletions
diff --git a/meta/recipes-devtools/go/go-1.8.inc b/meta/recipes-devtools/go/go-1.8.inc
index 3690f310bd..bfb26de01d 100644
--- a/meta/recipes-devtools/go/go-1.8.inc
+++ b/meta/recipes-devtools/go/go-1.8.inc
@@ -15,5 +15,5 @@ SRC_URI += "\
15 file://split-host-and-target-build.patch \ 15 file://split-host-and-target-build.patch \
16 file://gotooldir.patch \ 16 file://gotooldir.patch \
17" 17"
18SRC_URI[md5sum] = "64e9380e07bba907e26a00cf5fcbe77e" 18SRC_URI[main.md5sum] = "64e9380e07bba907e26a00cf5fcbe77e"
19SRC_URI[sha256sum] = "5f5dea2447e7dcfdc50fa6b94c512e58bfba5673c039259fd843f68829d99fa6" 19SRC_URI[main.sha256sum] = "5f5dea2447e7dcfdc50fa6b94c512e58bfba5673c039259fd843f68829d99fa6"
diff --git a/meta/recipes-devtools/go/go-common.inc b/meta/recipes-devtools/go/go-common.inc
index f74b8b7650..ce1eb86812 100644
--- a/meta/recipes-devtools/go/go-common.inc
+++ b/meta/recipes-devtools/go/go-common.inc
@@ -14,7 +14,7 @@ LICENSE = "BSD-3-Clause"
14 14
15inherit goarch 15inherit goarch
16 16
17SRC_URI = "http://golang.org/dl/go${PV}.src.tar.gz" 17SRC_URI = "http://golang.org/dl/go${PV}.src.tar.gz;name=main"
18S = "${WORKDIR}/go" 18S = "${WORKDIR}/go"
19B = "${S}" 19B = "${S}"
20 20
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"
diff --git a/meta/recipes-devtools/go/go-native_1.8.bb b/meta/recipes-devtools/go/go-native_1.8.bb
index 182fca27a0..bbf3c0dd73 100644
--- a/meta/recipes-devtools/go/go-native_1.8.bb
+++ b/meta/recipes-devtools/go/go-native_1.8.bb
@@ -1,3 +1,2 @@
1require ${PN}.inc 1require ${PN}.inc
2require go-${PV}.inc 2require go-${PV}.inc
3DEPENDS += "go-bootstrap-native"
diff --git a/meta/recipes-devtools/go/go.inc b/meta/recipes-devtools/go/go.inc
index 52abbebd7e..9efbd275bd 100644
--- a/meta/recipes-devtools/go/go.inc
+++ b/meta/recipes-devtools/go/go.inc
@@ -1,5 +1,5 @@
1inherit goarch 1inherit goarch
2DEPENDS += "go-bootstrap-native" 2DEPENDS += "go-native"
3 3
4# libgcc is required for the target specific libraries to build 4# libgcc is required for the target specific libraries to build
5# properly, but apparently not for go-cross and, more importantly, 5# properly, but apparently not for go-cross and, more importantly,
@@ -17,7 +17,7 @@ export GOHOSTARCH = "${BUILD_GOARCH}"
17export GOOS = "${TARGET_GOOS}" 17export GOOS = "${TARGET_GOOS}"
18export GOARCH = "${TARGET_GOARCH}" 18export GOARCH = "${TARGET_GOARCH}"
19export GOARM = "${TARGET_GOARM}" 19export GOARM = "${TARGET_GOARM}"
20export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go1.4" 20export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go"
21export GOROOT_FINAL = "${libdir}/go" 21export GOROOT_FINAL = "${libdir}/go"
22export CGO_ENABLED = "1" 22export CGO_ENABLED = "1"
23export CC_FOR_TARGET = "${CC}" 23export CC_FOR_TARGET = "${CC}"