From 439fb88380e0d0af9fbb0f9613963eb41a80cb71 Mon Sep 17 00:00:00 2001 From: Carlos Hernandez Date: Mon, 31 May 2021 09:20:22 -0600 Subject: [PATCH] tree-sitter: explicitly incl CXX headers on Darwin clang needs to find headers + libraries for compiling with libc++. On Darwin we will include CXX headers when compiling C. This closes #124396 (cherry picked from commit 99b351b4bde2d9697b4e9abaa54458dcff1288d1) --- pkgs/development/tools/parsing/tree-sitter/grammar.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/development/tools/parsing/tree-sitter/grammar.nix b/pkgs/development/tools/parsing/tree-sitter/grammar.nix index 5ca381e6d2f..93e1cb3804f 100644 --- a/pkgs/development/tools/parsing/tree-sitter/grammar.nix +++ b/pkgs/development/tools/parsing/tree-sitter/grammar.nix @@ -1,5 +1,7 @@ { stdenv , tree-sitter +, libcxx +, lib }: # Build a parser grammar and put the resulting shared object in `$out/parser` @@ -27,6 +29,7 @@ stdenv.mkDerivation { "${source}/${location}" ; + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1"; buildInputs = [ tree-sitter ]; dontUnpack = true;