diff options
author | Sharlatan Hellseher <sharlatanus@gmail.com> | 2024-07-12 13:31:58 +0100 |
---|---|---|
committer | Sharlatan Hellseher <sharlatanus@gmail.com> | 2024-07-15 12:17:49 +0100 |
commit | 4798af971ce9a61841d59dbf5f7b011c79b4c3ec (patch) | |
tree | c115b58d7d6ae400e6cb8695ba907d32522f5f5c /gnu | |
parent | c3327150190f2e678c2d7c35637e4cbf8aed737d (diff) | |
download | guix-4798af971ce9a61841d59dbf5f7b011c79b4c3ec.tar.gz guix-4798af971ce9a61841d59dbf5f7b011c79b4c3ec.zip |
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
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/packages/golang-build.scm | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/gnu/packages/golang-build.scm b/gnu/packages/golang-build.scm index d55fe2ac19..8b2d93d72a 100644 --- a/gnu/packages/golang-build.scm +++ b/gnu/packages/golang-build.scm @@ -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 |