aboutsummaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended/go-examples
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-extended/go-examples')
-rw-r--r--meta/recipes-extended/go-examples/files/helloworld.go10
-rw-r--r--meta/recipes-extended/go-examples/go-examples.inc10
-rw-r--r--meta/recipes-extended/go-examples/go-helloworld_0.1.bb13
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 @@
+// You can edit this code!
+// Click here and start typing.
+// taken from https://golang.org/
+package main
+
+import "fmt"
+
+func main() {
+ fmt.Println("Hello, 世界")
+}
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 @@
+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
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 @@
+require go-examples.inc
+
+SRC_URI += " \
+ file://helloworld.go \
+"
+
+do_compile() {
+ go build helloworld.go
+}
+
+do_install() {
+ install -D -m 0755 ${S}/helloworld ${D}${bindir}/helloworld
+}