From 5e36da0a28b75b692df0609563cbdbeee2c266ef Mon Sep 17 00:00:00 2001 From: figsoda Date: Thu, 16 Sep 2021 09:35:05 -0400 Subject: [PATCH 1/2] difftastic: 0.8 -> 0.9 --- pkgs/tools/text/difftastic/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/text/difftastic/default.nix b/pkgs/tools/text/difftastic/default.nix index bfe430957484..adacd39a99a6 100644 --- a/pkgs/tools/text/difftastic/default.nix +++ b/pkgs/tools/text/difftastic/default.nix @@ -2,16 +2,16 @@ 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="; meta = with lib; { description = "A syntax-aware diff"; From 6c5476df41ea69ee5a8572cd1004a36a9e1d0024 Mon Sep 17 00:00:00 2001 From: figsoda Date: Thu, 16 Sep 2021 10:25:36 -0400 Subject: [PATCH 2/2] difftastic: use existing tree-sitter grammars when possible --- pkgs/tools/text/difftastic/default.nix | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/text/difftastic/default.nix b/pkgs/tools/text/difftastic/default.nix index adacd39a99a6..06bd7d0376b2 100644 --- a/pkgs/tools/text/difftastic/default.nix +++ b/pkgs/tools/text/difftastic/default.nix @@ -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 ]; }; }