guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

branch staging updated: build-system/go: Allow providing additional buil


From: guix-commits
Subject: branch staging updated: build-system/go: Allow providing additional build flags
Date: Wed, 08 Apr 2020 06:29:12 -0400

This is an automated email from the git hooks/post-receive script.

niedzejkob pushed a commit to branch staging
in repository guix.

The following commit(s) were added to refs/heads/staging by this push:
     new 3f3c9fd  build-system/go: Allow providing additional build flags
3f3c9fd is described below

commit 3f3c9fdcd8cff2e761a2768b175b63b3c09ef4e3
Author: Jakub Kądziołka <address@hidden>
AuthorDate: Sun Jan 5 17:13:20 2020 +0100

    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-system/go.scm       | 3 +++
 guix/build/go-build-system.scm | 7 ++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm
index 1b916af..f8ebaef 100644
--- a/guix/build-system/go.scm
+++ b/guix/build-system/go.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2016 Petter <address@hidden>
 ;;; Copyright © 2017 Leo Famulari <address@hidden>
+;;; Copyright © 2020 Jakub Kądziołka <address@hidden>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -82,6 +83,7 @@
                    (install-source? #t)
                    (import-path "")
                    (unpack-path "")
+                   (build-flags ''())
                    (tests? #t)
                    (allow-go-reference? #f)
                    (system (%current-system))
@@ -109,6 +111,7 @@
                 #:install-source? ,install-source?
                 #:import-path ,import-path
                 #:unpack-path ,unpack-path
+                #:build-flags ,build-flags
                 #:tests? ,tests?
                 #:allow-go-reference? ,allow-go-reference?
                 #:inputs %build-inputs)))
diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm
index 0d15f97..b9cb2bf 100644
--- a/guix/build/go-build-system.scm
+++ b/guix/build/go-build-system.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2017, 2019 Leo Famulari <address@hidden>
 ;;; Copyright © 2019 Maxim Cournoyer <address@hidden>
 ;;; Copyright © 2020 Jack Hill <address@hidden>
+;;; Copyright © 2020 Jakub Kądziołka <address@hidden>
 ;;;
 ;;; 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"))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]