me
/
guix
Archived
1
0
Fork 0

gnu: go-golang-org-x-mod: Enable tests.

* gnu/packages/golang-build.scm (go-golang-org-x-mod): Apply new package style.
[source]: Swap URI to <https://go.googlesource.com/mod> as for other
go-golang-org-x-* packages.
[arguments]: <#:phases>: Add 'remove-test-files phase. Use custom 'check
phase.

Change-Id: I806d0beab89047be5fbb181db4b410c1f8df0764
master
Sharlatan Hellseher 2024-07-12 13:31:58 +01:00
parent c332715019
commit 4798af971c
No known key found for this signature in database
GPG Key ID: 76D727BFF62CD2B5
1 changed files with 24 additions and 6 deletions

View File

@ -248,18 +248,36 @@ compile does not support generics.")
(origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/golang/mod")
(url "https://go.googlesource.com/mod")
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32 "02wilb8q2bp6qhqcrbjxq1pjy3y5k8p11pxlg481609zx4rjiszc"))))
(build-system go-build-system)
(arguments
'(#:import-path "golang.org/x/mod/"
#:tests? #f
#:phases (modify-phases %standard-phases
;; Source-only package
(delete 'build))))
(list
#: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" "./..."))))))))
(home-page "https://golang.org/x/mod")
(synopsis "Tools to work directly with Go module mechanics")
(description