gnu: go-golang-org-x-mod: Simplify.

* gnu/packages/golang-build.scm (go-golang-org-x-mod)
[arguments] <skip-build?>: Set to #t, as no go files in project's root.
<test-flags>: Skip one test.
<phases>: Remove 'remove-test-files, use default 'check.
[native-inputs]: Add go-golang-org-x-tools-bootstrap.

Change-Id: Icf097e456bc72b1452bfb262589cd62ef139215b
This commit is contained in:
Sharlatan Hellseher 2024-12-19 23:40:06 +00:00
parent c4739e9d0b
commit f75ee75e47
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -626,6 +626,10 @@ (define-public go-golang-org-x-image-bootstrap
(define-public go-golang-org-x-mod
(package
(name "go-golang-org-x-mod")
;; XXX: To update to 0.22.0+ go-1.23 is required, wich provides
;; "go/version" module, see
;; <https://cs.opensource.google/go/go/+/refs/tags/
;; go1.23.0:src/go/version/version.go>.
(version "0.21.0")
(source
(origin
@ -639,28 +643,14 @@ (define-public go-golang-org-x-mod
(build-system go-build-system)
(arguments
(list
#:skip-build? #t
#:import-path "golang.org/x/mod"
#:phases
#~(modify-phases %standard-phases
(add-after 'unpack 'remove-test-files
(lambda* (#:key import-path #:allow-other-keys)
(with-directory-excursion (string-append "src/" import-path)
(for-each delete-file
(list
;; Break cycle: go-golang-org-x-mod ->
;; go-golang-org-x-tools -> go-golang-org-x-mod.
"zip/zip_test.go"
;; Trying to access
;; <http://ct.googleapis.com/logs/argon2020/ct/v1/get-sth>.
"sumdb/tlog/ct_test.go")))))
;; XXX: Workaround for go-build-system's lack of Go modules
;; support.
(delete 'build)
(replace 'check
(lambda* (#:key tests? import-path #:allow-other-keys)
(when tests?
(with-directory-excursion (string-append "src/" import-path)
(invoke "go" "test" "-v" "./..."))))))))
;; Test tries to acces:
;; "http://ct.googleapis.com/logs/argon2020/ct/v1/get-sth": dial tcp:
;; lookup ct.googleapis.com
#:test-flags #~(list "-skip" "TestCertificateTransparency")))
(native-inputs
(list go-golang-org-x-tools-bootstrap))
(home-page "https://golang.org/x/mod")
(synopsis "Tools to work directly with Go module mechanics")
(description