diff options
| -rw-r--r-- | meta/classes-recipe/go.bbclass | 16 | ||||
| -rw-r--r-- | meta/recipes-extended/go-examples/go-helloworld_0.1.bb | 2 |
2 files changed, 3 insertions, 15 deletions
diff --git a/meta/classes-recipe/go.bbclass b/meta/classes-recipe/go.bbclass index d32509aa6d..9146dd611e 100644 --- a/meta/classes-recipe/go.bbclass +++ b/meta/classes-recipe/go.bbclass | |||
| @@ -80,19 +80,7 @@ export GOPROXY ??= "https://proxy.golang.org,direct" | |||
| 80 | export GOTMPDIR ?= "${WORKDIR}/build-tmp" | 80 | export GOTMPDIR ?= "${WORKDIR}/build-tmp" |
| 81 | GOTMPDIR[vardepvalue] = "" | 81 | GOTMPDIR[vardepvalue] = "" |
| 82 | 82 | ||
| 83 | python go_do_unpack() { | 83 | GO_SRCURI_DESTSUFFIX = "${@os.path.join(os.path.basename(d.getVar('S')), 'src', d.getVar('GO_IMPORT')) + '/'}" |
| 84 | src_uri = (d.getVar('SRC_URI') or "").split() | ||
| 85 | if len(src_uri) == 0: | ||
| 86 | return | ||
| 87 | |||
| 88 | fetcher = bb.fetch2.Fetch(src_uri, d) | ||
| 89 | for url in fetcher.urls: | ||
| 90 | if fetcher.ud[url].type == 'git': | ||
| 91 | if fetcher.ud[url].parm.get('destsuffix') is None: | ||
| 92 | s_dirname = os.path.basename(d.getVar('S')) | ||
| 93 | fetcher.ud[url].parm['destsuffix'] = os.path.join(s_dirname, 'src', d.getVar('GO_IMPORT')) + '/' | ||
| 94 | fetcher.unpack(d.getVar('WORKDIR')) | ||
| 95 | } | ||
| 96 | 84 | ||
| 97 | go_list_packages() { | 85 | go_list_packages() { |
| 98 | ${GO} list -f '{{.ImportPath}}' ${GOBUILDFLAGS} ${GO_INSTALL} | \ | 86 | ${GO} list -f '{{.ImportPath}}' ${GOBUILDFLAGS} ${GO_INSTALL} | \ |
| @@ -151,7 +139,7 @@ go_stage_testdata() { | |||
| 151 | cd "$oldwd" | 139 | cd "$oldwd" |
| 152 | } | 140 | } |
| 153 | 141 | ||
| 154 | EXPORT_FUNCTIONS do_unpack do_configure do_compile do_install | 142 | EXPORT_FUNCTIONS do_configure do_compile do_install |
| 155 | 143 | ||
| 156 | FILES:${PN}-dev = "${libdir}/go/src" | 144 | FILES:${PN}-dev = "${libdir}/go/src" |
| 157 | FILES:${PN}-staticdev = "${libdir}/go/pkg" | 145 | FILES:${PN}-staticdev = "${libdir}/go/pkg" |
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 74f3520eae..575ee81b50 100644 --- a/meta/recipes-extended/go-examples/go-helloworld_0.1.bb +++ b/meta/recipes-extended/go-examples/go-helloworld_0.1.bb | |||
| @@ -5,7 +5,7 @@ HOMEPAGE = "https://golang.org/" | |||
| 5 | LICENSE = "MIT" | 5 | LICENSE = "MIT" |
| 6 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" | 6 | LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" |
| 7 | 7 | ||
| 8 | SRC_URI = "git://go.googlesource.com/example;branch=master;protocol=https" | 8 | SRC_URI = "git://go.googlesource.com/example;branch=master;protocol=https;destsuffix=${GO_SRCURI_DESTSUFFIX}" |
| 9 | SRCREV = "32022caedd6a177a7717aa8680cbe179e1045935" | 9 | SRCREV = "32022caedd6a177a7717aa8680cbe179e1045935" |
| 10 | UPSTREAM_CHECK_COMMITS = "1" | 10 | UPSTREAM_CHECK_COMMITS = "1" |
| 11 | 11 | ||
