mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-11-07 07:26:13 -05:00
gnu: go-1.18: Fix packaging logic.
* gnu/packages/golang.scm (go-1.18)[arguments]: Only replace the custom 'patch-gcc:lib phase on certain architectures.
This commit is contained in:
parent
34e5ba942e
commit
da26ab7295
1 changed files with 23 additions and 21 deletions
|
@ -700,6 +700,7 @@ (define-public go-1.17
|
|||
(substitute* "src/time/zoneinfo_unix.go"
|
||||
(("/usr/share/zoneinfo/") tzdata-path)))))
|
||||
;; Keep this synchronized with the package inputs.
|
||||
;; Also keep syncthonized with later versions of go.
|
||||
,@(if (or (target-arm?) (target-ppc64le?))
|
||||
'((add-after 'unpack 'patch-gcc:lib
|
||||
(lambda* (#:key inputs #:allow-other-keys)
|
||||
|
@ -864,27 +865,28 @@ (define-public go-1.18
|
|||
((#:phases phases)
|
||||
`(modify-phases ,phases
|
||||
(delete 'adjust-test-suite)
|
||||
;; See the platforms using this phase in go-1.17.
|
||||
(replace 'patch-gcc:lib
|
||||
(lambda* (#:key inputs #:allow-other-keys)
|
||||
(let* ((gcclib (string-append (assoc-ref inputs "gcc:lib") "/lib")))
|
||||
;; Add libgcc to runpath
|
||||
(substitute* "src/cmd/link/internal/ld/lib.go"
|
||||
(("!rpath.set") "true"))
|
||||
(substitute* "src/cmd/go/internal/work/gccgo.go"
|
||||
(("cgoldflags := \\[\\]string\\{\\}")
|
||||
(string-append "cgoldflags := []string{"
|
||||
"\"-Wl,-rpath=" gcclib "\""
|
||||
"}"))
|
||||
(("\"-lgcc_s\", ")
|
||||
(string-append
|
||||
"\"-Wl,-rpath=" gcclib "\", \"-lgcc_s\", ")))
|
||||
(substitute* "src/cmd/go/internal/work/gc.go"
|
||||
(("ldflags, err := setextld\\(ldflags, compiler\\)")
|
||||
(string-append
|
||||
"ldflags, err := setextld(ldflags, compiler)\n"
|
||||
"ldflags = append(ldflags, \"-r\")\n"
|
||||
"ldflags = append(ldflags, \"" gcclib "\")\n"))))))))))))
|
||||
,@(if (or (target-arm?) (target-ppc64le?))
|
||||
'((replace 'patch-gcc:lib
|
||||
(lambda* (#:key inputs #:allow-other-keys)
|
||||
(let* ((gcclib (string-append (assoc-ref inputs "gcc:lib") "/lib")))
|
||||
;; Add libgcc to runpath
|
||||
(substitute* "src/cmd/link/internal/ld/lib.go"
|
||||
(("!rpath.set") "true"))
|
||||
(substitute* "src/cmd/go/internal/work/gccgo.go"
|
||||
(("cgoldflags := \\[\\]string\\{\\}")
|
||||
(string-append "cgoldflags := []string{"
|
||||
"\"-Wl,-rpath=" gcclib "\""
|
||||
"}"))
|
||||
(("\"-lgcc_s\", ")
|
||||
(string-append
|
||||
"\"-Wl,-rpath=" gcclib "\", \"-lgcc_s\", ")))
|
||||
(substitute* "src/cmd/go/internal/work/gc.go"
|
||||
(("ldflags, err := setextld\\(ldflags, compiler\\)")
|
||||
(string-append
|
||||
"ldflags, err := setextld(ldflags, compiler)\n"
|
||||
"ldflags = append(ldflags, \"-r\")\n"
|
||||
"ldflags = append(ldflags, \"" gcclib "\")\n")))))))
|
||||
'())))))))
|
||||
|
||||
(define-public go-1.19
|
||||
(package
|
||||
|
|
Loading…
Reference in a new issue