diff options
author | Otavio Salvador <otavio@ossystems.com.br> | 2017-09-08 18:04:44 -0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-09-11 17:30:30 +0100 |
commit | e249708e10bdb4713195de31329dbe05dc3d18d1 (patch) | |
tree | 8ac71c4fb2de01e5bac149f836dbca7ac68270a7 /meta/recipes-extended/go-examples | |
parent | 6cf084963ab22952d16093e72e8936b60a828c25 (diff) | |
download | poky-e249708e10bdb4713195de31329dbe05dc3d18d1.tar.gz |
go-helloworld: Use the Golang examples repository
This updates the recipe to use the Golang examples repository so it
makes use of the unpack as well as standard tasks showing how easy it
can be.
(From OE-Core rev: 116d2ea1fe92725bb1265152f3db51598643a481)
Signed-off-by: Otavio Salvador <otavio@ossystems.com.br>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/go-examples')
-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 | 24 |
3 files changed, 15 insertions, 29 deletions
diff --git a/meta/recipes-extended/go-examples/files/helloworld.go b/meta/recipes-extended/go-examples/files/helloworld.go deleted file mode 100644 index 0253c40411..0000000000 --- a/meta/recipes-extended/go-examples/files/helloworld.go +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
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 deleted file mode 100644 index c63268116b..0000000000 --- a/meta/recipes-extended/go-examples/go-examples.inc +++ /dev/null | |||
@@ -1,10 +0,0 @@ | |||
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 index 930c57df95..222fc9d349 100644 --- a/meta/recipes-extended/go-examples/go-helloworld_0.1.bb +++ b/meta/recipes-extended/go-examples/go-helloworld_0.1.bb | |||
@@ -1,13 +1,19 @@ | |||
1 | require go-examples.inc | 1 | DESCRIPTION = "This is a simple example recipe that cross-compiles a Go program." |
2 | SECTION = "examples" | ||
3 | HOMEPAGE = "https://golang.org/" | ||
2 | 4 | ||
3 | SRC_URI += " \ | 5 | LICENSE = "MIT" |
4 | file://helloworld.go \ | 6 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" |
5 | " | ||
6 | 7 | ||
7 | do_compile() { | 8 | SRC_URI = "git://${GO_IMPORT}" |
8 | go build helloworld.go | 9 | SRCREV = "46695d81d1fae905a270fb7db8a4d11a334562fe" |
9 | } | 10 | |
11 | GO_IMPORT = "github.com/golang/example" | ||
12 | GO_INSTALL = "${GO_IMPORT}/hello" | ||
13 | |||
14 | inherit go | ||
10 | 15 | ||
11 | do_install() { | 16 | # This is just to make clear where this example is |
12 | install -D -m 0755 ${S}/helloworld ${D}${bindir}/helloworld | 17 | do_install_append() { |
18 | mv ${D}${bindir}/hello ${D}${bindir}/${BPN} | ||
13 | } | 19 | } |