From be4832848d5cb28db7346e6ceb0cda1da35476af Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Tue, 22 Sep 2020 20:40:36 +0200 Subject: [PATCH] tree-sitter.grammars: compile scanner.cc if exists otherwise neovim's treesitter fails with for instance: `undefined symbol: tree_sitter_bash_external_scanner_create` --- pkgs/development/tools/parsing/tree-sitter/library.nix | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkgs/development/tools/parsing/tree-sitter/library.nix b/pkgs/development/tools/parsing/tree-sitter/library.nix index 2d5d3e7d0b4..36245ff7d44 100644 --- a/pkgs/development/tools/parsing/tree-sitter/library.nix +++ b/pkgs/development/tools/parsing/tree-sitter/library.nix @@ -18,7 +18,11 @@ stdenv.mkDerivation { configurePhase= ":"; buildPhase = '' runHook preBuild - $CC -I$src/src/ -shared -o parser -Os $src/src/parser.c + scanner_cc="$src/src/scanner.cc" + if [ ! -f "$scanner_cc" ]; then + scanner_cc="" + fi + $CC -I$src/src/ -shared -o parser -Os $src/src/parser.c $scanner_cc -lstdc++ runHook postBuild ''; installPhase = ''