]> code.ossystems Code Review - openembedded-core.git/commitdiff
godep.bbclass: Add helper class to enable go-dep tool
authorKhem Raj <raj.khem@gmail.com>
Sat, 3 Mar 2018 16:34:37 +0000 (08:34 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 6 Mar 2018 14:36:34 +0000 (06:36 -0800)
Many go packages can take advantage of dep tool since
they manage their own dependencies, this class helps
in using go dep tool for such packages

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/classes/godep.bbclass [new file with mode: 0644]

diff --git a/meta/classes/godep.bbclass b/meta/classes/godep.bbclass
new file mode 100644 (file)
index 0000000..c82401c
--- /dev/null
@@ -0,0 +1,8 @@
+DEPENDS_append = " go-dep-native"
+
+do_compile_prepend() {
+    rm -f ${WORKDIR}/build/src/${GO_IMPORT}/Gopkg.toml
+    rm -f ${WORKDIR}/build/src/${GO_IMPORT}/Gopkg.lock
+    ( cd ${WORKDIR}/build/src/${GO_IMPORT} && dep init && dep ensure )
+}
+