mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-22 21:53:32 +00:00
53ae5f76a2
except for typescript that provokes an error. These libraries can be used on neovim 0.5 for instance.
31 lines
477 B
Nix
31 lines
477 B
Nix
{ stdenv
|
|
, language
|
|
, tree-sitter
|
|
, version
|
|
, source
|
|
}:
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "tree-sitter-${language}-library";
|
|
inherit version;
|
|
|
|
src = source;
|
|
|
|
buildInputs = [ tree-sitter ];
|
|
|
|
dontUnpack = true;
|
|
configurePhase= ":";
|
|
buildPhase = ''
|
|
runHook preBuild
|
|
$CC -I$src/src/ -shared -o parser -Os $src/src/parser.c
|
|
runHook postBuild
|
|
'';
|
|
installPhase = ''
|
|
runHook preInstall
|
|
mkdir $out
|
|
mv parser $out/
|
|
runHook postInstall
|
|
'';
|
|
}
|