@@ -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"