aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeo Famulari <leo@famulari.name>2016-10-19 18:41:50 -0400
committerLeo Famulari <leo@famulari.name>2016-10-21 19:13:01 -0400
commit04a95a4fd6677d8bb91b9a1832c407afaa279e4b (patch)
tree07c42c2be98bb2d3f71065d10ec7305e0018109a
parent2116bfb367133f121a0a9bc880b69b1a3ee3f827 (diff)
downloadpatches-04a95a4fd6677d8bb91b9a1832c407afaa279e4b.tar
patches-04a95a4fd6677d8bb91b9a1832c407afaa279e4b.tar.gz
gnu: go-1.4: Disable cgo.
* gnu/packages/golang.scm (go-1.4)[arguments]: Set "CGO_ENABLED=0" while building. (go-1.7)[arguments]: Keep "CGO_ENABLED=1".
-rw-r--r--gnu/packages/golang.scm17
1 files changed, 16 insertions, 1 deletions
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 6b5038cf30..d5813d7903 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -4,6 +4,7 @@
;;; Copyright © 2016 Andy Wingo <wingo@igalia.com>
;;; Copyright © 2016 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016 Petter <petter@mykolab.ch>
+;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
;;;
;;; This file is an addendum GNU Guix.
;;;
@@ -139,7 +140,9 @@
(setenv "GOOS" "linux")
(setenv "GOROOT" (dirname (getcwd)))
(setenv "GOROOT_FINAL" output)
- (setenv "CGO_ENABLED" "1")
+ ;; Go 1.4's cgo will not work with binutils >= 2.27:
+ ;; https://github.com/golang/go/issues/16906
+ (setenv "CGO_ENABLED" "0")
(zero? (system* "sh" "all.bash")))))
(replace 'install
@@ -306,6 +309,18 @@ sequential processes (CSP) concurrent programming features added.")
(setenv "GOGC" "400")
(setenv "GO_TEST_TIMEOUT_SCALE" "9999")
#t)))
+
+ (replace 'build
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ ;; FIXME: Some of the .a files are not bit-reproducible.
+ (let* ((output (assoc-ref outputs "out")))
+ (setenv "CC" (which "gcc"))
+ (setenv "GOOS" "linux")
+ (setenv "GOROOT" (dirname (getcwd)))
+ (setenv "GOROOT_FINAL" output)
+ (setenv "CGO_ENABLED" "1")
+ (zero? (system* "sh" "all.bash")))))
+
(replace 'install
;; TODO: Most of this could be factorized with Go 1.4.
(lambda* (#:key outputs #:allow-other-keys)