From 4336a13cc34ea5d2fb65dafd6179f1d108d6b0dd Mon Sep 17 00:00:00 2001 From: Marc Jakobi Date: Sun, 28 Apr 2024 20:46:04 +0200 Subject: [PATCH] tests: test tree-sitter-norg with tree-sitter build --- .github/workflows/nix-build-darwin.yml | 2 +- nix/overlay.nix | 60 +++++++++++++++++--------- 2 files changed, 40 insertions(+), 22 deletions(-) diff --git a/.github/workflows/nix-build-darwin.yml b/.github/workflows/nix-build-darwin.yml index 1534b1f..e6a91fb 100644 --- a/.github/workflows/nix-build-darwin.yml +++ b/.github/workflows/nix-build-darwin.yml @@ -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: diff --git a/nix/overlay.nix b/nix/overlay.nix index 671fbc7..c843489 100644 --- a/nix/overlay.nix +++ b/nix/overlay.nix @@ -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,