unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: "Collin J. Doering" <collin@rekahsoft.ca>
To: 51981@debbugs.gnu.org
Subject: [bug#51981] [PATCH 1/1] build: Fix cross compilation for go-build-system
Date: Fri, 19 Nov 2021 15:37:34 -0500	[thread overview]
Message-ID: <877dd36fvc.fsf@rekahsoft.ca> (raw)
In-Reply-To: <87bl2f6gti.fsf@rekahsoft.ca>

---
 guix/build/go-build-system.scm | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm
index 4768ee8562..f36e98f47a 100644
--- a/guix/build/go-build-system.scm
+++ b/guix/build/go-build-system.scm
@@ -148,7 +148,6 @@ (define* (setup-go-environment #:key inputs outputs goos goarch #:allow-other-ke
   ;; currently support modules, so turn modules off to continue using the old
   ;; GOPATH behavior.
   (setenv "GO111MODULE" "off")
-  (setenv "GOBIN" (string-append (assoc-ref outputs "out") "/bin"))
 
   ;; Make sure we're building for the correct architecture and OS targets
   ;; that Guix targets.
@@ -234,14 +233,19 @@ (define (go-inputs inputs)
                 (_ #f))
               inputs))))
 
-(define* (build #:key import-path build-flags #:allow-other-keys)
+(define* (build #:key outputs import-path build-flags #:allow-other-keys)
   "Build the package named by IMPORT-PATH."
   (with-throw-handler
     #t
     (lambda _
-      (apply invoke "go" "install"
+      (apply invoke "go" "build"
               "-v" ; print the name of packages as they are compiled
               "-x" ; print each command as it is invoked
+              ;; Set the output path for the build
+              (string-append "-o="
+                (assoc-ref outputs "out") "/bin/"
+                (package-name->name+version
+                  (strip-store-file-name (assoc-ref outputs "out"))))
               ;; Respectively, strip the symbol table and debug
               ;; information, and the DWARF symbol table.
               "-ldflags=-s -w"
-- 
2.33.1


-- 
Collin J. Doering

http://rekahsoft.ca
http://blog.rekahsoft.ca
http://git.rekahsoft.ca




  reply	other threads:[~2021-11-19 20:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19 19:59 [bug#51981] (no subject) Collin J. Doering
2021-11-19 20:37 ` Collin J. Doering [this message]
2022-05-14  7:23 ` [bug#51981] [PATCH 0/1] Fix cross-compilation of packages that use go-build-system Maxime Devos

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

  List information: https://guix.gnu.org/

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

  git send-email \
    --in-reply-to=877dd36fvc.fsf@rekahsoft.ca \
    --to=collin@rekahsoft.ca \
    --cc=51981@debbugs.gnu.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).