Subject: [PATCH 7/7] gnu: Add difft.

From: muradm <[email-masked]>
Date: Sun, 10 Mar 2024 10:59:57 +0300

* gnu/packages/rust-apps.scm (difft): New variable.

Change-Id: I9f252fac8f0e191a57c18a87d4348107df9481d8
---
 gnu/packages/rust-apps.scm | 70 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 70 insertions(+)

diff --git a/gnu/packages/rust-apps.scm b/gnu/packages/rust-apps.scm
index 7313cdef77..fbd2dd935e 100644
--- a/gnu/packages/rust-apps.scm
+++ b/gnu/packages/rust-apps.scm
@@ -31,6 +31,7 @@
 ;;; Copyright © 2024 Herman Rimm <[email-masked]>
 ;;; Copyright © 2024 Tomas Volf <[email-masked]>
 ;;; Copyright © 2024 Suhail Singh <[email-masked]>
+;;; Copyright © 2024 muradm <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -61,6 +62,7 @@ (define-module (gnu packages rust-apps)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
+  #:use-module (gnu packages c)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages crates-apple)
   #:use-module (gnu packages crates-crypto)
@@ -424,6 +426,74 @@ (define-public diffr
 highlighting tool to ease code review from your terminal.")
     (license license:expat)))
 
+(define-public difft
+  (package
+    (name "difft")
+    (version "0.56.1")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (crate-uri "difftastic" version))
+       (file-name (string-append name "-" version ".tar.gz"))
+       (sha256
+        (base32 "1zr2zq5a58nni6113vd5nvinrw8y4p9y697mh8hs91mj3w3n4nd2"))
+       (modules '((guix build utils)))
+       (snippet
+        '(begin
+           (substitute* "Cargo.toml"
+             (("< 1.10") "<= 1.10")   ;; regex
+             (("2.0.2") "2.0.1")      ;; typed-arena
+             (("2.0.5") "2.0.12")     ;; assert_cmd
+             (("0.4.19") "0.5")       ;; ignore
+             (("0.1.24") "0.1.35")    ;; libmimalloc-sys
+             (("0.1.28") "0.1.39")    ;; mimalloc
+             (("2.1.1") "2.1.5")))))) ;; predicates
+    (build-system cargo-build-system)
+    (arguments
+     `(#:cargo-inputs (("rust-bumpalo" ,rust-bumpalo-3)
+                       ("rust-cc" ,rust-cc-1)
+                       ("rust-clap" ,rust-clap-3)
+                       ("rust-const-format" ,rust-const-format-0.2)
+                       ("rust-crossterm" ,rust-crossterm-0.27)
+                       ("rust-glob" ,rust-glob-0.3)
+                       ("rust-hashbrown" ,rust-hashbrown-0.14)
+                       ("rust-humansize" ,rust-humansize-2)
+                       ("rust-ignore" ,rust-ignore-0.4)
+                       ("rust-itertools" ,rust-itertools-0.11)
+                       ("rust-lazy-static" ,rust-lazy-static-1)
+                       ("rust-libc" ,rust-libc-0.2)
+                       ("rust-libmimalloc-sys" ,rust-libmimalloc-sys-0.1)
+                       ("rust-line-numbers" ,rust-line-numbers-0.3)
+                       ("rust-log" ,rust-log-0.4)
+                       ("rust-mimalloc" ,rust-mimalloc-0.1)
+                       ("rust-owo-colors" ,rust-owo-colors-3)
+                       ("rust-pretty-env-logger" ,rust-pretty-env-logger-0.5)
+                       ("rust-radix-heap" ,rust-radix-heap-0.4)
+                       ("rust-rayon" ,rust-rayon-1)
+                       ("rust-rayon" ,rust-rayon-1)
+                       ("rust-regex" ,rust-regex-1)
+                       ("rust-rustc-hash" ,rust-rustc-hash-1)
+                       ("rust-serde" ,rust-serde-1)
+                       ("rust-serde-json" ,rust-serde-json-1)
+                       ("rust-strsim" ,rust-strsim-0.10)
+                       ("rust-strum" ,rust-strum-0.25)
+                       ("rust-tree-sitter" ,rust-tree-sitter-0.20)
+                       ("rust-tree-magic-mini" ,rust-tree-magic-mini-3)
+                       ("rust-typed-arena" ,rust-typed-arena-2)
+                       ("rust-unicode-width" ,rust-unicode-width-0.1)
+                       ("rust-version-check" ,rust-version-check-0.9)
+                       ("rust-wu-diff" ,rust-wu-diff-0.1))
+       #:cargo-development-inputs (("rust-assert-cmd" ,rust-assert-cmd-2)
+                                   ("rust-predicates" ,rust-predicates-2)
+                                   ("rust-pretty-assertions" ,rust-pretty-assertions-1))))
+    (inputs
+     (list mimalloc))
+    (home-page "http://difftastic.wilfred.me.uk/")
+    (synopsis "A structural diff that understands syntax.")
+    (description
+     "This package provides a structural diff that understands syntax.")
+    (license license:expat)))
+
 (define-public drill
   (package
     (name "drill")
-- 
2.41.0