diff options
| author | Khem Raj <raj.khem@gmail.com> | 2017-03-07 22:40:22 -0800 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-03-10 15:51:55 +0000 |
| commit | 760e81678cec80dcdaab12c2a0a0148e3e0ba275 (patch) | |
| tree | 6b587a2e9bd13c68788c1ff20df54db7e2f38c53 /meta/recipes-extended | |
| parent | 0efe58df2e5389f86dfbd53f90afc8f2970def7d (diff) | |
| download | poky-760e81678cec80dcdaab12c2a0a0148e3e0ba275.tar.gz | |
go: Add recipes for golang compilers and tools
* This is converging the recipes for go from
meta-virtualization and oe-meta-go
* Add recipes for go 1.7
* go.bbclass is added to ease out writing
recipes for go packages
* go-examples: Add an example, helloworld written in go
This should serve as temlate for writing go recipes
* Disable for musl, at least for now
* Disable for x32/ppc32 which is not supported
(From OE-Core rev: 78615e9260fb5d6569de4883521b049717fa4340)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended')
| -rw-r--r-- | meta/recipes-extended/go-examples/files/helloworld.go | 10 | ||||
| -rw-r--r-- | meta/recipes-extended/go-examples/go-examples.inc | 10 | ||||
| -rw-r--r-- | meta/recipes-extended/go-examples/go-helloworld_0.1.bb | 13 |
3 files changed, 33 insertions, 0 deletions
diff --git a/meta/recipes-extended/go-examples/files/helloworld.go b/meta/recipes-extended/go-examples/files/helloworld.go new file mode 100644 index 0000000000..0253c40411 --- /dev/null +++ b/meta/recipes-extended/go-examples/files/helloworld.go | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | // You can edit this code! | ||
| 2 | // Click here and start typing. | ||
| 3 | // taken from https://golang.org/ | ||
| 4 | package main | ||
| 5 | |||
| 6 | import "fmt" | ||
| 7 | |||
| 8 | func main() { | ||
| 9 | fmt.Println("Hello, 世界") | ||
| 10 | } | ||
diff --git a/meta/recipes-extended/go-examples/go-examples.inc b/meta/recipes-extended/go-examples/go-examples.inc new file mode 100644 index 0000000000..c63268116b --- /dev/null +++ b/meta/recipes-extended/go-examples/go-examples.inc | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | DESCRIPTION = "This is a simple example recipe that cross-compiles a Go program." | ||
| 2 | SECTION = "examples" | ||
| 3 | HOMEPAGE = "https://golang.org/" | ||
| 4 | |||
| 5 | LICENSE = "MIT" | ||
| 6 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | ||
| 7 | |||
| 8 | S = "${WORKDIR}" | ||
| 9 | |||
| 10 | inherit go | ||
diff --git a/meta/recipes-extended/go-examples/go-helloworld_0.1.bb b/meta/recipes-extended/go-examples/go-helloworld_0.1.bb new file mode 100644 index 0000000000..930c57df95 --- /dev/null +++ b/meta/recipes-extended/go-examples/go-helloworld_0.1.bb | |||
| @@ -0,0 +1,13 @@ | |||
| 1 | require go-examples.inc | ||
| 2 | |||
| 3 | SRC_URI += " \ | ||
| 4 | file://helloworld.go \ | ||
| 5 | " | ||
| 6 | |||
| 7 | do_compile() { | ||
| 8 | go build helloworld.go | ||
| 9 | } | ||
| 10 | |||
| 11 | do_install() { | ||
| 12 | install -D -m 0755 ${S}/helloworld ${D}${bindir}/helloworld | ||
| 13 | } | ||
