summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorThilo Fromm <thilo.alexander@gmail.com>2023-11-08 08:36:23 +0100
committerJames Le Cuirot <chewi@gentoo.org>2023-11-20 23:25:25 +0000
commite398c855e3475c1fb5f3ac6a6e0553116dac83f8 (patch)
tree3b4e4869d340718e6d936602f913a60d653fa2e0 /eclass
parenteclass/go-env.eclass: add helper to set compile env (diff)
downloadgentoo-e398c855e3475c1fb5f3ac6a6e0553116dac83f8.tar.gz
gentoo-e398c855e3475c1fb5f3ac6a6e0553116dac83f8.tar.bz2
gentoo-e398c855e3475c1fb5f3ac6a6e0553116dac83f8.zip
eclass/go-module.eclass: export compile env in src_unpack
This change calls go-env_set_compile_environment in go-module's src_unpack to set up a sane compile environment early in the go build process. This un-breaks cross compiling of all golang ebuilds that inherit go-module. Signed-off-by: Thilo Fromm <thilo.alexander@gmail.com> Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r--eclass/go-module.eclass5
1 files changed, 4 insertions, 1 deletions
diff --git a/eclass/go-module.eclass b/eclass/go-module.eclass
index 6c58d7f26f07..701d36e012e2 100644
--- a/eclass/go-module.eclass
+++ b/eclass/go-module.eclass
@@ -68,7 +68,7 @@ esac
if [[ -z ${_GO_MODULE_ECLASS} ]]; then
_GO_MODULE_ECLASS=1
-inherit multiprocessing toolchain-funcs
+inherit multiprocessing toolchain-funcs go-env
if [[ ! ${GO_OPTIONAL} ]]; then
BDEPEND=">=dev-lang/go-1.18"
@@ -363,6 +363,7 @@ go-module_setup_proxy() {
# local go proxy. This mode is deprecated.
# 2. Otherwise, if EGO_VENDOR is set, bail out, as this functionality was removed.
# 3. Otherwise, call 'ego mod verify' and then do a normal unpack.
+# Set compile env via go-env.
go-module_src_unpack() {
if use amd64 || use arm || use arm64 ||
( use ppc64 && [[ $(tc-endian) == "little" ]] ) || use s390 || use x86; then
@@ -386,6 +387,8 @@ go-module_src_unpack() {
${nf} ego mod verify
fi
fi
+
+ go-env_set_compile_environment
}
# @FUNCTION: _go-module_src_unpack_gosum