summaryrefslogtreecommitdiff
path: root/gnu/packages/golang.scm
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/golang.scm')
-rw-r--r--gnu/packages/golang.scm23
1 files changed, 19 insertions, 4 deletions
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 70731e2720..e54692205d 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -2,7 +2,7 @@
;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 Matthew Jordan <matthewjordandevops@yandex.com>
;;; Copyright © 2016 Andy Wingo <wingo@igalia.com>
-;;; Copyright © 2016, 2019 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2016, 2019, 2021 Ludovic Courtès <ludo@gnu.org>
;;; Copyright © 2016, 2017 Petter <petter@mykolab.ch>
;;; Copyright © 2016, 2017, 2018, 2019, 2020 Leo Famulari <leo@famulari.name>
;;; Copyright © 2017 Sergei Trofimovich <slyfox@inbox.ru>
@@ -272,7 +272,8 @@ in the style of communicating sequential processes (@dfn{CSP}).")
(lambda* (#:key inputs outputs #:allow-other-keys)
(let* ((gcclib (string-append (assoc-ref inputs "gcc:lib") "/lib"))
(ld (string-append (assoc-ref inputs "libc") "/lib"))
- (loader (car (find-files ld "^ld-linux.+")))
+ (loader (car (append (find-files ld "^ld-linux.+")
+ (find-files ld "^ld(64)?\\.so.+"))))
(net-base (assoc-ref inputs "net-base"))
(tzdata-path
(string-append (assoc-ref inputs "tzdata") "/share/zoneinfo"))
@@ -310,6 +311,11 @@ in the style of communicating sequential processes (@dfn{CSP}).")
(("/bin/pwd") (which "pwd"))
(("/bin/sh") (which "sh")))
+ ;; Backport fix for go-1.14 with GCC 9+
+ ;; https://github.com/golang/go/issues/39157
+ (substitute* "cmd/go/note_test.go"
+ (("cannot find 'ld'") "cannot find [‘']ld[’']"))
+
;; Add libgcc to runpath
(substitute* "cmd/link/internal/ld/lib.go"
(("!rpath.set") "true"))
@@ -404,6 +410,7 @@ in the style of communicating sequential processes (@dfn{CSP}).")
(setenv "GOOS" "linux")
(setenv "GOROOT" (dirname (getcwd)))
(setenv "GOROOT_FINAL" output)
+ (setenv "GOCACHE" "/tmp/go-cache")
(setenv "CGO_ENABLED" "1")
(invoke "sh" "all.bash"))))
(replace 'install
@@ -442,7 +449,9 @@ in the style of communicating sequential processes (@dfn{CSP}).")
(copy-recursively "../" output)
#t)))))))
(native-inputs
- `(("go" ,go-1.4)
+ `(,@(if (member (%current-system) (package-supported-systems go-1.4))
+ `(("go" ,go-1.4))
+ `(("go" ,gccgo-10)))
("go-skip-gc-test.patch" ,(search-patch "go-skip-gc-test.patch"))
,@(match (%current-system)
((or "armhf-linux" "aarch64-linux")
@@ -790,7 +799,13 @@ in the style of communicating sequential processes (@dfn{CSP}).")
(install-file file (string-append out "/share/doc/go")))
'("AUTHORS" "CONTRIBUTORS" "CONTRIBUTING.md" "PATENTS"
"README.md" "SECURITY.md"))))))))
- (inputs (alist-delete "gcc:lib" (package-inputs go-1.16)))))
+ (inputs (alist-delete "gcc:lib" (package-inputs go-1.16)))
+ (native-inputs
+ `(,@(if (not (member (%current-system) (package-supported-systems go-1.4)))
+ ;; gccgo-10.4, 11.3 and lower has a bug which causes bootstrapping
+ ;; to fail. Use go-1.16 until we have a newer version available.
+ (alist-replace "go" (list go-1.16) (package-native-inputs go-1.16))
+ (package-native-inputs go-1.16))))))
(define-public go go-1.14)