1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-11-24 22:50:49 +00:00

Merge pull request #138151 from figsoda/difftastic

difftastic: use existing tree-sitter grammars when possible, bump version
This commit is contained in:
figsoda 2021-09-18 09:25:34 -04:00 committed by GitHub
commit b560e06265
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,23 +1,34 @@
{ lib, fetchFromGitHub, rustPlatform }:
{ lib, fetchFromGitHub, rustPlatform, tree-sitter }:
rustPlatform.buildRustPackage rec {
pname = "difftastic";
version = "0.8";
version = "0.9";
src = fetchFromGitHub {
owner = "wilfred";
repo = pname;
rev = version;
sha256 = "0103py4v4v7xqv85yiczhd9w9h1aa54svhhdibvbl6x4b35y2mk5";
sha256 = "sha256-spncRJjROytGnIig6ujqHu0e/XBTN4dsJ3og4aIu+l8=";
};
cargoSha256 = "1k0d7yadicfzfc2m1aqs4c4a2k3srb54fpwarc3kwn26v3vfjai1";
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 ];
};
}