2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
2023-02-09 11:40:11 +00:00
|
|
|
, rustPlatform
|
2022-06-16 17:23:12 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchpatch
|
|
|
|
, 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
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "difftastic";
|
2023-02-09 11:40:11 +00:00
|
|
|
version = "0.43.1";
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wilfred";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-02-09 11:40:11 +00:00
|
|
|
sha256 = "sha256-UI63OJukot+MH+51h/yLnimJAcy8OFan9sUbuZaJZXc=";
|
2021-08-05 21:33:18 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
depsExtraArgs = {
|
|
|
|
postBuild = let
|
2023-01-11 07:51:40 +00:00
|
|
|
mimallocPatch = fetchpatch {
|
2022-06-16 17:23:12 +00:00
|
|
|
name = "mimalloc-older-macos-fixes.patch";
|
|
|
|
url = "https://github.com/microsoft/mimalloc/commit/40e0507a5959ee218f308d33aec212c3ebeef3bb.patch";
|
|
|
|
stripLen = 1;
|
|
|
|
extraPrefix = "libmimalloc-sys/c_src/mimalloc/";
|
|
|
|
sha256 = "1cqgay6ayzxsj8v1dy8405kwd8av34m4bjc84iyg9r52amlijbg4";
|
2023-01-11 07:51:40 +00:00
|
|
|
};
|
2022-06-16 17:23:12 +00:00
|
|
|
in ''
|
|
|
|
pushd $name
|
|
|
|
patch -p1 < ${mimallocPatch}
|
|
|
|
substituteInPlace libmimalloc-sys/.cargo-checksum.json \
|
|
|
|
--replace \
|
|
|
|
'6a2e9f0db0d3de160f9f15ddc8a870dbc42bba724f19f1e69b8c4952cb36821a' \
|
|
|
|
'201ab8874d9ba863406e084888e492b785a7edae00a222f395c079028d21a89a' \
|
|
|
|
--replace \
|
|
|
|
'a87a27e8432a63e5de25703ff5025588afd458e3a573e51b3c3dee2281bff0d4' \
|
|
|
|
'ab98a2da81d2145003a9cba7b7025efbd2c7b37c7a23c058c150705a3ec39298'
|
|
|
|
popd
|
|
|
|
'';
|
|
|
|
};
|
2023-02-09 11:40:11 +00:00
|
|
|
cargoSha256 = "sha256-IfwZ800PGbmzxQ0e6okieKR7A8jgt+II2j8FRDkiXfw=";
|
2022-04-15 01:41:22 +00:00
|
|
|
|
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
|
|
|
};
|
|
|
|
}
|