ripasso-cursive: cosmetic changes (#361736)
[NixPkgs.git] / pkgs / by-name / di / difftastic / package.nix
blobd34b83c46c0f587da4109481a3ce5f2981f11a49
1 { lib
2 , fetchpatch
3 , rustPlatform
4 , fetchFromGitHub
5 , testers
6 , difftastic
7 }:
9 let
10   mimallocPatch = fetchpatch {
11     # fixes compilation error on x86_64-darwin
12     # remove after update to libmimalloc-sys >= 0.1.29
13     # (fixed in mimalloc >= 1.7.6 which is included with libmimalloc-sys >= 0.1.29)
14     url = "https://github.com/microsoft/mimalloc/commit/40e0507a5959ee218f308d33aec212c3ebeef3bb.patch";
15     hash = "sha256-DK0LqsVXXiEVQSQCxZ5jyZMg0UJJx9a/WxzCroYSHZc=";
16   };
18 rustPlatform.buildRustPackage rec {
19   pname = "difftastic";
20   version = "0.61.0";
22   src = fetchFromGitHub {
23     owner = "wilfred";
24     repo = pname;
25     rev = version;
26     hash = "sha256-hhkcujMuirBTIwUP3RMZ+F76T1TLcjMqa5l328xrwRg=";
27   };
29   cargoLock = {
30     lockFile = ./Cargo.lock;
31   };
33   # skip flaky tests
34   checkFlags = [
35     "--skip=options::tests::test_detect_display_width"
36   ];
38   postPatch = ''
39     patch -d $cargoDepsCopy/libmimalloc-sys-0.1.24/c_src/mimalloc \
40       -p1 < ${mimallocPatch}
41   '';
43   passthru.tests.version = testers.testVersion { package = difftastic; };
45   meta = with lib; {
46     description = "Syntax-aware diff";
47     homepage = "https://github.com/Wilfred/difftastic";
48     changelog = "https://github.com/Wilfred/difftastic/blob/${version}/CHANGELOG.md";
49     license = licenses.mit;
50     maintainers = with maintainers; [ ethancedwards8 figsoda matthiasbeyer ];
51     mainProgram = "difft";
52   };