From 2253b8ca7f9f7ae7b313bae16fc8554433234b9d Mon Sep 17 00:00:00 2001 From: Konrad Malik Date: Mon, 3 Jun 2024 17:49:14 +0200 Subject: [PATCH] difftastic: fix build on x86_64-darwin closes https://github.com/NixOS/nixpkgs/issues/315634 --- pkgs/tools/text/difftastic/default.nix | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/text/difftastic/default.nix b/pkgs/tools/text/difftastic/default.nix index c93bfe6442b6197..59b1135a7659ad0 100644 --- a/pkgs/tools/text/difftastic/default.nix +++ b/pkgs/tools/text/difftastic/default.nix @@ -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"; @@ -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; {