8ac5e011d6
GitOrigin-RevId: 2c3273caa153ee8eb5786bc8141b85b859e7efd7
30 lines
477 B
Nix
30 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
|
|
'';
|
|
}
|