nixpkgs/pkgs/tools/text/difftastic/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

51 lines
1.3 KiB
Nix
Raw Normal View History

{ lib
, fetchpatch
, rustPlatform
, fetchFromGitHub
, testers
, difftastic
}:
2021-07-10 03:08:12 +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-07-10 03:08:12 +00:00
rustPlatform.buildRustPackage rec {
pname = "difftastic";
version = "0.51.1";
2021-07-10 03:08:12 +00:00
src = fetchFromGitHub {
owner = "wilfred";
repo = pname;
rev = version;
hash = "sha256-u03UL5QB0mdMTgRtxVe4pgLlCeLx1cG7czo7uBKQI84=";
2021-07-10 03:08:12 +00:00
};
cargoLock = {
lockFile = ./Cargo.lock;
outputHashes = {
"tree_magic_mini-3.0.2" = "sha256-iIX/DeDbquObDPOx/pctVFN4R8GSkD9bPNkNgOLdUJs=";
};
};
2022-04-11 07:37:15 +00:00
postPatch = ''
patch -d $cargoDepsCopy/libmimalloc-sys-0.1.24/c_src/mimalloc \
-p1 < ${mimallocPatch}
'';
passthru.tests.version = testers.testVersion { package = difftastic; };
2021-07-10 03:08:12 +00:00
meta = with lib; {
description = "A syntax-aware diff";
homepage = "https://github.com/Wilfred/difftastic";
changelog = "https://github.com/Wilfred/difftastic/blob/${version}/CHANGELOG.md";
2021-07-10 03:08:12 +00:00
license = licenses.mit;
maintainers = with maintainers; [ ethancedwards8 figsoda ];
2021-11-28 20:09:30 +00:00
mainProgram = "difft";
2021-07-10 03:08:12 +00:00
};
}