public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: James Le Cuirot <chewi@gentoo.org>
To: gentoo-dev <gentoo-dev@lists.gentoo.org>
Cc: Thilo Fromm <thilo.alexander@gmail.com>,
	James Le Cuirot <chewi@gentoo.org>
Subject: [gentoo-dev] [PATCH 2/4] eclass/go-module.eclass: export compile env in src_unpack
Date: Sun, 19 Nov 2023 12:30:45 +0000	[thread overview]
Message-ID: <20231119123410.17748-3-chewi@gentoo.org> (raw)
In-Reply-To: <20231119123410.17748-1-chewi@gentoo.org>

From: Thilo Fromm <thilo.alexander@gmail.com>

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>
---
 eclass/go-module.eclass | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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
-- 
2.42.1



  parent reply	other threads:[~2023-11-19 12:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-19 12:30 [gentoo-dev] [PATCH V2 0/4] eclass/go-env.eclass: add helper to enable cross compiling James Le Cuirot
2023-11-19 12:30 ` [gentoo-dev] [PATCH 1/4] eclass/go-env.eclass: add helper to set compile env James Le Cuirot
2023-11-19 12:30 ` James Le Cuirot [this message]
2023-11-19 12:30 ` [gentoo-dev] [PATCH 3/4] eclass/golang-vcs-snapshot.eclass: set up " James Le Cuirot
2023-11-19 12:30 ` [gentoo-dev] [PATCH 4/4] eclass/golang-vcs.eclass: " James Le Cuirot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231119123410.17748-3-chewi@gentoo.org \
    --to=chewi@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=thilo.alexander@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox