Enable go-cross 1.3 to coexist with later versions

Since we need go 1.3 to co-exist with later versions (ie 1.4),
package go-cross_1.3 as go-cross-1.3_1.3.

go 1.3 will be installed to a different path than go-cross, this requires
go packages needing go 1.3 to set its PATH to:
        export PATH=${STAGING_BINDIR_NATIVE}/${HOST_SYS}/go-1.3:$PATH

Signed-off-by: Amy Fong <amy.fong@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
This commit is contained in:
Amy Fong 2015-10-06 14:41:13 -04:00 committed by Bruce Ashfield
parent 7817649098
commit d0ef47396d
2 changed files with 9 additions and 6 deletions

View File

@ -37,7 +37,7 @@ S = "${WORKDIR}/git"
DOCKER_VERSION = "1.6.2" DOCKER_VERSION = "1.6.2"
PV = "${DOCKER_VERSION}+git${SRCREV}" PV = "${DOCKER_VERSION}+git${SRCREV}"
DEPENDS = "go-cross \ DEPENDS = "go-cross-1.3 \
go-cli \ go-cli \
go-pty \ go-pty \
go-context \ go-context \
@ -66,6 +66,8 @@ do_configure() {
} }
do_compile() { do_compile() {
export PATH=${STAGING_BINDIR_NATIVE}/${HOST_SYS}/go-1.3:$PATH
export GOARCH="${TARGET_ARCH}" export GOARCH="${TARGET_ARCH}"
# supported amd64, 386, arm # supported amd64, 386, arm
if [ "${TARGET_ARCH}" = "x86_64" ]; then if [ "${TARGET_ARCH}" = "x86_64" ]; then

View File

@ -25,7 +25,7 @@ SRC_URI += "\
do_compile() { do_compile() {
## Setting `$GOBIN` doesn't do any good, looks like it ends up copying binaries there. ## Setting `$GOBIN` doesn't do any good, looks like it ends up copying binaries there.
export GOROOT_FINAL="${SYSROOT}${libdir}/go" export GOROOT_FINAL="${SYSROOT}${libdir}/go-1.3"
export GOHOSTOS="linux" export GOHOSTOS="linux"
export GOOS="linux" export GOOS="linux"
@ -61,11 +61,12 @@ do_compile() {
do_install() { do_install() {
## It should be okay to ignore `${WORKDIR}/go/bin/linux_arm`... ## It should be okay to ignore `${WORKDIR}/go/bin/linux_arm`...
## Also `gofmt` is not needed right now. ## Also `gofmt` is not needed right now.
install -d "${D}${bindir}" install -d "${D}${bindir}/go-1.3"
install -m 0755 "${WORKDIR}/go/bin/go" "${D}${bindir}" install -m 0755 "${WORKDIR}/go/bin/go" "${D}${bindir}/go-1.3/"
install -d "${D}${libdir}/go" install -d "${D}${libdir}/go-1.3"
## TODO: use `install` instead of `cp` ## TODO: use `install` instead of `cp`
for dir in include lib pkg src test for dir in include lib pkg src test
do cp -a "${WORKDIR}/go/${dir}" "${D}${libdir}/go/" do cp -a "${WORKDIR}/go/${dir}" "${D}${libdir}/go-1.3/"
done done
} }