guix-commits
[Top][All Lists]
Advanced

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

02/05: build-system/go: Parameterize installing the source code.


From: Leo Famulari
Subject: 02/05: build-system/go: Parameterize installing the source code.
Date: Tue, 24 Oct 2017 13:11:50 -0400 (EDT)

lfam pushed a commit to branch master
in repository guix.

commit c10851cf912d60d18d79badbbefe85c2d21081f9
Author: Leo Famulari <address@hidden>
Date:   Tue Oct 24 12:17:32 2017 -0400

    build-system/go: Parameterize installing the source code.
    
    * guix/build-system/go.scm (go-build): Add install-source? key.
    * guix/build/go-build-system.scm (install-source): Check if
    install-source? is true.
---
 guix/build-system/go.scm       | 2 ++
 guix/build/go-build-system.scm | 7 ++++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/guix/build-system/go.scm b/guix/build-system/go.scm
index 43599df..ec447d2 100644
--- a/guix/build-system/go.scm
+++ b/guix/build-system/go.scm
@@ -78,6 +78,7 @@
                                %standard-phases))
                    (outputs '("out"))
                    (search-paths '())
+                   (install-source? #t)
                    (import-path "")
                    (unpack-path "")
                    (tests? #t)
@@ -102,6 +103,7 @@
                 #:outputs %outputs
                 #:search-paths ',(map search-path-specification->sexp
                                       search-paths)
+                #:install-source? ,install-source?
                 #:import-path ,import-path
                 #:unpack-path ,unpack-path
                 #:tests? ,tests?
diff --git a/guix/build/go-build-system.scm b/guix/build/go-build-system.scm
index d8ccb98..72af6ce 100644
--- a/guix/build/go-build-system.scm
+++ b/guix/build/go-build-system.scm
@@ -126,13 +126,14 @@ unset.  When SOURCE is a directory, copy it instead of 
unpacking."
         (zero? (system* "unzip" "-d" dest source))
         (zero? (system* "tar" "-C" dest "-xvf" source))))))
 
-(define* (install-source #:key outputs #:allow-other-keys)
+(define* (install-source #:key install-source? outputs #:allow-other-keys)
   "Install the source code to the output directory."
   (let* ((out (assoc-ref outputs "out"))
          (source "src")
          (dest (string-append out "/" source)))
-    (copy-recursively source dest #:keep-mtime? #t)
-    #t))
+    (if install-source?
+      (copy-recursively source dest #:keep-mtime? #t)
+      #t)))
 
 (define (go-package? name)
   (string-prefix? "go-" name))



reply via email to

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