mirror of
https://git.yoctoproject.org/poky
synced 2026-09-14 03:49:32 +02:00
go: Drop fork of unpack code, mandate GO_SRCURI_DESTSUFFIX
The go class has its own fork of the base unpack code. At the time I was
told this was fine, it now isn't as that code is changing.
Rather than have a fork, put the path magic into a variable and then go
recipes can just set SRC_URI appropriately, e.g.:
git://go.googlesource.com/example;branch=master;protocol=https;destsuffix=${GO_SRCURI_DESTSUFFIX}
This avoids having special case hacks in the class and makes everything
a little more obvious.
(From OE-Core rev: cc4ec43a2b657fb4c58429ab14f1edc2473c1327)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -80,19 +80,7 @@ export GOPROXY ??= "https://proxy.golang.org,direct"
|
|||||||
export GOTMPDIR ?= "${WORKDIR}/build-tmp"
|
export GOTMPDIR ?= "${WORKDIR}/build-tmp"
|
||||||
GOTMPDIR[vardepvalue] = ""
|
GOTMPDIR[vardepvalue] = ""
|
||||||
|
|
||||||
python go_do_unpack() {
|
GO_SRCURI_DESTSUFFIX = "${@os.path.join(os.path.basename(d.getVar('S')), 'src', d.getVar('GO_IMPORT')) + '/'}"
|
||||||
src_uri = (d.getVar('SRC_URI') or "").split()
|
|
||||||
if len(src_uri) == 0:
|
|
||||||
return
|
|
||||||
|
|
||||||
fetcher = bb.fetch2.Fetch(src_uri, d)
|
|
||||||
for url in fetcher.urls:
|
|
||||||
if fetcher.ud[url].type == 'git':
|
|
||||||
if fetcher.ud[url].parm.get('destsuffix') is None:
|
|
||||||
s_dirname = os.path.basename(d.getVar('S'))
|
|
||||||
fetcher.ud[url].parm['destsuffix'] = os.path.join(s_dirname, 'src', d.getVar('GO_IMPORT')) + '/'
|
|
||||||
fetcher.unpack(d.getVar('WORKDIR'))
|
|
||||||
}
|
|
||||||
|
|
||||||
go_list_packages() {
|
go_list_packages() {
|
||||||
${GO} list -f '{{.ImportPath}}' ${GOBUILDFLAGS} ${GO_INSTALL} | \
|
${GO} list -f '{{.ImportPath}}' ${GOBUILDFLAGS} ${GO_INSTALL} | \
|
||||||
@@ -151,7 +139,7 @@ go_stage_testdata() {
|
|||||||
cd "$oldwd"
|
cd "$oldwd"
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_FUNCTIONS do_unpack do_configure do_compile do_install
|
EXPORT_FUNCTIONS do_configure do_compile do_install
|
||||||
|
|
||||||
FILES:${PN}-dev = "${libdir}/go/src"
|
FILES:${PN}-dev = "${libdir}/go/src"
|
||||||
FILES:${PN}-staticdev = "${libdir}/go/pkg"
|
FILES:${PN}-staticdev = "${libdir}/go/pkg"
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ HOMEPAGE = "https://golang.org/"
|
|||||||
LICENSE = "MIT"
|
LICENSE = "MIT"
|
||||||
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
|
||||||
|
|
||||||
SRC_URI = "git://go.googlesource.com/example;branch=master;protocol=https"
|
SRC_URI = "git://go.googlesource.com/example;branch=master;protocol=https;destsuffix=${GO_SRCURI_DESTSUFFIX}"
|
||||||
SRCREV = "32022caedd6a177a7717aa8680cbe179e1045935"
|
SRCREV = "32022caedd6a177a7717aa8680cbe179e1045935"
|
||||||
UPSTREAM_CHECK_COMMITS = "1"
|
UPSTREAM_CHECK_COMMITS = "1"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user