summaryrefslogtreecommitdiffstats
path: root/meta/classes/go.bbclass
diff options
context:
space:
mode:
Diffstat (limited to 'meta/classes/go.bbclass')
-rw-r--r--meta/classes/go.bbclass20
1 files changed, 19 insertions, 1 deletions
diff --git a/meta/classes/go.bbclass b/meta/classes/go.bbclass
index cfe773e13d..c1ef01fafe 100644
--- a/meta/classes/go.bbclass
+++ b/meta/classes/go.bbclass
@@ -55,6 +55,24 @@ GO_INSTALL ?= "${GO_IMPORT}/..."
55 55
56B = "${WORKDIR}/build" 56B = "${WORKDIR}/build"
57 57
58python go_do_unpack() {
59 src_uri = (d.getVar('SRC_URI') or "").split()
60 if len(src_uri) == 0:
61 return
62
63 try:
64 fetcher = bb.fetch2.Fetch(src_uri, d)
65 for url in fetcher.urls:
66 if fetcher.ud[url].type == 'git':
67 if fetcher.ud[url].parm.get('destsuffix') is None:
68 s_dirname = os.path.basename(d.getVar('S'))
69 fetcher.ud[url].parm['destsuffix'] = os.path.join(s_dirname, 'src',
70 d.getVar('GO_IMPORT')) + '/'
71 fetcher.unpack(d.getVar('WORKDIR'))
72 except bb.fetch2.BBFetchException as e:
73 raise bb.build.FuncFailed(e)
74}
75
58go_do_configure() { 76go_do_configure() {
59 ln -snf ${S}/src ${B}/ 77 ln -snf ${S}/src ${B}/
60} 78}
@@ -79,4 +97,4 @@ go_do_install() {
79 fi 97 fi
80} 98}
81 99
82EXPORT_FUNCTIONS do_configure do_compile do_install 100EXPORT_FUNCTIONS do_unpack do_configure do_compile do_install