depot/third_party/nixpkgs/pkgs/tools/text/difftastic/default.nix
Default email 818c48e259 Project import generated by Copybara.
GitOrigin-RevId: 14aef06d9b3ad1d07626bdbb16083b83f92dc6c1
2021-10-04 09:37:57 -03:00

34 lines
898 B
Nix

{ lib, fetchFromGitHub, rustPlatform, tree-sitter }:
rustPlatform.buildRustPackage rec {
pname = "difftastic";
version = "0.10.1";
src = fetchFromGitHub {
owner = "wilfred";
repo = pname;
rev = version;
sha256 = "12fcfwx56phs64yl94al2hkvss1km4n9wbrn2md7wfh1137jykbg";
};
cargoSha256 = "0xnlnkdvsd2l7acdrkz918cjkk36k01rvvm0c8hnpx5327v6nsa8";
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
'';
meta = with lib; {
description = "A syntax-aware diff";
homepage = "https://github.com/Wilfred/difftastic";
changelog = "https://github.com/Wilfred/difftastic/raw/${version}/CHANGELOG.md";
license = licenses.mit;
maintainers = with maintainers; [ ethancedwards8 figsoda ];
};
}