Subject: [PATCH v2REVISION 18/18] gnu: bat: Update to 0.24.0.

From: Jaeme Sifat <[email-masked]>
Date: Sat, 30 Dec 2023 18:40:39 -0500

* gnu/packages/rust-apps.scm (bat): Update to 0.24.0.
[arguments]: Add 'install-extras step for completions and manpage.

Change-Id: Ibcd82fbd297fb84ab265486694126aed77862dd8
---
 gnu/packages/rust-apps.scm | 91 +++++++++++++++++++++++++++-----------
 1 file changed, 65 insertions(+), 26 deletions(-)

diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm
index df731d4b61..09c41bfe61 100644
--- a/gnu/packages/rust-apps.scm
+++ b/gnu/packages/rust-apps.scm
@@ -78,6 +78,7 @@ (define-module (gnu packages rust-apps)
   #:use-module (gnu packages kde)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages networking)
+  #:use-module (gnu packages shells)
   #:use-module (gnu packages ssh)
   #:use-module (gnu packages pcre)
   #:use-module (gnu packages perl)
@@ -213,59 +214,97 @@ (define-public alfis
 (define-public bat
   (package
     (name "bat")
-    (version "0.20.0")
+    (version "0.24.0")
     (source
      (origin
        (method url-fetch)
        (uri (crate-uri "bat" version))
        (file-name (string-append name "-" version ".tar.gz"))
        (sha256
-        (base32 "05sj0chxpai26fhk1k7p5m54v3j7n1x64ayx53mcimsj1skdr77m"))))
+        (base32 "11nc2iv2qhd1bs16yijqq934864ybnmg485rny70scy26xb9xk4x"))))
     (build-system cargo-build-system)
     (arguments
-     `(#:cargo-inputs
-       (("rust-ansi-colours" ,rust-ansi-colours-1)
-        ("rust-ansi-term" ,rust-ansi-term-0.12)
-        ("rust-atty" ,rust-atty-0.2)
+     (list
+      #:install-source? #f
+      #:cargo-inputs
+      `(("rust-ansi-colours" ,rust-ansi-colours-1)
         ("rust-bincode" ,rust-bincode-1)
-        ("rust-bugreport" ,rust-bugreport-0.4)
+        ("rust-bugreport" ,rust-bugreport-0.5)
         ("rust-bytesize" ,rust-bytesize-1)
-        ("rust-clap" ,rust-clap-2)
-        ("rust-clap" ,rust-clap-2)
-        ("rust-clircle" ,rust-clircle-0.3)
+        ("rust-clap" ,rust-clap-4)
+        ("rust-clircle" ,rust-clircle-0.4)
         ("rust-console" ,rust-console-0.15)
         ("rust-content-inspector" ,rust-content-inspector-0.2)
-        ("rust-dirs-next" ,rust-dirs-next-2)
-        ("rust-encoding" ,rust-encoding-0.2)
+        ("rust-encoding-rs" ,rust-encoding-rs-0.8)
+        ("rust-etcetera" ,rust-etcetera-0.8)
         ("rust-flate2" ,rust-flate2-1)
-        ("rust-git2" ,rust-git2-0.13)
+        ("rust-git2" ,rust-git2-0.18)
         ("rust-globset" ,rust-globset-0.4)
         ("rust-grep-cli" ,rust-grep-cli-0.1)
+        ("rust-home" ,rust-home-0.5)
+        ("rust-nu-ansi-term" ,rust-nu-ansi-term-0.49)
         ("rust-once-cell" ,rust-once-cell-1)
+        ("rust-os-str-bytes" ,rust-os-str-bytes-6.4)
         ("rust-path-abs" ,rust-path-abs-0.5)
+        ("rust-plist" ,rust-plist-1)
         ("rust-regex" ,rust-regex-1)
+        ("rust-run-script" ,rust-run-script-0.10)
         ("rust-semver" ,rust-semver-1)
         ("rust-serde" ,rust-serde-1)
-        ("rust-serde-yaml" ,rust-serde-yaml-0.8)
+        ("rust-serde-yaml" ,rust-serde-yaml-0.9)
         ("rust-shell-words" ,rust-shell-words-1)
-        ("rust-syntect" ,rust-syntect-4)
+        ("rust-syntect" ,rust-syntect-5)
         ("rust-thiserror" ,rust-thiserror-1)
         ("rust-unicode-width" ,rust-unicode-width-0.1)
         ("rust-walkdir" ,rust-walkdir-2)
         ("rust-wild" ,rust-wild-2))
-       #:cargo-development-inputs
-       (("rust-assert-cmd" ,rust-assert-cmd-2)
-        ("rust-nix" ,rust-nix-0.23)
-        ("rust-predicates" ,rust-predicates-2)
-        ("rust-serial-test" ,rust-serial-test-0.5)
+      #:cargo-development-inputs
+      `(("rust-assert-cmd" ,rust-assert-cmd-2)
+        ("rust-expect-test" ,rust-expect-test-1)
+        ("rust-nix" ,rust-nix-0.26)
+        ("rust-predicates" ,rust-predicates-3)
+        ("rust-serial-test" ,rust-serial-test-2)
         ("rust-tempfile" ,rust-tempfile-3)
-        ("rust-wait-timeout" ,rust-wait-timeout-0.2))))
-    (native-inputs
-     (list pkg-config))
-    (inputs
-     (list libgit2 zlib))
+        ("rust-wait-timeout" ,rust-wait-timeout-0.2))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'install 'install-extras
+            (lambda* (#:key outputs #:allow-other-keys)
+              (let* ((out (assoc-ref outputs "out"))
+                     (share (string-append out "/share"))
+                     (bash-completions-dir
+                      (string-append share
+                                     "/bash-completion/completions"))
+                     (zsh-completions-dir
+                      (string-append share
+                                     "/zsh/site-functions"))
+                     (fish-completions-dir
+                      (string-append share
+                                     "/fish/vendor_completions.d"))
+                     (man1 (string-append share "/man/man1")))
+                (mkdir-p bash-completions-dir)
+                (mkdir-p zsh-completions-dir)
+                (mkdir-p fish-completions-dir)
+                (copy-file "assets/completions/bat.bash.in"
+                           (string-append bash-completions-dir "/bat"))
+                (copy-file "assets/completions/bat.zsh.in"
+                           (string-append zsh-completions-dir "/_bat"))
+                (copy-file "assets/completions/bat.fish.in"
+                           (string-append fish-completions-dir
+                                          "/bat.fish"))
+                (rename-file "assets/manual/bat.1.in" "assets/manual/bat.1")
+                (substitute* "assets/manual/bat.1"
+                  (("\\{\\{PROJECT_EXECUTABLE\\}\\}")
+                   "bat"))
+                (substitute* "assets/manual/bat.1"
+                  (("\\{\\{PROJECT_EXECUTABLE_UPPERCASE\\}\\}")
+                   "BAT"))
+                (install-file "assets/manual/bat.1" man1)))))))
+    (native-inputs (list pkg-config))
+    (inputs (list libgit2-1.7 zlib))
     (home-page "https://github.com/sharkdp/bat")
-    (synopsis "@command{cat} clone with syntax highlighting and git integration")
+    (synopsis
+     "@command{cat} clone with syntax highlighting and git integration")
     (description
      "@command{bat} is a drop-in @command{cat} replacement featuring syntax
 highlighting for a large number of languages, git integration, and automatic

base-commit: 5844d18a8905ee3f62ccefe084dce4de61288fbf
prerequisite-patch-id: 4e9282c600240779ce2a474fc71b67e63e094dac
prerequisite-patch-id: 77c79a811fb7d80a45efe963207001573195d3f8
prerequisite-patch-id: 7ebdd534917c54094fe9f7172978c9f9df907add
prerequisite-patch-id: aff6d79885e3b9ebead360cc26e9a52b1cc3466c
prerequisite-patch-id: d3220675d7c32b8d83cf07a8086e52ab2e123f84
prerequisite-patch-id: 9660ef1508a93c6dc01d7a0caca8d9f16d97097a
prerequisite-patch-id: 01db30d9403d97de5c47c3f23c697993f5c670ff
prerequisite-patch-id: 615ac8fbe3d2d8f512a1e7999877612d4d59ea2e
prerequisite-patch-id: f53f9ca86cb5b0f5d2b5113ebb9e174421126530
prerequisite-patch-id: 3d05f5d8bc7dc720df420e11d19e7656f7164d30
prerequisite-patch-id: 0029e0e6b95b1882b8094edab798661d711de74a
prerequisite-patch-id: 7c654bde97ad56b88ef767d45c50240eb25fecc9
prerequisite-patch-id: 66e47e99eca9a7658f235489a770933d0c38717f
prerequisite-patch-id: 48d3773ce58200a823d1ebf627748b21612c07c1
prerequisite-patch-id: a6a36b297ad3f64fe45afc28b0630c01fa012c0f
prerequisite-patch-id: 9bf8f614a803af449ff9db439155ce1c741abf3b
prerequisite-patch-id: 53d2035fd294e910771e688a752dfb2fdca83afd
--
2.41.0