aboutsummaryrefslogtreecommitdiff
path: root/guix/build/go-build-system.scm
diff options
context:
space:
mode:
authorJakub Kądziołka <kuba@kadziolka.net>2020-01-05 17:13:20 +0100
committerJakub Kądziołka <kuba@kadziolka.net>2020-04-08 12:24:42 +0200
commit3f3c9fdcd8cff2e761a2768b175b63b3c09ef4e3 (patch)
treea8b6c72160a21e61f9b4b1b6877e3fa856236852 /guix/build/go-build-system.scm
parent18705a507da60ad9f9d03d2dbbaa127cedca3716 (diff)
downloadguix-3f3c9fdcd8cff2e761a2768b175b63b3c09ef4e3.tar
guix-3f3c9fdcd8cff2e761a2768b175b63b3c09ef4e3.tar.gz
build-system/go: Allow providing additional build flags
* guix/build-system/go.scm (build-flags): New argument. * guix/build/go-build-system.scm (build): Use apply to pass the additional arguments to invoke.
Diffstat (limited to 'guix/build/go-build-system.scm')
-rw-r--r--guix/build/go-build-system.scm7
1 files changed, 4 insertions, 3 deletions
diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm
index 0d15f978cd..b9cb2bfd7b 100644
--- a/guix/build/go-build-system.scm
+++ b/guix/build/go-build-system.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2017, 2019 Leo Famulari <leo@famulari.name>
;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2020 Jack Hill <jackhill@jackhill.us>
+;;; Copyright © 2020 Jakub Kądziołka <kuba@kadziolka.net>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -214,18 +215,18 @@ unpacking."
(_ #f))
inputs))))
-(define* (build #:key import-path #:allow-other-keys)
+(define* (build #:key import-path build-flags #:allow-other-keys)
"Build the package named by IMPORT-PATH."
(with-throw-handler
#t
(lambda _
- (invoke "go" "install"
+ (apply invoke "go" "install"
"-v" ; print the name of packages as they are compiled
"-x" ; print each command as it is invoked
;; Respectively, strip the symbol table and debug
;; information, and the DWARF symbol table.
"-ldflags=-s -w"
- import-path))
+ `(,@build-flags ,import-path)))
(lambda (key . args)
(display (string-append "Building '" import-path "' failed.\n"
"Here are the results of `go env`:\n"))