Skip to content

Commit

Permalink
difftastic: fix build on x86_64-darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
konradmalik committed Jun 3, 2024
1 parent 33ce359 commit 2253b8c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion pkgs/tools/text/difftastic/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
{ lib
, fetchpatch
, rustPlatform
, fetchFromGitHub
, testers
, difftastic
}:

let
mimallocPatch = fetchpatch {
name = "fix-build-on-macos-releases.patch";
url = "https://github.com/microsoft/mimalloc/commit/40e0507a5959ee218f308d33aec212c3ebeef3bb.patch";
sha256 = "sha256-DK0LqsVXXiEVQSQCxZ5jyZMg0UJJx9a/WxzCroYSHZc=";
};
in
rustPlatform.buildRustPackage rec {
pname = "difftastic";
version = "0.58.0";
Expand All @@ -16,13 +24,18 @@ rustPlatform.buildRustPackage rec {
hash = "sha256-PTc8/NhWsLcKJj+9ebV/YaWEmyOWKJCYUjmVbr4z2SY=";
};

cargoSha256 = "sha256-wtWJ32bBoCmx+eGkrOk8o0OQFMhGYZEBEDI1oHn3Zuw=";
cargoHash = "sha256-wtWJ32bBoCmx+eGkrOk8o0OQFMhGYZEBEDI1oHn3Zuw=";

# 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; {
Expand Down

0 comments on commit 2253b8c

Please sign in to comment.