diff options
author | Matt Madison <matt@madison.systems> | 2017-09-12 09:50:21 -0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-09-12 23:55:29 +0100 |
commit | 9060b87711ffc5892c343165236ec40e5e3478e6 (patch) | |
tree | b3b1d79264f22f000140d703849ba8ae4d41e010 | |
parent | 2a7a37e70d3709a0e2ca96d0341bbde102ee9978 (diff) | |
download | poky-9060b87711ffc5892c343165236ec40e5e3478e6.tar.gz |
go: split out go-runtime into separate recipe
Reorganize the Go toolchain build to split out
the Go standard runtime libraries into a separate
recipe. This simplifies the extension to crosssdk
and cross-canadian builds.
* Adds a patch to the go build tool to prevent it
from trying to rebuild anything in GOROOT, which
is now resident in the target sysroot.
* 'go' bb and inc files are now for building the
compiler for the target only.
* 'go-cross' bb and inc files are now just for
the cross-compiler.
* Adds virtual/<prefix> PROVIDES for the compiler
and runtime
* Removes testdata directories from the sysroot
during staging, as they are unnecessary and
can cause strip errors (some of the test files
are ELF files).
* Re-enables pacakage QA checks, adding selective
INSANE_SKIP settings where needed.
(From OE-Core rev: d2a7af7cd834e218c39d43ee3fa0c14d4f748727)
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>
-rw-r--r-- | meta/classes/go.bbclass | 22 | ||||
-rw-r--r-- | meta/recipes-devtools/go/go-1.8.inc | 1 | ||||
-rw-r--r-- | meta/recipes-devtools/go/go-1.8/make-goroot-precious.patch | 21 | ||||
-rw-r--r-- | meta/recipes-devtools/go/go-cross.inc | 61 | ||||
-rw-r--r-- | meta/recipes-devtools/go/go-cross_1.8.bb | 5 | ||||
-rw-r--r-- | meta/recipes-devtools/go/go-runtime.inc | 58 | ||||
-rw-r--r-- | meta/recipes-devtools/go/go-runtime_1.8.bb | 2 | ||||
-rw-r--r-- | meta/recipes-devtools/go/go.inc | 68 |
8 files changed, 167 insertions, 71 deletions
diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass index cb1e96d88b..b3464d2105 100644 --- a/meta/classes/go.bbclass +++ b/meta/classes/go.bbclass | |||
@@ -20,11 +20,11 @@ def get_go_parallel_make(d): | |||
20 | GO_PARALLEL_BUILD ?= "${@get_go_parallel_make(d)}" | 20 | GO_PARALLEL_BUILD ?= "${@get_go_parallel_make(d)}" |
21 | 21 | ||
22 | GOROOT_class-native = "${STAGING_LIBDIR_NATIVE}/go" | 22 | GOROOT_class-native = "${STAGING_LIBDIR_NATIVE}/go" |
23 | GOROOT = "${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go" | 23 | GOROOT = "${STAGING_LIBDIR}/go" |
24 | GOBIN_FINAL_class-native = "${GOROOT_FINAL}/bin" | 24 | GOBIN_FINAL_class-native = "${GOROOT_FINAL}/bin" |
25 | GOBIN_FINAL = "${GOROOT_FINAL}/${GO_BUILD_BINDIR}" | 25 | GOBIN_FINAL = "${GOROOT_FINAL}/${GO_BUILD_BINDIR}" |
26 | 26 | ||
27 | DEPENDS_GOLANG_class-target = "go-cross-${TARGET_ARCH}" | 27 | DEPENDS_GOLANG_class-target = "virtual/${TARGET_PREFIX}go virtual/${TARGET_PREFIX}go-runtime" |
28 | DEPENDS_GOLANG_class-native = "go-native" | 28 | DEPENDS_GOLANG_class-native = "go-native" |
29 | 29 | ||
30 | DEPENDS_append = " ${DEPENDS_GOLANG}" | 30 | DEPENDS_append = " ${DEPENDS_GOLANG}" |
@@ -32,14 +32,15 @@ DEPENDS_append = " ${DEPENDS_GOLANG}" | |||
32 | export GOBUILDFLAGS ?= "-v" | 32 | export GOBUILDFLAGS ?= "-v" |
33 | GOBUILDFLAGS_prepend_task-compile = "${GO_PARALLEL_BUILD} " | 33 | GOBUILDFLAGS_prepend_task-compile = "${GO_PARALLEL_BUILD} " |
34 | 34 | ||
35 | export GOOS = "${TARGET_GOOS}" | 35 | export GO = "${HOST_PREFIX}go" |
36 | export GOARCH = "${TARGET_GOARCH}" | 36 | GOTOOLDIR = "${STAGING_LIBDIR_NATIVE}/${TARGET_SYS}/go/pkg/tool/${BUILD_GOTUPLE}" |
37 | export GOARM = "${TARGET_GOARM}" | 37 | GOTOOLDIR_class-native = "${STAGING_LIBDIR_NATIVE}/go/pkg/tool/${BUILD_GOTUPLE}" |
38 | export GOTOOLDIR | ||
38 | export CGO_ENABLED = "1" | 39 | export CGO_ENABLED = "1" |
39 | export GOROOT | 40 | export GOROOT |
40 | export GOROOT_FINAL = "${libdir}/${TARGET_SYS}/go" | 41 | export GOROOT_FINAL = "${libdir}/go" |
41 | export GOBIN_FINAL | 42 | export GOBIN_FINAL |
42 | export GOPKG_FINAL = "${GOROOT_FINAL}/pkg/${GOOS}_${GOARCH}" | 43 | export GOPKG_FINAL = "${GOROOT_FINAL}/pkg/${TARGET_GOTUPLE}" |
43 | export GOSRC_FINAL = "${GOROOT_FINAL}/src" | 44 | export GOSRC_FINAL = "${GOROOT_FINAL}/src" |
44 | export GO_GCFLAGS = "${TARGET_CFLAGS}" | 45 | export GO_GCFLAGS = "${TARGET_CFLAGS}" |
45 | export GO_LDFLAGS = "${TARGET_LDFLAGS}" | 46 | export GO_LDFLAGS = "${TARGET_LDFLAGS}" |
@@ -55,6 +56,7 @@ GO_INSTALL ?= "${GO_IMPORT}/..." | |||
55 | GO_INSTALL_FILTEROUT ?= "${GO_IMPORT}/vendor/" | 56 | GO_INSTALL_FILTEROUT ?= "${GO_IMPORT}/vendor/" |
56 | 57 | ||
57 | B = "${WORKDIR}/build" | 58 | B = "${WORKDIR}/build" |
59 | export GOPATH = "${B}" | ||
58 | 60 | ||
59 | python go_do_unpack() { | 61 | python go_do_unpack() { |
60 | src_uri = (d.getVar('SRC_URI') or "").split() | 62 | src_uri = (d.getVar('SRC_URI') or "").split() |
@@ -75,7 +77,7 @@ python go_do_unpack() { | |||
75 | } | 77 | } |
76 | 78 | ||
77 | go_list_packages() { | 79 | go_list_packages() { |
78 | GOPATH=${B}:${STAGING_LIBDIR}/${TARGET_SYS}/go go list -f '{{.ImportPath}}' ${GOBUILDFLAGS} ${GO_INSTALL} | \ | 80 | ${GO} list -f '{{.ImportPath}}' ${GOBUILDFLAGS} ${GO_INSTALL} | \ |
79 | egrep -v '${GO_INSTALL_FILTEROUT}' | 81 | egrep -v '${GO_INSTALL_FILTEROUT}' |
80 | } | 82 | } |
81 | 83 | ||
@@ -84,9 +86,9 @@ go_do_configure() { | |||
84 | } | 86 | } |
85 | 87 | ||
86 | go_do_compile() { | 88 | go_do_compile() { |
87 | GOPATH=${B}:${STAGING_LIBDIR}/${TARGET_SYS}/go go env | 89 | ${GO} env |
88 | if [ -n "${GO_INSTALL}" ]; then | 90 | if [ -n "${GO_INSTALL}" ]; then |
89 | GOPATH=${B}:${STAGING_LIBDIR}/${TARGET_SYS}/go go install ${GOBUILDFLAGS} `go_list_packages` | 91 | ${GO} install ${GOBUILDFLAGS} `go_list_packages` |
90 | fi | 92 | fi |
91 | } | 93 | } |
92 | do_compile[cleandirs] = "${B}/bin ${B}/pkg" | 94 | do_compile[cleandirs] = "${B}/bin ${B}/pkg" |
diff --git a/meta/recipes-devtools/go/go-1.8.inc b/meta/recipes-devtools/go/go-1.8.inc index bfb26de01d..2920d06f60 100644 --- a/meta/recipes-devtools/go/go-1.8.inc +++ b/meta/recipes-devtools/go/go-1.8.inc | |||
@@ -14,6 +14,7 @@ SRC_URI += "\ | |||
14 | file://fix-cc-handling.patch \ | 14 | file://fix-cc-handling.patch \ |
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 | file://make-goroot-precious.patch \ | ||
17 | " | 18 | " |
18 | SRC_URI[main.md5sum] = "64e9380e07bba907e26a00cf5fcbe77e" | 19 | SRC_URI[main.md5sum] = "64e9380e07bba907e26a00cf5fcbe77e" |
19 | SRC_URI[main.sha256sum] = "5f5dea2447e7dcfdc50fa6b94c512e58bfba5673c039259fd843f68829d99fa6" | 20 | SRC_URI[main.sha256sum] = "5f5dea2447e7dcfdc50fa6b94c512e58bfba5673c039259fd843f68829d99fa6" |
diff --git a/meta/recipes-devtools/go/go-1.8/make-goroot-precious.patch b/meta/recipes-devtools/go/go-1.8/make-goroot-precious.patch new file mode 100644 index 0000000000..28a7a34773 --- /dev/null +++ b/meta/recipes-devtools/go/go-1.8/make-goroot-precious.patch | |||
@@ -0,0 +1,21 @@ | |||
1 | Prevent GOROOT-resident packages from being rebuilt | ||
2 | |||
3 | Signed-off-by: Matt Madison <matt@madison.systems> | ||
4 | Upstream-Status: Pending | ||
5 | |||
6 | --- go.orig/src/cmd/go/pkg.go | ||
7 | +++ go/src/cmd/go/pkg.go | ||
8 | @@ -1496,6 +1496,13 @@ func isStale(p *Package) (bool, string) | ||
9 | return true, "build ID mismatch" | ||
10 | } | ||
11 | |||
12 | + // For OE builds, make anything in GOROOT non-stale, | ||
13 | + // to prevent a package build from overwriting the | ||
14 | + // build root. | ||
15 | + if p.Goroot && os.Getenv("GOROOT_OVERRIDE") != "1" { | ||
16 | + return false, "GOROOT-resident packages do not get rebuilt" | ||
17 | + } | ||
18 | + | ||
19 | // Package is stale if a dependency is. | ||
20 | for _, p1 := range p.deps { | ||
21 | if p1.Stale { | ||
diff --git a/meta/recipes-devtools/go/go-cross.inc b/meta/recipes-devtools/go/go-cross.inc index 1c2d9e3a3d..df3e4ea914 100644 --- a/meta/recipes-devtools/go/go-cross.inc +++ b/meta/recipes-devtools/go/go-cross.inc | |||
@@ -1,15 +1,60 @@ | |||
1 | inherit cross | 1 | inherit cross |
2 | 2 | ||
3 | DEPENDS += "gcc-cross-${TARGET_ARCH}" | 3 | PROVIDES = "virtual/${TARGET_PREFIX}go" |
4 | DEPENDS += "go-native" | ||
4 | 5 | ||
5 | PN = "go-cross-${TARGET_ARCH}" | 6 | PN = "go-cross-${TARGET_ARCH}" |
6 | 7 | ||
7 | # Ignore how TARGET_ARCH is computed. | 8 | export GOHOSTOS = "${BUILD_GOOS}" |
8 | TARGET_ARCH[vardepvalue] = "${TARGET_ARCH}" | 9 | export GOHOSTARCH = "${BUILD_GOARCH}" |
9 | # Ignore target os libc for cross compiler | 10 | export GOOS = "${TARGET_GOOS}" |
10 | #TARGET_OS[vardepexclude] = "LIBCEXTENSION" | 11 | export GOARCH = "${TARGET_GOARCH}" |
11 | FILESEXTRAPATHS =. "${FILE_DIRNAME}/go-cross:" | 12 | export GOARM = "${TARGET_GOARM}" |
13 | export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" | ||
14 | export GOROOT_FINAL = "${libdir}/go" | ||
15 | export CGO_ENABLED = "1" | ||
16 | export CC_FOR_TARGET="${TARGET_PREFIX}gcc ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}" | ||
17 | export CXX_FOR_TARGET="${TARGET_PREFIX}g++ ${TARGET_CC_ARCH} --sysroot=${STAGING_DIR_TARGET}" | ||
18 | CC = "${@d.getVar('BUILD_CC', True).strip()}" | ||
12 | 19 | ||
13 | GOROOT_FINAL = "${libdir}/go" | 20 | do_configure[noexec] = "1" |
14 | export GOROOT_FINAL | ||
15 | 21 | ||
22 | do_compile() { | ||
23 | export GOBIN="${B}/bin" | ||
24 | rm -rf ${GOBIN} ${B}/pkg | ||
25 | mkdir ${GOBIN} | ||
26 | cd src | ||
27 | ./make.bash --host-only | ||
28 | cd ${B} | ||
29 | } | ||
30 | |||
31 | |||
32 | make_wrapper() { | ||
33 | rm -f ${D}${bindir}/$2 | ||
34 | cat <<END >${D}${bindir}/$2 | ||
35 | #!/bin/bash | ||
36 | here=\`dirname \$0\` | ||
37 | export GOARCH="${TARGET_GOARCH}" | ||
38 | export GOOS="${TARGET_GOOS}" | ||
39 | export GOARM="${TARGET_GOARM}" | ||
40 | \$here/../../lib/${CROSS_TARGET_SYS_DIR}/go/bin/$1 "\$@" | ||
41 | END | ||
42 | chmod +x ${D}${bindir}/$2 | ||
43 | } | ||
44 | |||
45 | do_install() { | ||
46 | install -d ${D}${libdir}/go | ||
47 | cp --preserve=mode,timestamps -R ${B}/pkg ${D}${libdir}/go/ | ||
48 | install -d ${D}${libdir}/go/src | ||
49 | (cd ${S}/src; for d in *; do \ | ||
50 | [ ! -d $d ] || cp --preserve=mode,timestamps -R ${S}/src/$d ${D}${libdir}/go/src/; \ | ||
51 | done) | ||
52 | |||
53 | install -d ${D}${bindir} ${D}${libdir}/go/bin | ||
54 | for f in ${B}/bin/* | ||
55 | do | ||
56 | base=`basename $f` | ||
57 | install -m755 $f ${D}${libdir}/go/bin | ||
58 | make_wrapper $base ${TARGET_PREFIX}$base | ||
59 | done | ||
60 | } | ||
diff --git a/meta/recipes-devtools/go/go-cross_1.8.bb b/meta/recipes-devtools/go/go-cross_1.8.bb index 56ee084b10..80b5a03f6c 100644 --- a/meta/recipes-devtools/go/go-cross_1.8.bb +++ b/meta/recipes-devtools/go/go-cross_1.8.bb | |||
@@ -1,5 +1,2 @@ | |||
1 | require go-cross.inc | 1 | require go-cross.inc |
2 | require go_${PV}.bb | 2 | require go-${PV}.inc |
3 | |||
4 | # Go binaries are not understood by the strip tool. | ||
5 | INHIBIT_SYSROOT_STRIP = "1" | ||
diff --git a/meta/recipes-devtools/go/go-runtime.inc b/meta/recipes-devtools/go/go-runtime.inc new file mode 100644 index 0000000000..e3eddda837 --- /dev/null +++ b/meta/recipes-devtools/go/go-runtime.inc | |||
@@ -0,0 +1,58 @@ | |||
1 | DEPENDS = "virtual/${TARGET_PREFIX}go go-native" | ||
2 | PROVIDES = "virtual/${TARGET_PREFIX}go-runtime" | ||
3 | |||
4 | export GOHOSTOS = "${BUILD_GOOS}" | ||
5 | export GOHOSTARCH = "${BUILD_GOARCH}" | ||
6 | export GOOS = "${TARGET_GOOS}" | ||
7 | export GOARCH = "${TARGET_GOARCH}" | ||
8 | export GOARM = "${TARGET_GOARM}" | ||
9 | export GOROOT_BOOTSTRAP = "${STAGING_LIBDIR_NATIVE}/go" | ||
10 | export GOROOT_FINAL = "${libdir}/go" | ||
11 | export GO_TARGET_INSTALL = "std" | ||
12 | export CGO_ENABLED = "1" | ||
13 | export CC_FOR_TARGET="${CC}" | ||
14 | export CXX_FOR_TARGET="${CXX}" | ||
15 | export GOROOT_OVERRIDE = "1" | ||
16 | |||
17 | do_configure[noexec] = "1" | ||
18 | |||
19 | do_compile() { | ||
20 | export GOBIN="${B}/bin" | ||
21 | export CC="${@d.getVar('BUILD_CC').strip()}" | ||
22 | rm -rf ${GOBIN} ${B}/pkg | ||
23 | mkdir ${GOBIN} | ||
24 | cd src | ||
25 | GO_FLAGS="" ./make.bash | ||
26 | cd ${B} | ||
27 | } | ||
28 | |||
29 | do_install() { | ||
30 | install -d ${D}${libdir}/go/src | ||
31 | cp --preserve=mode,timestamps -R ${B}/pkg ${D}${libdir}/go/ | ||
32 | if [ "${BUILD_GOTUPLE}" != "${TARGET_GOTUPLE}" ]; then | ||
33 | rm -rf ${D}${libdir}/go/pkg/${BUILD_GOTUPLE} | ||
34 | rm -rf ${D}${libdir}/go/pkg/obj/${BUILD_GOTUPLE} | ||
35 | fi | ||
36 | rm -rf ${D}${libdir}/go/pkg/tool | ||
37 | rm -rf ${D}${libdir}/go/pkg/obj | ||
38 | rm -rf ${D}${libdir}/go/pkg/bootstrap | ||
39 | find src -mindepth 1 -maxdepth 1 -type d | while read srcdir; do | ||
40 | [ "$srcdir" = "./cmd" ] || cp --preserve=mode,timestamps -R $srcdir ${D}${libdir}/go/src/ | ||
41 | done | ||
42 | } | ||
43 | |||
44 | # These testdata directories aren't needed for builds and contain binaries | ||
45 | # that can cause errors in sysroot_strip(), so just remove them. | ||
46 | sysroot_stage_all_append() { | ||
47 | find ${SYSROOT_DESTDIR}${libdir}/go/src -depth -type d -name 'testdata' -exec rm -rf {} \; | ||
48 | } | ||
49 | |||
50 | ALLOW_EMPTY_${PN} = "1" | ||
51 | FILES_${PN}-dev = "${libdir}/go/src ${libdir}/go/pkg/include" | ||
52 | FILES_${PN}-staticdev = "${libdir}/go/pkg/${TARGET_GOTUPLE} ${libdir}/go/pkg/${TARGET_GOTUPLE}" | ||
53 | # The testdata directories in the source tree include some binaries for various | ||
54 | # architectures, scripts, and .a files | ||
55 | INSANE_SKIP_${PN}-dev = "staticdev ldflags file-rdeps arch" | ||
56 | |||
57 | INHIBIT_PACKAGE_STRIP = "1" | ||
58 | INHIBIT_PACKAGE_DEBUG_SPLIT = "1" | ||
diff --git a/meta/recipes-devtools/go/go-runtime_1.8.bb b/meta/recipes-devtools/go/go-runtime_1.8.bb new file mode 100644 index 0000000000..43b68b4e46 --- /dev/null +++ b/meta/recipes-devtools/go/go-runtime_1.8.bb | |||
@@ -0,0 +1,2 @@ | |||
1 | require go-${PV}.inc | ||
2 | require go-runtime.inc | ||
diff --git a/meta/recipes-devtools/go/go.inc b/meta/recipes-devtools/go/go.inc index 9efbd275bd..5984a60c28 100644 --- a/meta/recipes-devtools/go/go.inc +++ b/meta/recipes-devtools/go/go.inc | |||
@@ -1,16 +1,5 @@ | |||
1 | inherit goarch | 1 | inherit goarch |
2 | DEPENDS += "go-native" | 2 | DEPENDS = "virtual/${TARGET_PREFIX}go go-native" |
3 | |||
4 | # libgcc is required for the target specific libraries to build | ||
5 | # properly, but apparently not for go-cross and, more importantly, | ||
6 | # also can't be used there because go-cross cannot depend on | ||
7 | # the tune-specific libgcc. Otherwise go-cross also would have | ||
8 | # to be tune-specific. | ||
9 | DEPENDS += "${@ 'libgcc' if not oe.utils.inherits(d, 'cross') else ''}" | ||
10 | |||
11 | # Prevent runstrip from running because you get errors when the host arch != target arch | ||
12 | INHIBIT_PACKAGE_STRIP = "1" | ||
13 | INHIBIT_SYSROOT_STRIP = "1" | ||
14 | 3 | ||
15 | export GOHOSTOS = "${BUILD_GOOS}" | 4 | export GOHOSTOS = "${BUILD_GOOS}" |
16 | export GOHOSTARCH = "${BUILD_GOARCH}" | 5 | export GOHOSTARCH = "${BUILD_GOARCH}" |
@@ -22,13 +11,11 @@ export GOROOT_FINAL = "${libdir}/go" | |||
22 | export CGO_ENABLED = "1" | 11 | export CGO_ENABLED = "1" |
23 | export CC_FOR_TARGET = "${CC}" | 12 | export CC_FOR_TARGET = "${CC}" |
24 | export CXX_FOR_TARGET = "${CXX}" | 13 | export CXX_FOR_TARGET = "${CXX}" |
14 | export GO_TARGET_INSTALL = "cmd" | ||
15 | export GO_FLAGS = "-a" | ||
25 | 16 | ||
26 | do_configure[noexec] = "1" | 17 | do_configure[noexec] = "1" |
27 | 18 | ||
28 | do_compile_prepend_class-cross() { | ||
29 | export CGO_ENABLED=0 | ||
30 | } | ||
31 | |||
32 | do_compile() { | 19 | do_compile() { |
33 | export GOBIN="${B}/bin" | 20 | export GOBIN="${B}/bin" |
34 | export CC="${@d.getVar('BUILD_CC', True).strip()}" | 21 | export CC="${@d.getVar('BUILD_CC', True).strip()}" |
@@ -39,43 +26,26 @@ do_compile() { | |||
39 | mkdir -p ${WORKDIR}/build-tmp | 26 | mkdir -p ${WORKDIR}/build-tmp |
40 | 27 | ||
41 | cd src | 28 | cd src |
42 | ./make.bash --host-only | 29 | ./make.bash |
43 | # Ensure cgo.a is built with the target toolchain | 30 | cd ${B} |
44 | export GOBIN="${B}/target/bin" | ||
45 | rm -rf ${GOBIN} | ||
46 | mkdir -p ${GOBIN} | ||
47 | GO_FLAGS="-a" ./make.bash | ||
48 | } | ||
49 | |||
50 | do_install_class-target() { | ||
51 | install -d ${D}${libdir}/go | ||
52 | cp -a ${B}/pkg ${D}${libdir}/go/ | ||
53 | install -d ${D}${libdir}/go/src | ||
54 | (cd ${S}/src; for d in *; do \ | ||
55 | [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \ | ||
56 | done) | ||
57 | install -d ${D}${bindir} | ||
58 | if [ -d ${B}/bin/${GOOS}_${GOARCH} ] | ||
59 | then | ||
60 | install -m 0755 ${B}/bin/${GOOS}_${GOARCH}/* ${D}${bindir} | ||
61 | else | ||
62 | install -m 0755 ${B}/bin/* ${D}${bindir} | ||
63 | fi | ||
64 | } | 31 | } |
65 | 32 | ||
66 | do_install_class-cross() { | 33 | do_install() { |
67 | install -d ${D}${libdir}/go | 34 | install -d ${D}${libdir}/go/pkg/tool |
68 | cp -a ${B}/pkg ${D}${libdir}/go/ | 35 | cp --preserve=mode,timestamps -R ${B}/pkg/tool/${TARGET_GOTUPLE} ${D}${libdir}/go/pkg/tool/ |
69 | install -d ${D}${libdir}/go/src | 36 | install -d ${D}${libdir}/go/src |
70 | (cd ${S}/src; for d in *; do \ | 37 | cp --preserve=mode,timestamps -R ${S}/src/cmd ${D}${libdir}/go/src/ |
71 | [ -d $d ] && cp -a ${S}/src/$d ${D}${libdir}/go/src/; \ | 38 | install -d ${D}${libdir}/go/bin |
72 | done) | ||
73 | install -d ${D}${bindir} | 39 | install -d ${D}${bindir} |
74 | for f in ${B}/bin/go* | 40 | for f in ${B}/${GO_BUILD_BINDIR}/*; do |
75 | do | 41 | name=`basename $f` |
76 | install -m755 $f ${D}${bindir} | 42 | install -m 0755 $f ${D}${libdir}/go/bin/ |
43 | ln -sf ../${BASELIB}/go/bin/$name ${D}${bindir}/ | ||
77 | done | 44 | done |
78 | } | 45 | } |
79 | do_package_qa[noexec] = "1" | ||
80 | 46 | ||
81 | RDEPENDS_${PN} += "perl" | 47 | PACKAGES = "${PN} ${PN}-dev" |
48 | FILES_${PN} = "${libdir}/go/bin ${libdir}/go/pkg/tool/${TARGET_GOTUPLE} ${bindir}" | ||
49 | FILES_${PN}-dev = "${libdir}/go" | ||
50 | RDEPENDS_${PN}-dev = "perl bash" | ||
51 | INSANE_SKIP_${PN} = "ldflags" | ||