From 1bf612376574baa8771d6cc88285e30fa877aeaa Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Sat, 20 Jul 2024 00:19:46 +0100 Subject: gnu: go-github-com-google-go-cmp: Move to golang-build. * gnu/packages/golang.scm (go-github-com-google-go-cmp): Move from here ... * gnu/packages/golang-build.scm: ... to here. Change-Id: I2577d39074676f1e8552c8817d6e6843f9dd0727 --- gnu/packages/golang-build.scm | 42 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 41 insertions(+), 1 deletion(-) (limited to 'gnu/packages/golang-build.scm') diff --git a/gnu/packages/golang-build.scm b/gnu/packages/golang-build.scm index d2ee54f021..88665490bb 100644 --- a/gnu/packages/golang-build.scm +++ b/gnu/packages/golang-build.scm @@ -2,11 +2,11 @@ ;;; Copyright © 2019 Brian Leung ;;; Copyright © 2019, 2020 Leo Famulari ;;; Copyright © 2020 Danny Milosavljevic -;;; Copyright © 2020, 2024 Efraim Flashner ;;; Copyright © 2020 HiPhish ;;; Copyright © 2020 Oleg Pykhalov ;;; Copyright © 2020 Ryan Prior ;;; Copyright © 2020 Vagrant Cascadian +;;; Copyright © 2020, 2023, 2024 Efraim Flashner ;;; Copyright © 2021 Arun Isaac ;;; Copyright © 2021 Ludovic Courtès ;;; Copyright © 2021 Sarah Morgensen @@ -56,6 +56,46 @@ (define-module (gnu packages golang-build) ;;; ;;; Code: +(define-public go-github-com-google-go-cmp + (package + (name "go-github-com-google-go-cmp") + (version "0.6.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/google/go-cmp") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1n1j4hi50bl05pyys4i7y417k9g6k1blslj27z327qny7kkdl2ma")))) + (build-system go-build-system) + (arguments + (list + #:import-path "github.com/google/go-cmp/cmp" + #:unpack-path "github.com/google/go-cmp" + #:phases + #~(modify-phases %standard-phases + (replace 'check + (lambda* (#:key tests? import-path inputs #:allow-other-keys) + (when tests? + ;; The tests fail when run with gccgo. + (let ((gccgo? (false-if-exception + (search-input-file inputs "/bin/gccgo")))) + (if gccgo? + (format #t "skipping tests with gccgo compiler~%") + ;; XXX: Workaround for go-build-system's lack of Go + ;; modules support. + (with-directory-excursion (string-append "src/" import-path) + (invoke "go" "test" "-v" "./...")))))))))) + (synopsis "Determine equality of values in Go") + (home-page "https://github.com/google/go-cmp") + (description + "This package is intended to be a more powerful and safer +alternative to @code{reflect.DeepEqual} for comparing whether two values are +semantically equal.") + (license license:bsd-3))) + (define-public go-github-com-yuin-goldmark (package (name "go-github-com-yuin-goldmark") -- cgit v1.2.3 From 96998167c26cddbf44129cbf9955871b3fedaee9 Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Sat, 20 Jul 2024 08:17:09 +0100 Subject: gnu: go-golang-org-x-exp: Adjust package style. * gnu/packages/golang-build.scm (go-golang-org-x-exp): Fix indentation, apply list style. [description]: Place the sentence on a new line. Change-Id: I79d4682dc8ca0e5f0826f7e32c6dd01fc58aca44 --- gnu/packages/golang-build.scm | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'gnu/packages/golang-build.scm') diff --git a/gnu/packages/golang-build.scm b/gnu/packages/golang-build.scm index 88665490bb..d1977d36c8 100644 --- a/gnu/packages/golang-build.scm +++ b/gnu/packages/golang-build.scm @@ -262,28 +262,30 @@ (define-public go-golang-org-x-exp (base32 "0ccjgv19w5p9sbcq12czmfnkjwv3b7hfljifwax6r9wk4dx0fcn7")) (modules '((guix build utils))) (snippet - '(begin - ;; Submodules with their own go.mod files and packed as separated - ;; packages: - ;; - ;; - golang.org/x/exp/event - ;; - golang.org/x/exp/jsonrpc2 - ;; - golang.org/x/exp/shiny - ;; - golang.org/x/exp/sumbdb - ;; - golang.org/x/exp/typeparams - (for-each delete-file-recursively - (list "event" "jsonrpc2" "shiny" "sumdb" "typeparams")))))) + #~(begin + ;; Submodules with their own go.mod files and packed as separated + ;; packages: + ;; + ;; - golang.org/x/exp/event + ;; - golang.org/x/exp/jsonrpc2 + ;; - golang.org/x/exp/shiny + ;; - golang.org/x/exp/sumbdb + ;; - golang.org/x/exp/typeparams + (for-each delete-file-recursively + (list "event" "jsonrpc2" "shiny" "sumdb" "typeparams")))))) (build-system go-build-system) (arguments - '(#:import-path "golang.org/x/exp" - ;; Source-only package - #:tests? #f - #:phases (modify-phases %standard-phases - (delete 'build)))) + (list + #:import-path "golang.org/x/exp" + ;; Source-only package + #:tests? #f + #:phases #~(modify-phases %standard-phases + (delete 'build)))) (home-page "https://golang.org/x/exp") (synopsis "Experimental and deprecated Go packages") - (description "This subrepository holds experimental and deprecated (in the -@code{old} directory) packages.") + (description + "This subrepository holds experimental and deprecated (in the @code{old} +directory) packages.") (license license:bsd-3))) (define-public go-golang-org-x-exp-typeparams -- cgit v1.2.3 From 4714623e05dd645c98554f90899d22f26f77d33d Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Sat, 20 Jul 2024 08:34:26 +0100 Subject: gnu: go-golang-org-x-exp: Enable tests. * gnu/packages/golang-build.scm (go-golang-org-x-exp): Enable tests. [arguments]: <#:phases>: Add 'remove-failing-tests phase. Use custom 'check phase. [propagated-inputs]: Add go-github-com-google-go-cmp, go-golang-org-x-mod, and go-golang-org-x-tools. Change-Id: Ic1573969572d32bb7318ed73135c853f42338f86 --- gnu/packages/golang-build.scm | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'gnu/packages/golang-build.scm') diff --git a/gnu/packages/golang-build.scm b/gnu/packages/golang-build.scm index d1977d36c8..a8f4cbeb20 100644 --- a/gnu/packages/golang-build.scm +++ b/gnu/packages/golang-build.scm @@ -277,10 +277,32 @@ (define-public go-golang-org-x-exp (arguments (list #:import-path "golang.org/x/exp" - ;; Source-only package - #:tests? #f - #:phases #~(modify-phases %standard-phases - (delete 'build)))) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'remove-failing-tests + (lambda* (#:key import-path #:allow-other-keys) + (with-directory-excursion (string-append "src/" import-path) + ;; Benchmark requires other modules to pass tests, delete them. + (delete-file-recursively "slog/benchmarks") + (substitute* (find-files "." "\\_test.go$") + ;; Disable failing tests: error running `go mod init`: go: + ;; modules disabled by GO111MODULE=off; see 'go help modules' + ;; , exit status 1 + (("TestFailure") "OffTestFailure") + (("TestRelease_gitRepo_uncommittedChanges") + "OffTestRelease_gitRepo_uncommittedChanges"))))) + ;; 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" "./...")))))))) + (propagated-inputs + (list go-github-com-google-go-cmp + go-golang-org-x-mod + go-golang-org-x-tools)) (home-page "https://golang.org/x/exp") (synopsis "Experimental and deprecated Go packages") (description -- cgit v1.2.3 From 3750e11a8dfb0ae9f34db348e4d7cd7ce1e16e26 Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Sun, 21 Jul 2024 12:05:58 +0100 Subject: gnu: go-google-golang-org-protobuf: Move to golang-build. * gnu/packages/golang.scm (go-google-golang-org-protobuf): Move from here ... * gnu/packages/golang-build.scm: ... to here. Change-Id: Icf7676ac6288391631e83dc172a82529f1105cb2 --- gnu/packages/golang-build.scm | 51 +++++++++++++++++++++++++++++++++++++++++++ gnu/packages/golang.scm | 50 ------------------------------------------ 2 files changed, 51 insertions(+), 50 deletions(-) (limited to 'gnu/packages/golang-build.scm') diff --git a/gnu/packages/golang-build.scm b/gnu/packages/golang-build.scm index a8f4cbeb20..f66fe16bd0 100644 --- a/gnu/packages/golang-build.scm +++ b/gnu/packages/golang-build.scm @@ -11,11 +11,13 @@ ;;; Copyright © 2021 Ludovic Courtès ;;; Copyright © 2021 Sarah Morgensen ;;; Copyright © 2021 hackeryarn +;;; Copyright © 2022 (unmatched-parenthesis ;;; Copyright © 2023 Artyom V. Poptsov ;;; Copyright © 2023 Felix Lechner ;;; Copyright © 2023 Katherine Cox-Buday ;;; Copyright © 2023 Nicolas Graves ;;; Copyright © 2023 Timo Wilken +;;; Copyright © 2024 Hilton Chain ;;; Copyright © 2024 Troy Figiel ;;; ;;; This file is part of GNU Guix. @@ -765,6 +767,55 @@ (define-public go-golang-org-x-xerrors 1.13 error values.") (license license:bsd-3)))) +(define-public go-google-golang-org-protobuf + (package + (name "go-google-golang-org-protobuf") + (version "1.31.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://go.googlesource.com/protobuf") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1xf18kzz96hgfy1vlbnydrizzpxkqj2iamfdbj3dx5a1zz5mi8n0")))) + (build-system go-build-system) + (arguments + (list + #:import-path "google.golang.org/protobuf" + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'disable-failing-tests + (lambda* (#:key tests? unpack-path #:allow-other-keys) + (with-directory-excursion (string-append "src/" unpack-path) + (substitute* (find-files "." "\\_test.go$") + ;; XXX Failing on i686-linux: + ;; panic: unaligned 64-bit atomic operation + (("TestDynamicTypesExtensionNotFound") + "OffTestDynamicTypesExtensionNotFound") + (("TestDynamicTypesFilesChangeAfterCreation") + "OffTestDynamicTypesFilesChangeAfterCreation") + (("TestDynamicTypesFindExtensionByNameOrNumber") + "OffTestDynamicTypesFindExtensionByNameOrNumber"))))) + ;; 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" "./...")))))))) + (propagated-inputs (list go-github-com-google-go-cmp)) + (home-page "https://google.golang.org/protobuf") + (synopsis "Go library for Protocol Buffers") + (description + "The protobuf package provides a Go implementation of Protocol Buffers, a +language and platform neutral, extensible mechanism for serializing structured +data. It is a successor to @code{go-github-com-golang-protobuf} with an +improved and cleaner API.") + (license license:bsd-3))) + ;;; ;;; Avoid adding new packages to the end of this file. To reduce the chances ;;; of a merge conflict, place them above by existing packages with similar diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index 3e30cdf53f..4ca8c87cb2 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -6200,56 +6200,6 @@ (define-public go-github-com-golang-protobuf (home-page "https://github.com/golang/protobuf") (license license:bsd-3))) -(define-public go-google-golang-org-protobuf - (package - (name "go-google-golang-org-protobuf") - (version "1.31.0") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://go.googlesource.com/protobuf") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "1xf18kzz96hgfy1vlbnydrizzpxkqj2iamfdbj3dx5a1zz5mi8n0")))) - (build-system go-build-system) - (arguments - (list #:import-path "google.golang.org/protobuf" - #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'disable-failing-tests - (lambda* (#:key tests? unpack-path #:allow-other-keys) - (with-directory-excursion (string-append "src/" unpack-path) - (substitute* (find-files "." "\\_test.go$") - ;; XXX Failing on i686-linux: - ;; panic: unaligned 64-bit atomic operation - (("TestDynamicTypesExtensionNotFound") - "OffTestDynamicTypesExtensionNotFound") - (("TestDynamicTypesFilesChangeAfterCreation") - "OffTestDynamicTypesFilesChangeAfterCreation") - (("TestDynamicTypesFindExtensionByNameOrNumber") - "OffTestDynamicTypesFindExtensionByNameOrNumber"))))) - ;; 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" "./...")))))))) - (propagated-inputs (list go-github-com-google-go-cmp)) - (home-page "https://google.golang.org/protobuf") - (synopsis "Go library for Protocol Buffers") - (description - "The protobuf package provides a Go implementation of Protocol Buffers, a -language and platform neutral, extensible mechanism for serializing structured -data. - -This package is a successor to @code{go-github-com-golang-protobuf} with an -improved and cleaner API.") - (license license:bsd-3))) - (define-public go-github-com-macronut-go-tproxy (package (name "go-github-com-macronut-go-tproxy") -- cgit v1.2.3 From d43795cd208161495391104054e36abb94ea0a89 Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Sun, 21 Jul 2024 12:52:32 +0100 Subject: gnu: go-github-com-golang-protobuf: Move to golang-build. * gnu/packages/golang.scm (go-github-com-golang-protobuf): Move from here ... * gnu/packages/golang-build.scm: ... to here. Change-Id: I1682e199e6acd6b8362deff47fa7a26cbfe9c9ea --- gnu/packages/golang-build.scm | 38 +++++++++++++++++++++++++++++++++++++- gnu/packages/golang.scm | 34 ---------------------------------- 2 files changed, 37 insertions(+), 35 deletions(-) (limited to 'gnu/packages/golang-build.scm') diff --git a/gnu/packages/golang-build.scm b/gnu/packages/golang-build.scm index f66fe16bd0..bc3625c399 100644 --- a/gnu/packages/golang-build.scm +++ b/gnu/packages/golang-build.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2018, 2019, 2020 Leo Famulari ;;; Copyright © 2019 Brian Leung -;;; Copyright © 2019, 2020 Leo Famulari ;;; Copyright © 2020 Danny Milosavljevic ;;; Copyright © 2020 HiPhish ;;; Copyright © 2020 Oleg Pykhalov @@ -58,6 +58,42 @@ (define-module (gnu packages golang-build) ;;; ;;; Code: +(define-public go-github-com-golang-protobuf + (package + (name "go-github-com-golang-protobuf") + (version "1.5.3") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/golang/protobuf") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "03f1w2cd4s8a3xhl61x7yjx81kbzlrjpvnnwmbhqnz814yi7h43i")))) + (build-system go-build-system) + (arguments + (list + #:import-path "github.com/golang/protobuf" + #:phases + #~(modify-phases %standard-phases + ;; 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" "./...")))))))) + (propagated-inputs + (list go-google-golang-org-protobuf)) + (home-page "https://github.com/golang/protobuf") + (synopsis "Go support for Protocol Buffers") + (description + "This package provides Go support for the Protocol Buffers data +serialization format.") + (license license:bsd-3))) + (define-public go-github-com-google-go-cmp (package (name "go-github-com-google-go-cmp") diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index 4ca8c87cb2..92c0d0edbd 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -6166,40 +6166,6 @@ (define-public gotestsum (home-page "https://github.com/gotestyourself/gotestsum") (license license:asl2.0))) -(define-public go-github-com-golang-protobuf - (package - (name "go-github-com-golang-protobuf") - (version "1.5.3") - (source (origin - (method git-fetch) - (uri (git-reference - (url "https://github.com/golang/protobuf") - (commit (string-append "v" version)))) - (file-name (git-file-name name version)) - (sha256 - (base32 - "03f1w2cd4s8a3xhl61x7yjx81kbzlrjpvnnwmbhqnz814yi7h43i")))) - (build-system go-build-system) - (arguments - (list #:import-path "github.com/golang/protobuf" - #:phases - #~(modify-phases %standard-phases - ;; 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" "./...")))))))) - (propagated-inputs - (list go-google-golang-org-protobuf)) - (synopsis "Go support for Protocol Buffers") - (description "This package provides Go support for the Protocol Buffers -data serialization format.") - (home-page "https://github.com/golang/protobuf") - (license license:bsd-3))) - (define-public go-github-com-macronut-go-tproxy (package (name "go-github-com-macronut-go-tproxy") -- cgit v1.2.3