1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-08 17:19:20 +00:00

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>
This commit is contained in:
Otavio Salvador
2017-09-08 18:04:44 -03:00
committed by Richard Purdie
parent 6cf084963a
commit e249708e10
3 changed files with 16 additions and 30 deletions
@@ -1,10 +0,0 @@
// You can edit this code!
// Click here and start typing.
// taken from https://golang.org/
package main
import "fmt"
func main() {
fmt.Println("Hello, 世界")
}
@@ -1,10 +0,0 @@
DESCRIPTION = "This is a simple example recipe that cross-compiles a Go program."
SECTION = "examples"
HOMEPAGE = "https://golang.org/"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
S = "${WORKDIR}"
inherit go
@@ -1,13 +1,19 @@
require go-examples.inc
DESCRIPTION = "This is a simple example recipe that cross-compiles a Go program."
SECTION = "examples"
HOMEPAGE = "https://golang.org/"
SRC_URI += " \
file://helloworld.go \
"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
do_compile() {
go build helloworld.go
}
do_install() {
install -D -m 0755 ${S}/helloworld ${D}${bindir}/helloworld
SRC_URI = "git://${GO_IMPORT}"
SRCREV = "46695d81d1fae905a270fb7db8a4d11a334562fe"
GO_IMPORT = "github.com/golang/example"
GO_INSTALL = "${GO_IMPORT}/hello"
inherit go
# This is just to make clear where this example is
do_install_append() {
mv ${D}${bindir}/hello ${D}${bindir}/${BPN}
}