2021-09-22 15:38:15 +00:00
|
|
|
{ lib, fetchFromGitHub, rustPlatform, tree-sitter }:
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "difftastic";
|
2021-12-06 16:07:01 +00:00
|
|
|
version = "0.12.0";
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wilfred";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2021-12-06 16:07:01 +00:00
|
|
|
sha256 = "sha256-A6Z3g6fbYBynyN4OhRrZNO0ZghvT3XnIahdUQ8SE8tU=";
|
2021-08-05 21:33:18 +00:00
|
|
|
};
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
cargoSha256 = "sha256-6/JwrPymtpj/CXqx3Pe43v+MJTNONArU2WEo/zgJhT4=";
|
2021-09-22 15:38:15 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
pushd vendor
|
|
|
|
for grammar in */; do
|
|
|
|
if [ -d "${tree-sitter.grammars}/$grammar" ]; then
|
|
|
|
rm -r "$grammar"
|
|
|
|
ln -s "${tree-sitter.grammars}/$grammar"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
popd
|
|
|
|
'';
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A syntax-aware diff";
|
|
|
|
homepage = "https://github.com/Wilfred/difftastic";
|
2021-09-18 10:52:07 +00:00
|
|
|
changelog = "https://github.com/Wilfred/difftastic/raw/${version}/CHANGELOG.md";
|
2021-08-05 21:33:18 +00:00
|
|
|
license = licenses.mit;
|
2021-09-22 15:38:15 +00:00
|
|
|
maintainers = with maintainers; [ ethancedwards8 figsoda ];
|
2021-12-06 16:07:01 +00:00
|
|
|
mainProgram = "difft";
|
2021-08-05 21:33:18 +00:00
|
|
|
};
|
|
|
|
}
|