summaryrefslogtreecommitdiffstats
path: root/recipes-devtools/go-cross/go-cross_1.3.bb
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-devtools/go-cross/go-cross_1.3.bb')
-rw-r--r--recipes-devtools/go-cross/go-cross_1.3.bb65
1 files changed, 65 insertions, 0 deletions
diff --git a/recipes-devtools/go-cross/go-cross_1.3.bb b/recipes-devtools/go-cross/go-cross_1.3.bb
new file mode 100644
index 00000000..87231428
--- /dev/null
+++ b/recipes-devtools/go-cross/go-cross_1.3.bb
@@ -0,0 +1,65 @@
1DESCRIPTION = "\
2 Go is an open source programming language that makes it easy to build simple, \
3 reliable, and efficient software. \
4 "
5HOMEPAGE = "https://golang.org/"
6LICENSE = "BSD-3-Clause"
7
8SRC_URI = "http://golang.org/dl/go${PV}.src.tar.gz"
9
10S = "${WORKDIR}/go/"
11
12inherit cross
13
14LIC_FILES_CHKSUM = "file://LICENSE;md5=591778525c869cdde0ab5a1bf283cd81"
15SRC_URI[md5sum] = "4b66d7249554181c314f139ea78920b1"
16SRC_URI[sha256sum] = "eb983e6c5b2b9838f482c5442b1ac1856f610f2b21f3c123b3fedb48ffc35382"
17
18SRC_URI += "\
19 file://bsd_svid_source.patch \
20 file://ccache.patch \
21 "
22
23do_compile() {
24 ## Setting `$GOBIN` doesn't do any good, looks like it ends up copying binaries there.
25 export GOROOT_FINAL="${SYSROOT}${libdir}/go"
26
27 export GOHOSTOS="linux"
28 export GOOS="linux"
29
30 export GOARCH="${TARGET_ARCH}"
31 if [ "${TARGET_ARCH}" = "x86_64" ]; then
32 export GOARCH="amd64"
33 fi
34 if [ "${TARGET_ARCH}" = "arm" ]
35 then
36 if [ `echo ${TUNE_PKGARCH} | cut -c 1-7` = "cortexa" ]
37 then
38 echo GOARM 7
39 export GOARM="7"
40 fi
41 fi
42
43 export CGO_ENABLED="1"
44 ## TODO: consider setting GO_EXTLINK_ENABLED
45
46 export CC="${BUILD_CC}"
47 export CC_FOR_TARGET="${CC}"
48 export CXX_FOR_TARGET="${CXX}"
49 export GO_CCFLAGS="${HOST_CFLAGS}"
50 export GO_LDFLAGS="${HOST_LDFLAGS}"
51
52 cd src && ./make.bash
53}
54
55do_install() {
56 ## It should be okay to ignore `${WORKDIR}/go/bin/linux_arm`...
57 ## Also `gofmt` is not needed right now.
58 install -d "${D}${bindir}"
59 install -m 0755 "${WORKDIR}/go/bin/go" "${D}${bindir}"
60 install -d "${D}${libdir}/go"
61 ## TODO: use `install` instead of `cp`
62 for dir in include lib pkg src test
63 do cp -a "${WORKDIR}/go/${dir}" "${D}${libdir}/go/"
64 done
65}