30 lines
774 B
Nix
30 lines
774 B
Nix
{ pkgs ? import <nixpkgs> { } }:
|
|
|
|
pkgs.tree-sitter.buildGrammar {
|
|
src = ./.;
|
|
version = "0.2.0";
|
|
language = "nix-shell";
|
|
generate = true;
|
|
location = "tree-sitter-nix-shell";
|
|
|
|
nativeCheckInputs = with pkgs; [ htmlq ];
|
|
checkPhase = ''
|
|
runHook preCheck
|
|
(cd ..; make test)
|
|
runHook postCheck
|
|
'';
|
|
doCheck = true;
|
|
|
|
nativeInstallCheckInputs = with pkgs; [ tree ];
|
|
installCheckPhase = ''
|
|
runHook preInstallCheck
|
|
|
|
# make sure that all files i expect to be installed are actually installed
|
|
(test -x $out/parser && test -f $out/queries/highlights.scm && test -f $out/queries/injections.scm) || \
|
|
(tree $out; echo "expected output to contain /parser and /queries/"; false)
|
|
|
|
runHook postInstallCheck
|
|
'';
|
|
doInstallCheck = true;
|
|
}
|