efraim pushed a commit to branch rust-team
in repository guix.

commit a149087335a4fe45e6de33f711b14a10ef9e64d3
Author: Efraim Flashner <[email protected]>
AuthorDate: Wed Dec 25 13:25:13 2024 +0200

    gnu: git-absorb: Update to 0.6.16.
    
    * gnu/packages/rust-apps.scm (git-absorb): Update to 0.6.16.
    [source]: Update snippet.
    [cargo-inputs]: Add rust-clap-complete-4, rust-clap-complete-nushell-4.
    Replace rust-clap-2 with 4, rust-git2-0.18 with 0.19.
    [arguments]: Add a phase to generate and install the shell completions.
    [native-inputs]: Add git-absorb when cross-compiling.
    [inputs]: Replace libgit2-1.7 with libgit2-1.8.
    
    Change-Id: I468538a35da21f739df935c06b22eae743504b50
---
 gnu/packages/rust-apps.scm | 59 +++++++++++++++++++++++++++++++++++-----------
 1 file changed, 45 insertions(+), 14 deletions(-)

diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm
index 8f53637189..53d4fb269c 100644
--- a/gnu/packages/rust-apps.scm
+++ b/gnu/packages/rust-apps.scm
@@ -4015,7 +4015,7 @@ Full featured offline client with caching support.")
 (define-public git-absorb
   (package
     (name "git-absorb")
-    (version "0.6.11")
+    (version "0.6.16")
     (source
      (origin
        ;; crates.io does not include the manual page.
@@ -4025,19 +4025,18 @@ Full featured offline client with caching support.")
              (commit version)))
        (file-name (git-file-name name version))
        (sha256
-        (base32 "1mgqmbk2rz87blas86k340nshiy0zbw9pq76b8nqknpgghm4k029"))
+        (base32 "0az15qskgpbsbbm6sx7mqbka85n9j2xk3h2yir0d2wz6myp85475"))
        (snippet
-        #~(begin (use-modules (guix build utils))
-                 (substitute* "Cargo.toml"
-                   (("\"~") "\""))
-                 (delete-file "Documentation/git-absorb.1")))))
+        #~(begin (delete-file "Documentation/git-absorb.1")))))
     (build-system cargo-build-system)
     (arguments
      `(#:install-source? #f
        #:cargo-inputs
        (("rust-anyhow" ,rust-anyhow-1)
-        ("rust-clap" ,rust-clap-2)
-        ("rust-git2" ,rust-git2-0.18)
+        ("rust-clap" ,rust-clap-4)
+        ("rust-clap-complete" ,rust-clap-complete-4)
+        ("rust-clap-complete-nushell" ,rust-clap-complete-nushell-4)
+        ("rust-git2" ,rust-git2-0.19)
         ("rust-memchr" ,rust-memchr-2)
         ("rust-slog" ,rust-slog-2)
         ("rust-slog-async" ,rust-slog-async-2)
@@ -4048,15 +4047,47 @@ Full featured offline client with caching support.")
        (modify-phases %standard-phases
          (add-after 'install 'install-manual-page
            (lambda* (#:key outputs #:allow-other-keys)
-             (let* ((out   (assoc-ref outputs "out"))
-                    (man   (string-append out "/share/man/man1")))
+             (let* ((out (assoc-ref outputs "out"))
+                    (man (string-append out "/share/man/man1")))
                (with-directory-excursion "Documentation"
-                 (invoke "a2x" "-L" "-d" "manpage" "-f" "manpage" 
"git-absorb.txt"))
-               (install-file "Documentation/git-absorb.1" man)))))))
+                 (invoke "a2x"
+                         "--no-xmllint"
+                         "--doctype=manpage"
+                         "--format=manpage"
+                         "git-absorb.txt"))
+               (install-file "Documentation/git-absorb.1" man))))
+         (add-after 'install 'install-completions
+           (lambda* (#:key native-inputs outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (share (string-append out "/share"))
+                    (git-absorb
+                      (if ,(%current-target-system)
+                          (search-input-file native-inputs "/bin/git-absorb")
+                          (string-append out "/bin/git-absorb"))))
+               (mkdir-p (string-append out "/etc/bash_completion.d"))
+               (with-output-to-file
+                 (string-append out "/etc/bash_completion.d/git-absorb")
+                 (lambda _ (invoke git-absorb "--gen-completions" "bash")))
+               (mkdir-p (string-append share "/fish/vendor_completions.d"))
+               (with-output-to-file
+                 (string-append share 
"/fish/vendor_completions.d/git-absorb.fish")
+                 (lambda _ (invoke git-absorb "--gen-completions" "fish")))
+               (mkdir-p (string-append share "/zsh/site-functions"))
+               (with-output-to-file
+                 (string-append share "/zsh/site-functions/_git-absorb")
+                 (lambda _ (invoke git-absorb "--gen-completions" "zsh")))
+               (mkdir-p (string-append share "/elvish/lib"))
+               (with-output-to-file
+                 (string-append share "/elvish/lib/git-absorb")
+                 (lambda _ (invoke git-absorb "--gen-completions" 
"elvish")))))))))
     (native-inputs
-     (list asciidoc pkg-config))
+     (append
+       (if (%current-target-system)
+           (list this-package)
+           '())
+       (list asciidoc pkg-config)))
     (inputs
-     (list libgit2-1.7 zlib))
+     (list libgit2-1.8 zlib))
     (home-page "https://github.com/tummychow/git-absorb";)
     (synopsis "Git tool for making automatic fixup commits")
     (description

Reply via email to