sharlatan pushed a commit to branch go-team
in repository guix.

commit 7628175e00ebe5e151b920e0b190315e55c3825e
Author: Sharlatan Hellseher <[email protected]>
AuthorDate: Sat Jan 11 12:21:05 2025 +0000

    gnu: go-mvdan-cc-gofumpt: Swap inheritance with gofumpt.
    
    This change would help to use the library package by other Guix
    modules which is not easy when it's inherited from the command.
    
    * gnu/packages/golang.scm (go-mvdan-cc-gofumpt) [arguments]
    <skip-build?>: Now it's a library, keep binary in dedicated package.
    (gofumpt): Inherit.
    [arguments] <tests?>: Tested in library.
    <install-source?>: It's final binary, no source required.
    <skip-build?>: We need to build it now.
    [propagated-inputs]: Move all to native-inputs as it's final binary.
    [native-inputs]: Inherit from go-mvdan-cc-gofumpt.
    
    Change-Id: I05329e6d2a6f22d93c4a5a1baa71f5cf078b469e
---
 gnu/packages/golang.scm | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)

diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm
index 013e6cf3b1..a082a56473 100644
--- a/gnu/packages/golang.scm
+++ b/gnu/packages/golang.scm
@@ -2698,9 +2698,9 @@ sinks and sources.")
 or capture raw audio.")
       (license license:expat))))
 
-(define-public gofumpt
+(define-public go-mvdan-cc-gofumpt
   (package
-    (name "gofumpt")
+    (name "go-mvdan-cc-gofumpt")
     (version "0.7.0")
     (source (origin
               (method git-fetch)
@@ -2723,6 +2723,7 @@ or capture raw audio.")
       #~(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
@@ -2753,18 +2754,18 @@ 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-gofumpt
+(define-public gofumpt
   (package
-    (inherit gofumpt)
-    (name "go-mvdan-cc-gofumpt")
+    (inherit go-mvdan-cc-gofumpt)
+    (name "gofumpt")
     (arguments
-     `(#:import-path "mvdan.cc/gofumpt"
-       #:tests? #f
-       #:install-source? #t
-       #:phases (modify-phases %standard-phases
-                  (delete 'build))))
-    (propagated-inputs (package-inputs gofumpt))
-    (native-inputs '())
+     (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

Reply via email to