Skip to content

Commit

Permalink
tests: test tree-sitter-norg with tree-sitter build
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcjkb committed Apr 28, 2024
1 parent 82e1100 commit 4336a13
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/nix-build-darwin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
nix-build-fixture:
runs-on: macos-14
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: DeterminateSystems/nix-installer-action@v9
- uses: cachix/cachix-action@v12
with:
Expand Down
60 changes: 39 additions & 21 deletions nix/overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -170,27 +170,45 @@
disabled = luaOlder "5.1";
}) {};

tree-sitter-norg = luaself.callPackage ({
buildLuarocksPackage,
fetchFromGitHub,
luaOlder,
luarocks-build-treesitter-parser,
}:
buildLuarocksPackage {
pname = "tree-sitter-norg";
version = "scm-1";
knownRockspec = "${self}/fixtures/tree-sitter-norg-scm-1.rockspec";
src = fetchFromGitHub {
owner = "nvim-neorg";
repo = "tree-sitter-norg";
rev = "014073fe8016d1ac440c51d22c77e3765d8f6855";
hash = "sha256-0wL3Pby7e4nbeVHCRfWwxZfEcAF9/s8e6Njva+lj+Rc=";
};
propagatedBuildInputs = [
luarocks-build-treesitter-parser
];
disabled = luaOlder "5.1";
}) {};
tree-sitter-norg =
(luaself.callPackage ({
buildLuarocksPackage,
fetchFromGitHub,
luaOlder,
luarocks-build-treesitter-parser,
}:
buildLuarocksPackage {
pname = "tree-sitter-norg";
version = "scm-1";
knownRockspec = "${self}/fixtures/tree-sitter-norg-scm-1.rockspec";
src = fetchFromGitHub {
owner = "nvim-neorg";
repo = "tree-sitter-norg";
rev = "014073fe8016d1ac440c51d22c77e3765d8f6855";
hash = "sha256-0wL3Pby7e4nbeVHCRfWwxZfEcAF9/s8e6Njva+lj+Rc=";
};
preBuild = ''
# tree-sitter CLI expects to be able to create log files, etc.
export HOME=$(realpath .)
'';
buildInputs = with final; [
gcc
tree-sitter
];
propagatedBuildInputs = [
luarocks-build-treesitter-parser
];
disabled = luaOlder "5.1";
}) {})
.overrideAttrs (oa: {
fixupPhase = ''
if [! -f $out/result/lib/lua/5.1/parser/haskell.so ]; then
echo "Build did not create parser/haskell.so in the expected location"
exit 1
fi
'';
});

tree-sitter-html_tags = luaself.callPackage ({
buildLuarocksPackage,
fetchFromGitHub,
Expand Down

0 comments on commit 4336a13

Please sign in to comment.