From 3f3c9fdcd8cff2e761a2768b175b63b3c09ef4e3 Mon Sep 17 00:00:00 2001 From: Jakub Kądziołka Date: Sun, 5 Jan 2020 17:13:20 +0100 Subject: 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. --- guix/build/go-build-system.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'guix/build') 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 ;;; Copyright © 2019 Maxim Cournoyer ;;; Copyright © 2020 Jack Hill +;;; Copyright © 2020 Jakub Kądziołka ;;; ;;; This file is part of GNU Guix. ;;; @@ -214,18 +215,18 @@ (define (go-inputs inputs) (_ #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")) -- cgit v1.2.3