mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-17 09:34:36 +00:00
difftastic: use existing tree-sitter grammars when possible
This commit is contained in:
parent
5e36da0a28
commit
6c5476df41
@ -1,4 +1,4 @@
|
||||
{ lib, fetchFromGitHub, rustPlatform }:
|
||||
{ lib, fetchFromGitHub, rustPlatform, tree-sitter }:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "difftastic";
|
||||
@ -13,11 +13,22 @@ rustPlatform.buildRustPackage rec {
|
||||
|
||||
cargoSha256 = "sha256-2xGwS4wjLQ7zmfZ2gMdlUAkjPDF6SmUaiX2j1KYy0vo=";
|
||||
|
||||
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 ];
|
||||
maintainers = with maintainers; [ ethancedwards8 figsoda ];
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user