Unverified Commit 983d1dd2 authored by Austin Horstman's avatar Austin Horstman
Browse files

luaPackages.ltreesitter: init -> 0.2.0-1

parent 7968a7d4
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ lrexlib-posix,,,,,,
lsp-progress.nvim,,,,,5.1,gepbird
lsqlite3,,,,,,
ltreesitter-ts,,,,,,
ltreesitter,,,,,,
lua-cjson,,,,,,
lua-cmsgpack,,,,,,
lua-curl,,,,,,
+29 −0
Original line number Diff line number Diff line
@@ -1912,6 +1912,35 @@ final: prev: {
    }
  ) { };

  ltreesitter = callPackage (
    {
      buildLuarocksPackage,
      fetchFromGitHub,
      fetchurl,
    }:
    buildLuarocksPackage {
      pname = "ltreesitter";
      version = "0.2.0-1";
      knownRockspec =
        (fetchurl {
          url = "mirror://luarocks/ltreesitter-0.2.0-1.rockspec";
          sha256 = "0qhmx73hkskzmf5s3yv843234ri8n3gqj4dad79b018j5ilwiria";
        }).outPath;
      src = fetchFromGitHub {
        owner = "euclidianAce";
        repo = "ltreesitter";
        tag = "v0.2.0";
        hash = "sha256-PYM6UAwp8w0qZxua5G6RFXI78Q6L3Vlc3eolXlNrN8k=";
      };

      meta = {
        homepage = "https://github.com/euclidianAce/ltreesitter";
        description = "Treesitter bindings to Lua";
        license.fullName = "MIT";
      };
    }
  ) { };

  ltreesitter-ts = callPackage (
    {
      buildLuarocksPackage,
+14 −0
Original line number Diff line number Diff line
@@ -435,6 +435,20 @@ in
    buildInputs = old.buildInputs ++ [ sqlite.dev ];
  });

  ltreesitter = prev.ltreesitter.overrideAttrs (old: {
    buildInputs = (old.buildInputs or [ ]) ++ [
      tree-sitter
    ];
    postConfigure = (old.postConfigure or "") + ''
      substituteInPlace ''${rockspecFilename} \
        --replace-fail '"tree-sitter/lib/src/lib.c",' "" \
        --replace-fail '"tree-sitter/lib/include",' '"${tree-sitter}/include"' \
        --replace-fail '"tree-sitter/lib/src"' ""
    '';
    NIX_CFLAGS_COMPILE = "-I${tree-sitter}/include";
    NIX_LDFLAGS = "-L${tree-sitter}/lib -ltree-sitter";
  });

  ltreesitter-ts = prev.ltreesitter-ts.overrideAttrs (old: {
    # Upstream package relies on git submodules (ltreesitter + tree-sitter),
    # but the default source fetch misses those files.