tree-sitter.grammars: compile scanner.cc if exists

otherwise neovim's treesitter fails with for instance:
`undefined symbol: tree_sitter_bash_external_scanner_create`
This commit is contained in:
Matthieu Coudron 2020-09-22 20:40:36 +02:00
parent 51b854a254
commit be4832848d

View File

@ -18,7 +18,11 @@ stdenv.mkDerivation {
configurePhase= ":"; configurePhase= ":";
buildPhase = '' buildPhase = ''
runHook preBuild 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 runHook postBuild
''; '';
installPhase = '' installPhase = ''