diff mbox series

[RFC,12/30] classes: go-mod: make class customizable

Message ID 20250211150034.18696-13-stefan.herbrechtsmeier-oss@weidmueller.com
State New
Headers show
Series Add vendor support for go, npm and rust | expand

Commit Message

Stefan Herbrechtsmeier Feb. 11, 2025, 3 p.m. UTC
From: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>

Signed-off-by: Stefan Herbrechtsmeier <stefan.herbrechtsmeier@weidmueller.com>
---

 meta/classes-recipe/go-mod.bbclass | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/meta/classes-recipe/go-mod.bbclass b/meta/classes-recipe/go-mod.bbclass
index 93ae72235f..04651ebd8a 100644
--- a/meta/classes-recipe/go-mod.bbclass
+++ b/meta/classes-recipe/go-mod.bbclass
@@ -22,13 +22,15 @@  GOBUILDFLAGS:append = " -modcacherw"
 
 inherit go
 
-export GOMODCACHE = "${S}/pkg/mod"
-GO_MOD_CACHE_DIR = "${@os.path.relpath(d.getVar('GOMODCACHE'), d.getVar('WORKDIR'))}"
+export GOMODCACHE ?= "${S}/pkg/mod"
+GO_MOD_CACHE_DIR ?= "${@os.path.relpath(d.getVar('GOMODCACHE'), d.getVar('WORKDIR'))}"
 do_unpack[cleandirs] += "${GOMODCACHE}"
 
 GO_WORKDIR ?= "${GO_IMPORT}"
-do_compile[dirs] += "${B}/src/${GO_WORKDIR}"
+GO_WORKPATH ?= "${B}/src/${GO_WORKDIR}"
+do_compile[dirs] += "${GO_WORKPATH}"
 
 # Make go install unpack the module zip files in the module cache directory
 # before the license directory is polulated with license files.
-addtask do_compile before do_populate_lic
+GO_MOD_RECRDEPTASK = "do_populate_lic"
+do_compile[recrdeptask] += "${GO_MOD_RECRDEPTASK}"