difftastic: add

This commit is contained in:
Pavel Korytov 2023-12-29 01:53:30 +03:00
parent d3a922d1fc
commit 3847f9766c
2 changed files with 61 additions and 0 deletions

View file

@ -18,6 +18,7 @@ I'll probably push what I can upstream when I figure Guix out.
| [[https://github.com/fdw/rofimoji/][rofimoji]] | OK | But I had to create setup.py myself | | [[https://github.com/fdw/rofimoji/][rofimoji]] | OK | But I had to create setup.py myself |
| [[https://github.com/deajan/osync][osync]] | Works | Requires shell commands as propagated-inputs | | [[https://github.com/deajan/osync][osync]] | Works | Requires shell commands as propagated-inputs |
| [[https://github.com/jdepoix/youtube-transcript-api][youtube-transcript-api]] | Works | Tests fail | | [[https://github.com/jdepoix/youtube-transcript-api][youtube-transcript-api]] | Works | Tests fail |
| [[https://difftastic.wilfred.me.uk/][difftastic]] | Works | Installation from binaries |
| [[https://github.com/PaulJuliusMartinez/jless][jless]] | Works | Installation from binaries | | [[https://github.com/PaulJuliusMartinez/jless][jless]] | Works | Installation from binaries |
| [[https://github.com/latex-lsp/texlab/][texlab]] | Works | Installation from binaries | | [[https://github.com/latex-lsp/texlab/][texlab]] | Works | Installation from binaries |
| [[https://gohugo.io/][hugo]] | Works | Installation from binaries | | [[https://gohugo.io/][hugo]] | Works | Installation from binaries |

60
difftastic-bin.scm Normal file
View file

@ -0,0 +1,60 @@
(define-module (difftastic-bin)
#:use-module (ice-9 string-fun)
#:use-module (gnu packages base)
#:use-module (gnu packages curl)
#:use-module (gnu packages version-control)
#:use-module (gnu packages xorg)
#:use-module (gnu packages tls)
#:use-module (gnu packages compression)
#:use-module (gnu packages gcc)
#:use-module (guix download)
#:use-module (guix packages)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (nonguix build-system binary))
(define libstdc++
;; Libstdc++ matching the default GCC.
(make-libstdc++ gcc))
(define-public difftastic-bin
(package
(name "difftastic-bin")
(version "0.53.1")
(source
(origin
(method url-fetch)
(uri (string-append
"https://github.com/Wilfred/difftastic/releases/download/" version "/"
"difft-x86_64-unknown-linux-gnu.tar.gz"))
(sha256
(base32
"08hx8ljm67zjmnz3mrhisgzqiz5fnd856jqgsppl2i7x4vgzw9by"))))
(build-system binary-build-system)
(arguments
`(#:phases
(modify-phases %standard-phases
(replace 'unpack
(lambda* (#:key inputs #:allow-other-keys)
(mkdir-p "difft")
(invoke "tar" "xvzf" (assoc-ref inputs "source") "-C" "difft"))))
#:install-plan
`(("difft" "/bin/"))
#:patchelf-plan
`(("difft/difft" ("glibc" "libgccjit" "libstdc++")))))
(inputs
`(("curl" ,curl)
("libgccjit" ,libgccjit)
("libstdc++" ,libstdc++)
("glibc" ,glibc)
("zlib" ,zlib)))
(synopsis "Difftastic is a structural diff tool that compares files based on their syntax.")
(description "Difftastic is a CLI diff tool that compares files based on their syntax, not line-by-line. Difftastic produces accurate diffs that are easier for humans to read.
@itemize
@item Understand what actually changed. Difftastic parses your code with tree-sitter. Unlike a line-oriented text diff, difftastic understands that the inner expression hasn't changed here.
@item Ignore formatting changes. Has your code formatter decided to split something over multiple lines? Difftastic can show what has actually changed.
@item Visualise wrapping changes. Have you added a wrapper? Difftastic can match the delimiters exactly.
@item Real line numbers. Do you know how to read @@ -5,6 +5,7 @@ syntax? Difftastic shows the actual line numbers from your files, both before and after.
@end itemize")
(home-page "https://difftastic.wilfred.me.uk/")
(license license:expat)))