sharlatan pushed a commit to branch go-team
in repository guix.
commit 044e02ff15a610fee15c15d152b2456f6c717767
Author: Sharlatan Hellseher <[email protected]>
AuthorDate: Sat Jan 11 12:35:39 2025 +0000
gnu: go-mvdan-cc-gofumpt: Move to golang-xyz.
* gnu/packages/golang.scm (go-mvdan-cc-gofumpt): Move from here ...
* gnu/packages/golang-xyz.scm: ... to here.
Change-Id: I8be3ad98190babe01838b66c96da27d6a826cfb9
---
gnu/packages/golang-xyz.scm | 71 +++++++++++++++++++++++++++++++++++++++++++++
gnu/packages/golang.scm | 70 --------------------------------------------
2 files changed, 71 insertions(+), 70 deletions(-)
diff --git a/gnu/packages/golang-xyz.scm b/gnu/packages/golang-xyz.scm
index 4e961583fa..bbdca486ad 100644
--- a/gnu/packages/golang-xyz.scm
+++ b/gnu/packages/golang-xyz.scm
@@ -16023,6 +16023,63 @@ recognizers) at run time.")
defined in @url{https://editorconfig.org/,https://editorconfig.org/}.")
(license license:bsd-3)))
+(define-public go-mvdan-cc-gofumpt
+ (package
+ (name "go-mvdan-cc-gofumpt")
+ (version "0.7.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mvdan/gofumpt")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0sz58av4jg0q26y1s4pznnvrzp1gi8brz9zw8aa46pzdmjw394wq"))))
+ (build-system go-build-system)
+ (arguments
+ (list
+ #:go go-1.22
+ #:build-flags
+ ;; Gofumpt formats Go files, and therefore modifies them. To help the
+ ;; developers diagnose issues, it replaces any occurrence of a
+ ;; `//gofumpt:diagnose` comment with some debugging information which
+ ;; includes the module version.
+ #~(list (format #f "-ldflags=-X ~s"
+ (string-append "main.version=" #$version " (GNU Guix)")))
+ #:import-path "mvdan.cc/gofumpt"
+ #:skip-build? #t
+ #:test-flags #~(list "-skip" "TestScript/diagnose")
+ #:phases
+ #~(modify-phases %standard-phases
+ (add-after 'unpack 'set-fallback-version
+ ;; In the event gofumpt was built without module support, it falls
+ ;; back to a string "(devel)". Since our build system does not yet
+ ;; support modules, we'll inject our version string instead, since
+ ;; this is more helpful.
+ (lambda* (#:key import-path #:allow-other-keys)
+ (with-directory-excursion (string-append "src/" import-path)
+ (substitute* "internal/version/version.go"
+ (("^const fallbackVersion.+")
+ (format #f "const fallbackVersion = ~s~%"
+ (string-append #$version " (GNU Guix)"))))))))))
+ (native-inputs
+ (list go-github-com-go-quicktest-qt))
+ (propagated-inputs
+ (list go-github-com-google-go-cmp
+ go-github-com-rogpeppe-go-internal
+ go-golang-org-x-mod
+ go-golang-org-x-sync
+ go-golang-org-x-sys
+ go-golang-org-x-tools))
+ (home-page "https://mvdan.cc/gofumpt/")
+ (synopsis "Formats Go files with a stricter ruleset than gofmt")
+ (description
+ "Enforce a stricter format than @code{gofmt}, while being backwards
+compatible. That is, @code{gofumpt} is happy with a subset of the formats
+that @code{gofmt} is happy with.")
+ (license license:bsd-3)))
+
(define-public go-mvdan-cc-sh-v3
(package
(name "go-mvdan-cc-sh-v3")
@@ -16716,6 +16773,20 @@ tool."))))
" This package provides an command line interface (CLI)
tool."))))
+(define-public gofumpt
+ (package
+ (inherit go-mvdan-cc-gofumpt)
+ (name "gofumpt")
+ (arguments
+ (substitute-keyword-arguments
+ (package-arguments go-mvdan-cc-gofumpt)
+ ((#:tests? _ #t) #f)
+ ((#:install-source? _ #t) #f)
+ ((#:skip-build? _ #t) #f)))
+ (native-inputs (package-propagated-inputs go-mvdan-cc-gofumpt))
+ (propagated-inputs '())
+ (inputs '())))
+
(define-public misspell
(package
(inherit go-github-com-client9-misspell)
diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index a082a56473..8f89e92f13 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -2698,76 +2698,6 @@ sinks and sources.")
or capture raw audio.")
(license license:expat))))
-(define-public go-mvdan-cc-gofumpt
- (package
- (name "go-mvdan-cc-gofumpt")
- (version "0.7.0")
- (source (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/mvdan/gofumpt")
- (commit (string-append "v" version))))
- (file-name (git-file-name name version))
- (sha256
- (base32
- "0sz58av4jg0q26y1s4pznnvrzp1gi8brz9zw8aa46pzdmjw394wq"))))
- (build-system go-build-system)
- (arguments
- (list
- #:go go-1.22
- #:build-flags
- ;; Gofumpt formats Go files, and therefore modifies them. To help the
- ;; developers diagnose issues, it replaces any occurrence of a
- ;; `//gofumpt:diagnose` comment with some debugging information which
- ;; includes the module version.
- #~(list (format #f "-ldflags=-X ~s"
- (string-append "main.version=" #$version " (GNU Guix)")))
- #:import-path "mvdan.cc/gofumpt"
- #:skip-build? #t
- #:test-flags #~(list "-skip" "TestScript/diagnose")
- #:phases
- #~(modify-phases %standard-phases
- (add-after 'unpack 'set-fallback-version
- ;; In the event gofumpt was built without module support, it falls
- ;; back to a string "(devel)". Since our build system does not yet
- ;; support modules, we'll inject our version string instead, since
- ;; this is more helpful.
- (lambda* (#:key import-path #:allow-other-keys)
- (with-directory-excursion (string-append "src/" import-path)
- (substitute* "internal/version/version.go"
- (("^const fallbackVersion.+")
- (format #f "const fallbackVersion = ~s~%"
- (string-append #$version " (GNU Guix)"))))))))))
- (native-inputs
- (list go-github-com-go-quicktest-qt))
- (propagated-inputs (list go-github-com-google-go-cmp
- go-github-com-rogpeppe-go-internal
- go-golang-org-x-mod
- go-golang-org-x-sync
- go-golang-org-x-sys
- go-golang-org-x-tools))
- (home-page "https://mvdan.cc/gofumpt/")
- (synopsis "Formats Go files with a stricter ruleset than gofmt")
- (description
- "Enforce a stricter format than @code{gofmt}, while being backwards
compatible.
-That is, @code{gofumpt} is happy with a subset of the formats that
-@code{gofmt} is happy with.")
- (license license:bsd-3)))
-
-(define-public gofumpt
- (package
- (inherit go-mvdan-cc-gofumpt)
- (name "gofumpt")
- (arguments
- (substitute-keyword-arguments
- (package-arguments go-mvdan-cc-gofumpt)
- ((#:tests? _ #t) #f)
- ((#:install-source? _ #t) #f)
- ((#:skip-build? _ #t) #f)))
- (native-inputs (package-propagated-inputs go-mvdan-cc-gofumpt))
- (propagated-inputs '())
- (inputs '())))
-
(define-public go-github-com-mtibben-percent
(package
(name "go-github-com-mtibben-percent")