2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
2023-04-12 12:48:02 +00:00
|
|
|
, fetchpatch
|
2023-02-09 11:40:11 +00:00
|
|
|
, rustPlatform
|
2022-06-16 17:23:12 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, testers
|
2023-02-09 11:40:11 +00:00
|
|
|
, difftastic
|
2022-06-16 17:23:12 +00:00
|
|
|
}:
|
2021-08-05 21:33:18 +00:00
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
let
|
|
|
|
mimallocPatch = fetchpatch {
|
|
|
|
name = "fix-build-on-older-macos-releases.patch";
|
|
|
|
url = "https://github.com/microsoft/mimalloc/commit/40e0507a5959ee218f308d33aec212c3ebeef3bb.patch";
|
|
|
|
sha256 = "sha256-DK0LqsVXXiEVQSQCxZ5jyZMg0UJJx9a/WxzCroYSHZc=";
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "difftastic";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "0.48.0";
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wilfred";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-07-15 17:15:38 +00:00
|
|
|
hash = "sha256-kCCORQKqt9rDydxvddD30RMQ1eS73rgvJzCCx93lRuI=";
|
2021-08-05 21:33:18 +00:00
|
|
|
};
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
|
|
|
outputHashes = {
|
|
|
|
"tree_magic_mini-3.0.2" = "sha256-iIX/DeDbquObDPOx/pctVFN4R8GSkD9bPNkNgOLdUJs=";
|
|
|
|
};
|
|
|
|
};
|
2022-04-15 01:41:22 +00:00
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
postPatch = ''
|
|
|
|
patch -d $cargoDepsCopy/libmimalloc-sys-0.1.24/c_src/mimalloc \
|
|
|
|
-p1 < ${mimallocPatch}
|
|
|
|
'';
|
|
|
|
|
2022-04-27 09:35:20 +00:00
|
|
|
passthru.tests.version = testers.testVersion { package = difftastic; };
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "A syntax-aware diff";
|
|
|
|
homepage = "https://github.com/Wilfred/difftastic";
|
2023-02-09 11:40:11 +00:00
|
|
|
changelog = "https://github.com/Wilfred/difftastic/blob/${version}/CHANGELOG.md";
|
2021-08-05 21:33:18 +00:00
|
|
|
license = licenses.mit;
|
2021-09-22 15:38:15 +00:00
|
|
|
maintainers = with maintainers; [ ethancedwards8 figsoda ];
|
2021-12-06 16:07:01 +00:00
|
|
|
mainProgram = "difft";
|
2021-08-05 21:33:18 +00:00
|
|
|
};
|
|
|
|
}
|