From 98d128a75c0c4f2919914c7713b19dab370a483c Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Fri, 17 Nov 2023 17:53:01 -0500 Subject: [PATCH] difftastic: fix build with clang 12+ Work around https://github.com/NixOS/nixpkgs/issues/166205. --- pkgs/tools/text/difftastic/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/tools/text/difftastic/default.nix b/pkgs/tools/text/difftastic/default.nix index 1db60b38a8de..98c3db975edc 100644 --- a/pkgs/tools/text/difftastic/default.nix +++ b/pkgs/tools/text/difftastic/default.nix @@ -4,6 +4,7 @@ , fetchFromGitHub , testers , difftastic +, stdenv }: let @@ -32,6 +33,11 @@ rustPlatform.buildRustPackage rec { }; }; + # Work around https://github.com/NixOS/nixpkgs/issues/166205. + env = lib.optionalAttrs stdenv.cc.isClang { + NIX_LDFLAGS = "-l${stdenv.cc.libcxx.cxxabi.libName}"; + }; + postPatch = '' patch -d $cargoDepsCopy/libmimalloc-sys-0.1.24/c_src/mimalloc \ -p1 < ${mimallocPatch}