difftastic: fix build on x86_64-darwin

closes https://github.com/NixOS/nixpkgs/issues/315634
This commit is contained in:
Konrad Malik 2024-06-03 17:49:14 +02:00
parent 33ce359bb1
commit 95a07b0be2
No known key found for this signature in database
2 changed files with 1279 additions and 1 deletions

1263
pkgs/tools/text/difftastic/Cargo.lock generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,20 @@
{ lib
, fetchpatch
, rustPlatform
, fetchFromGitHub
, testers
, difftastic
}:
let
mimallocPatch = fetchpatch {
# fixes compilation error on x86_64-darwin
# remove after update to libmimalloc-sys >= 0.1.29
# (fixed in mimalloc >= 1.7.6 which is included with libmimalloc-sys >= 0.1.29)
url = "https://github.com/microsoft/mimalloc/commit/40e0507a5959ee218f308d33aec212c3ebeef3bb.patch";
hash = "sha256-DK0LqsVXXiEVQSQCxZ5jyZMg0UJJx9a/WxzCroYSHZc=";
};
in
rustPlatform.buildRustPackage rec {
pname = "difftastic";
version = "0.58.0";
@ -16,13 +26,18 @@ rustPlatform.buildRustPackage rec {
hash = "sha256-PTc8/NhWsLcKJj+9ebV/YaWEmyOWKJCYUjmVbr4z2SY=";
};
cargoSha256 = "sha256-wtWJ32bBoCmx+eGkrOk8o0OQFMhGYZEBEDI1oHn3Zuw=";
cargoLock.lockFile = ./Cargo.lock;
# skip flaky tests
checkFlags = [
"--skip=options::tests::test_detect_display_width"
];
postPatch = ''
patch -d $cargoDepsCopy/libmimalloc-sys-0.1.24/c_src/mimalloc \
-p1 < ${mimallocPatch}
'';
passthru.tests.version = testers.testVersion { package = difftastic; };
meta = with lib; {