Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] tree-sitter: build and install tree-sitter CLI.
@ 2021-03-06 17:58 gbrlsnchs
  2021-03-07 21:33 ` ericonr
                   ` (32 more replies)
  0 siblings, 33 replies; 34+ messages in thread
From: gbrlsnchs @ 2021-03-06 17:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1591 bytes --]

There is a new pull request by gbrlsnchs against master on the void-packages repository

https://github.com/gbrlsnchs/void-packages tree-sitter
https://github.com/void-linux/void-packages/pull/29272

tree-sitter: build and install tree-sitter CLI.
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [ ] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29272.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-tree-sitter-29272.patch --]
[-- Type: text/x-diff, Size: 1254 bytes --]

From 551db5af0456edd687d37c96344e256843724f22 Mon Sep 17 00:00:00 2001
From: Gabriel Sanches <gabriel@gsr.dev>
Date: Sat, 6 Mar 2021 14:56:08 -0300
Subject: [PATCH] tree-sitter: build and install tree-sitter CLI.

---
 srcpkgs/tree-sitter/template | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/tree-sitter/template b/srcpkgs/tree-sitter/template
index e3218d9b444..ee6441b85ab 100644
--- a/srcpkgs/tree-sitter/template
+++ b/srcpkgs/tree-sitter/template
@@ -1,8 +1,9 @@
 # Template file for 'tree-sitter'
 pkgname=tree-sitter
 version=0.19.0
-revision=1
+revision=2
 build_style=gnu-makefile
+hostmakedepends="cargo"
 short_desc="Parser generator tool and incremental parsing library"
 maintainer="Érico Nogueira <ericonr@disroot.org>"
 license="MIT"
@@ -10,6 +11,19 @@ homepage="https://tree-sitter.github.io"
 distfiles="https://github.com/tree-sitter/${pkgname}/archive/v${version}.tar.gz"
 checksum=7fa56a76b29b170ae11026a5c965e5a1177c158e251bec103d353ffff16a84e9
 
+do_build() {
+	make
+
+	cd cli
+	cargo build --release --locked --all-features
+}
+
+do_install() {
+	make STRIP=true PREFIX=/usr DESTDIR=${DESTDIR} install
+
+	vbin target/release/$pkgname
+}
+
 post_install() {
 	vlicense LICENSE
 }

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
@ 2021-03-07 21:33 ` ericonr
  2021-03-07 21:38 ` ericonr
                   ` (31 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: ericonr @ 2021-03-07 21:33 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 643 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-792357198

Comment:
I was really happy with building tree-sitter not requiring any Rust just yet... Do you think this is strictly necessary?

Also, due to cross compilation and some other concerns, building the Rust parts would require a whole lot of code, to the point I would consider making this a `build_style=cargo` template and using `make` manually in `post_build` and post_install` for the `libtree-sitter` part; or just creating a paired template that should be updated in tandem that builds only the Rust part.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
  2021-03-07 21:33 ` ericonr
@ 2021-03-07 21:38 ` ericonr
  2021-03-08  0:06 ` gbrlsnchs
                   ` (30 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: ericonr @ 2021-03-07 21:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 714 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-792357198

Comment:
I was really happy with building tree-sitter not requiring any Rust just yet... Do you think this is strictly necessary?

Also, due to cross compilation and some other concerns, building the Rust parts would require a whole lot of code, to the point I would consider making this a `build_style=cargo` template and using `make` manually in `post_build` and post_install` for the `libtree-sitter` part; or just creating a paired template that should be updated in tandem that builds only the Rust part.

Doing the first suggestion will probably work well enough, I think.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
  2021-03-07 21:33 ` ericonr
  2021-03-07 21:38 ` ericonr
@ 2021-03-08  0:06 ` gbrlsnchs
  2021-03-08  0:34 ` ericonr
                   ` (29 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: gbrlsnchs @ 2021-03-08  0:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1299 bytes --]

New comment by gbrlsnchs on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-792380919

Comment:
> I was really happy with building tree-sitter not requiring any Rust just yet... Do you think this is strictly necessary?

I think the CLI is part and parcel of tree-sitter as a whole, so currently we have an incomplete package in the repos. I say that based on [this explanation](https://tree-sitter.github.io/tree-sitter/implementation) from its homepage.

> Also, due to cross compilation and some other concerns, building the Rust parts would require a whole lot of code, to the point I would consider making this a `build_style=cargo` template and using `make` manually in `post_build` and post_install`for the`libtree-sitter` part; or just creating a paired template that should be updated in tandem that builds only the Rust part.
> 
> Doing the first suggestion will probably work well enough, I think.

Yeah, we could have something like `tree-sitter-cli_package()` but, as you said, Rust demands fine-tuning manual installation, so it would be a bad choice maintainability-wise. I can in fact use the `cargo` build style for the CLI and then run the appropriate `make` command in `post_build`/`post_install` as needed, what do you think?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (2 preceding siblings ...)
  2021-03-08  0:06 ` gbrlsnchs
@ 2021-03-08  0:34 ` ericonr
  2021-03-08  0:45 ` gbrlsnchs
                   ` (28 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: ericonr @ 2021-03-08  0:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 430 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-792387909

Comment:
> I can in fact use the cargo build style for the CLI and then run the appropriate make command in post_build/post_install as needed, what do you think?

Yes, that'd be the best option, I think.

Does the CLI need `tree-sitter` headers to work? Or is it completely separate from that? 

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (3 preceding siblings ...)
  2021-03-08  0:34 ` ericonr
@ 2021-03-08  0:45 ` gbrlsnchs
  2021-03-08  2:27 ` ericonr
                   ` (27 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: gbrlsnchs @ 2021-03-08  0:45 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 357 bytes --]

New comment by gbrlsnchs on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-792391063

Comment:
> Does the CLI need `tree-sitter` headers to work? Or is it completely separate from that?

Sincere question from a C noob: would that affect anything considering both CLI and library are always shipped together?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (4 preceding siblings ...)
  2021-03-08  0:45 ` gbrlsnchs
@ 2021-03-08  2:27 ` ericonr
  2021-03-08 14:26 ` gbrlsnchs
                   ` (26 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: ericonr @ 2021-03-08  2:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 344 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-792416488

Comment:
> Sincere question from a C noob: would that affect anything considering both CLI and library are always shipped together?

Yes, the cli would be shipped in either `tree-sitter-devel` or `tree-sitter`.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (5 preceding siblings ...)
  2021-03-08  2:27 ` ericonr
@ 2021-03-08 14:26 ` gbrlsnchs
  2021-03-08 14:27 ` gbrlsnchs
                   ` (25 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: gbrlsnchs @ 2021-03-08 14:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 751 bytes --]

New comment by gbrlsnchs on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-792790658

Comment:
> > Sincere question from a C noob: would that affect anything considering both CLI and library are always shipped together?
> 
> Yes, the cli would be shipped in either `tree-sitter-devel` or `tree-sitter`.

Oh, I see, thanks. In my experience, no, you don't need the headers. But there is always a possibility that some niche operation needs it, since the CLI compiles things, still I think it can be worked around by simply installing `tree-sitter-devel` when this necessity arises, if it ever happens.

What do you think, can we ship the CLI in `tree-sitter` and make the latter a `cargo` template?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (6 preceding siblings ...)
  2021-03-08 14:26 ` gbrlsnchs
@ 2021-03-08 14:27 ` gbrlsnchs
  2021-03-08 14:27 ` gbrlsnchs
                   ` (24 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: gbrlsnchs @ 2021-03-08 14:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 621 bytes --]

New comment by gbrlsnchs on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-792790658

Comment:
> Yes, the cli would be shipped in either `tree-sitter-devel` or `tree-sitter`.

Oh, I see, thanks. In my experience, no, you don't need the headers. But there is always a possibility that some niche operation needs it, since the CLI compiles things, still I think it can be worked around by simply installing `tree-sitter-devel` when this necessity arises, if it ever happens.

What do you think, can we ship the CLI in `tree-sitter` and make the latter a `cargo` template?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (7 preceding siblings ...)
  2021-03-08 14:27 ` gbrlsnchs
@ 2021-03-08 14:27 ` gbrlsnchs
  2021-03-08 15:13 ` ericonr
                   ` (23 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: gbrlsnchs @ 2021-03-08 14:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 620 bytes --]

New comment by gbrlsnchs on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-792790658

Comment:
> Yes, the cli would be shipped in either `tree-sitter-devel` or `tree-sitter`.

Oh, I see, thanks. In my experience, no, you don't need the headers. But there is always a possibility that some niche operation needs it, since the CLI compiles stuff, still I think it can be worked around by simply installing `tree-sitter-devel` when this necessity arises, if it ever happens.

What do you think, can we ship the CLI in `tree-sitter` and make the latter a `cargo` template?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (8 preceding siblings ...)
  2021-03-08 14:27 ` gbrlsnchs
@ 2021-03-08 15:13 ` ericonr
  2021-03-08 17:50 ` gbrlsnchs
                   ` (22 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: ericonr @ 2021-03-08 15:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 471 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-792821166

Comment:
I'm still somewhat pending towards shipping the CLI in devel, since packages like neovim will come to depend on it and it's more stuff to pull in (probably much bigger than the library) that most people won't be using. If you want to generate grammars, you can grab the -devel package.

And yes, switch to the cargo build style.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (9 preceding siblings ...)
  2021-03-08 15:13 ` ericonr
@ 2021-03-08 17:50 ` gbrlsnchs
  2021-03-08 18:27 ` ericonr
                   ` (21 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: gbrlsnchs @ 2021-03-08 17:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1041 bytes --]

New comment by gbrlsnchs on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-792947486

Comment:
> I'm still somewhat pending towards shipping the CLI in devel, since packages like neovim will come to depend on it and it's more stuff to pull in (probably much bigger than the library) that most people won't be using. If you want to generate grammars, you can grab the -devel package.

Neovim 0.5 only uses `tree-sitter-devel` as a `makedepends` dependency (example [here](https://github.com/gbrlsnchs/void-packages/blob/8030a6713946c4dedd2c89fbaf25988099e1a029/srcpkgs/neovim/template) from my custom packaging), so its end-users won't necessarily install `tree-sitter-devel` on their machines in order to run Neovim, since only `tree-sitter` (which includes `libtree-sitter`, needed by Neovim) is needed.

That's why I think shipping `libtree-sitter` and the CLI together in the same package is a better idea, and I think it's a lot more expected than having the CLI in a `-devel` package.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (10 preceding siblings ...)
  2021-03-08 17:50 ` gbrlsnchs
@ 2021-03-08 18:27 ` ericonr
  2021-03-08 18:27 ` ericonr
                   ` (20 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: ericonr @ 2021-03-08 18:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 762 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-792973330

Comment:
> so its end-users won't necessarily install tree-sitter-devel on their machines in order to run Neovim, since only tree-sitter (which includes libtree-sitter, needed by Neovim) is needed.

Which is exactly my point. Most neovim users (or some other application) *won't* be defining their own grammars, but we want to be sure people *can* do that by shipping a neovim linked against tree-sitter, which is a tiny simple library. The cost increases a lot when people need to have a big CLI. IMO looking for a CLI used for compiling grammars in a -devel package sounds reasonable, and one can also find it using `xlocate`.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (11 preceding siblings ...)
  2021-03-08 18:27 ` ericonr
@ 2021-03-08 18:27 ` ericonr
  2021-03-08 18:49 ` gbrlsnchs
                   ` (19 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: ericonr @ 2021-03-08 18:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 803 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-792973330

Comment:
> so its end-users won't necessarily install tree-sitter-devel on their machines in order to run Neovim, since only tree-sitter (which includes libtree-sitter, needed by Neovim) is needed.

Which is exactly my point. Most neovim users (or some other application) *won't* be defining their own grammars, but we want to be sure people *can* do that by shipping a neovim linked against tree-sitter, which is a tiny simple library. The cost increases a lot when people need to have a big CLI in their file system that they don't use. IMO looking for a CLI used for compiling grammars in a -devel package sounds reasonable, and one can also find it using `xlocate`.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (12 preceding siblings ...)
  2021-03-08 18:27 ` ericonr
@ 2021-03-08 18:49 ` gbrlsnchs
  2021-03-08 18:55 ` FollieHiyuki
                   ` (18 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: gbrlsnchs @ 2021-03-08 18:49 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 824 bytes --]

New comment by gbrlsnchs on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-792987958

Comment:
OK, I don't think there's a correct answer here so I agree to do it as you suggest, which I think is also a very good option. I only have a few questions now before patching this PR:
- How do I set up the CLI to be installed along with `tree-sitter-devel`? Is it enough to have an empty `do_install` in the main template (in order to override `cargo` build style own `do_install`) and then add `vinstall ...` inside `pkg_install`?
- Just for learning purposes on my part, could you give me an example on how would I look for the tree-sitter CLI using `xlocate` in order to find it, for example, in the `tree-sitter-devel` package? I might need this later, so better to learn now.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (13 preceding siblings ...)
  2021-03-08 18:49 ` gbrlsnchs
@ 2021-03-08 18:55 ` FollieHiyuki
  2021-03-08 19:03 ` ericonr
                   ` (17 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: FollieHiyuki @ 2021-03-08 18:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 248 bytes --]

New comment by FollieHiyuki on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-792991635

Comment:
Something like this `xlocate /usr/bin/tree-sitter-cli` will give you the package that provides the cli

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (14 preceding siblings ...)
  2021-03-08 18:55 ` FollieHiyuki
@ 2021-03-08 19:03 ` ericonr
  2021-03-08 20:50 ` [PR PATCH] [Updated] " gbrlsnchs
                   ` (16 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: ericonr @ 2021-03-08 19:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 272 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-792996894

Comment:
Or really just `xlocate tree-sitter-cli`. What you should do here is not touch `do_install` and in `pkg_install` do `vmove usr/bin`

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (15 preceding siblings ...)
  2021-03-08 19:03 ` ericonr
@ 2021-03-08 20:50 ` gbrlsnchs
  2021-03-08 20:51 ` gbrlsnchs
                   ` (15 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: gbrlsnchs @ 2021-03-08 20:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1596 bytes --]

There is an updated pull request by gbrlsnchs against master on the void-packages repository

https://github.com/gbrlsnchs/void-packages tree-sitter
https://github.com/void-linux/void-packages/pull/29272

tree-sitter: build and install tree-sitter CLI.
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29272.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-tree-sitter-29272.patch --]
[-- Type: text/x-diff, Size: 2971 bytes --]

From ef1c1a8099ea52d4a3b89581f648e6391fb9289d Mon Sep 17 00:00:00 2001
From: Gabriel Sanches <gabriel@gsr.dev>
Date: Mon, 8 Mar 2021 17:47:17 -0300
Subject: [PATCH 1/2] tree-sitter: update to 0.19.2.

---
 common/shlibs                | 2 +-
 srcpkgs/tree-sitter/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index a911b3892cb..f17eadcd60e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3964,4 +3964,4 @@ libopenaptx.so.0 libopenaptx-0.2.0_1
 libsimavr.so.1 simavr-1.6_2
 libsimavrparts.so.1 simavr-1.6_2
 libsword-1.8.1.so libsword-1.8.1_6
-libtree-sitter.so.0 tree-sitter-0.19.0_1
+libtree-sitter.so.0 tree-sitter-0.19.2_1
diff --git a/srcpkgs/tree-sitter/template b/srcpkgs/tree-sitter/template
index e3218d9b444..fc1d074a5aa 100644
--- a/srcpkgs/tree-sitter/template
+++ b/srcpkgs/tree-sitter/template
@@ -1,6 +1,6 @@
 # Template file for 'tree-sitter'
 pkgname=tree-sitter
-version=0.19.0
+version=0.19.2
 revision=1
 build_style=gnu-makefile
 short_desc="Parser generator tool and incremental parsing library"
@@ -8,7 +8,7 @@ maintainer="Érico Nogueira <ericonr@disroot.org>"
 license="MIT"
 homepage="https://tree-sitter.github.io"
 distfiles="https://github.com/tree-sitter/${pkgname}/archive/v${version}.tar.gz"
-checksum=7fa56a76b29b170ae11026a5c965e5a1177c158e251bec103d353ffff16a84e9
+checksum=c1b0eace3264799a5b55415bfb8a17ef064ea086205e5e842d47df2296812fe9
 
 post_install() {
 	vlicense LICENSE

From c0620e609999d12a8b91714d917744f6d9ccfe7c Mon Sep 17 00:00:00 2001
From: Gabriel Sanches <gabriel@gsr.dev>
Date: Sat, 6 Mar 2021 14:56:08 -0300
Subject: [PATCH 2/2] tree-sitter: package the CLI.

---
 srcpkgs/tree-sitter/template | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/tree-sitter/template b/srcpkgs/tree-sitter/template
index fc1d074a5aa..e28860f90a7 100644
--- a/srcpkgs/tree-sitter/template
+++ b/srcpkgs/tree-sitter/template
@@ -2,7 +2,8 @@
 pkgname=tree-sitter
 version=0.19.2
 revision=1
-build_style=gnu-makefile
+build_style=cargo
+make_install_args="--path=cli"
 short_desc="Parser generator tool and incremental parsing library"
 maintainer="Érico Nogueira <ericonr@disroot.org>"
 license="MIT"
@@ -10,7 +11,15 @@ homepage="https://tree-sitter.github.io"
 distfiles="https://github.com/tree-sitter/${pkgname}/archive/v${version}.tar.gz"
 checksum=c1b0eace3264799a5b55415bfb8a17ef064ea086205e5e842d47df2296812fe9
 
+post_build() {
+	# Build libtree-sitter, since do_build builds the tree-sitter CLI.
+	make
+}
+
 post_install() {
+	# Install libtree-sitter, since do_install installs the tree-sitter CLI.
+	make STRIP=true PREFIX=/usr DESTDIR=${DESTDIR} install
+
 	vlicense LICENSE
 }
 
@@ -18,6 +27,7 @@ tree-sitter-devel_package() {
 	short_desc+=" - development files"
 	depends="${sourcepkg}>=${version}_${revision}"
 	pkg_install() {
+		vmove usr/bin
 		vmove usr/include
 		vmove "usr/lib/*.a"
 		vmove "usr/lib/*.so"

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (16 preceding siblings ...)
  2021-03-08 20:50 ` [PR PATCH] [Updated] " gbrlsnchs
@ 2021-03-08 20:51 ` gbrlsnchs
  2021-03-08 20:53 ` gbrlsnchs
                   ` (14 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: gbrlsnchs @ 2021-03-08 20:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1596 bytes --]

There is an updated pull request by gbrlsnchs against master on the void-packages repository

https://github.com/gbrlsnchs/void-packages tree-sitter
https://github.com/void-linux/void-packages/pull/29272

tree-sitter: build and install tree-sitter CLI.
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29272.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-tree-sitter-29272.patch --]
[-- Type: text/x-diff, Size: 2935 bytes --]

From ad30c6cd4bc2520b98337a642bcb29ac853cc82c Mon Sep 17 00:00:00 2001
From: Gabriel Sanches <gabriel@gsr.dev>
Date: Mon, 8 Mar 2021 17:47:17 -0300
Subject: [PATCH 1/2] tree-sitter: update to 0.19.2.

---
 common/shlibs                | 1 +
 srcpkgs/tree-sitter/template | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 42f37d8a08b..9f859863a95 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3966,3 +3966,4 @@ libsimavrparts.so.1 simavr-1.6_2
 libsword-1.8.1.so libsword-1.8.1_6
 libpari-gmp.so.7 pari-2.13.0_1
 libtree-sitter.so.0 tree-sitter-0.19.0_1
+libtree-sitter.so.0 tree-sitter-0.19.2_1
diff --git a/srcpkgs/tree-sitter/template b/srcpkgs/tree-sitter/template
index e3218d9b444..fc1d074a5aa 100644
--- a/srcpkgs/tree-sitter/template
+++ b/srcpkgs/tree-sitter/template
@@ -1,6 +1,6 @@
 # Template file for 'tree-sitter'
 pkgname=tree-sitter
-version=0.19.0
+version=0.19.2
 revision=1
 build_style=gnu-makefile
 short_desc="Parser generator tool and incremental parsing library"
@@ -8,7 +8,7 @@ maintainer="Érico Nogueira <ericonr@disroot.org>"
 license="MIT"
 homepage="https://tree-sitter.github.io"
 distfiles="https://github.com/tree-sitter/${pkgname}/archive/v${version}.tar.gz"
-checksum=7fa56a76b29b170ae11026a5c965e5a1177c158e251bec103d353ffff16a84e9
+checksum=c1b0eace3264799a5b55415bfb8a17ef064ea086205e5e842d47df2296812fe9
 
 post_install() {
 	vlicense LICENSE

From 9635d982180c207f491b02e7cd40c79db0773908 Mon Sep 17 00:00:00 2001
From: Gabriel Sanches <gabriel@gsr.dev>
Date: Sat, 6 Mar 2021 14:56:08 -0300
Subject: [PATCH 2/2] tree-sitter: package the CLI.

---
 srcpkgs/tree-sitter/template | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/tree-sitter/template b/srcpkgs/tree-sitter/template
index fc1d074a5aa..e28860f90a7 100644
--- a/srcpkgs/tree-sitter/template
+++ b/srcpkgs/tree-sitter/template
@@ -2,7 +2,8 @@
 pkgname=tree-sitter
 version=0.19.2
 revision=1
-build_style=gnu-makefile
+build_style=cargo
+make_install_args="--path=cli"
 short_desc="Parser generator tool and incremental parsing library"
 maintainer="Érico Nogueira <ericonr@disroot.org>"
 license="MIT"
@@ -10,7 +11,15 @@ homepage="https://tree-sitter.github.io"
 distfiles="https://github.com/tree-sitter/${pkgname}/archive/v${version}.tar.gz"
 checksum=c1b0eace3264799a5b55415bfb8a17ef064ea086205e5e842d47df2296812fe9
 
+post_build() {
+	# Build libtree-sitter, since do_build builds the tree-sitter CLI.
+	make
+}
+
 post_install() {
+	# Install libtree-sitter, since do_install installs the tree-sitter CLI.
+	make STRIP=true PREFIX=/usr DESTDIR=${DESTDIR} install
+
 	vlicense LICENSE
 }
 
@@ -18,6 +27,7 @@ tree-sitter-devel_package() {
 	short_desc+=" - development files"
 	depends="${sourcepkg}>=${version}_${revision}"
 	pkg_install() {
+		vmove usr/bin
 		vmove usr/include
 		vmove "usr/lib/*.a"
 		vmove "usr/lib/*.so"

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (17 preceding siblings ...)
  2021-03-08 20:51 ` gbrlsnchs
@ 2021-03-08 20:53 ` gbrlsnchs
  2021-03-08 20:56 ` gbrlsnchs
                   ` (13 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: gbrlsnchs @ 2021-03-08 20:53 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1596 bytes --]

There is an updated pull request by gbrlsnchs against master on the void-packages repository

https://github.com/gbrlsnchs/void-packages tree-sitter
https://github.com/void-linux/void-packages/pull/29272

tree-sitter: build and install tree-sitter CLI.
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29272.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-tree-sitter-29272.patch --]
[-- Type: text/x-diff, Size: 2965 bytes --]

From fe4c7410bf5714742c32b833e125c8f6ab2c82c6 Mon Sep 17 00:00:00 2001
From: Gabriel Sanches <gabriel@gsr.dev>
Date: Mon, 8 Mar 2021 17:47:17 -0300
Subject: [PATCH 1/2] tree-sitter: update to 0.19.2.

---
 common/shlibs                | 2 +-
 srcpkgs/tree-sitter/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 42f37d8a08b..a4c37034bec 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3965,4 +3965,4 @@ libsimavr.so.1 simavr-1.6_2
 libsimavrparts.so.1 simavr-1.6_2
 libsword-1.8.1.so libsword-1.8.1_6
 libpari-gmp.so.7 pari-2.13.0_1
-libtree-sitter.so.0 tree-sitter-0.19.0_1
+libtree-sitter.so.0 tree-sitter-0.19.2_1
diff --git a/srcpkgs/tree-sitter/template b/srcpkgs/tree-sitter/template
index e3218d9b444..fc1d074a5aa 100644
--- a/srcpkgs/tree-sitter/template
+++ b/srcpkgs/tree-sitter/template
@@ -1,6 +1,6 @@
 # Template file for 'tree-sitter'
 pkgname=tree-sitter
-version=0.19.0
+version=0.19.2
 revision=1
 build_style=gnu-makefile
 short_desc="Parser generator tool and incremental parsing library"
@@ -8,7 +8,7 @@ maintainer="Érico Nogueira <ericonr@disroot.org>"
 license="MIT"
 homepage="https://tree-sitter.github.io"
 distfiles="https://github.com/tree-sitter/${pkgname}/archive/v${version}.tar.gz"
-checksum=7fa56a76b29b170ae11026a5c965e5a1177c158e251bec103d353ffff16a84e9
+checksum=c1b0eace3264799a5b55415bfb8a17ef064ea086205e5e842d47df2296812fe9
 
 post_install() {
 	vlicense LICENSE

From 5f6676bb2bdc93ee830cb385f9ee06e45df9dba7 Mon Sep 17 00:00:00 2001
From: Gabriel Sanches <gabriel@gsr.dev>
Date: Sat, 6 Mar 2021 14:56:08 -0300
Subject: [PATCH 2/2] tree-sitter: package the CLI.

---
 srcpkgs/tree-sitter/template | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/tree-sitter/template b/srcpkgs/tree-sitter/template
index fc1d074a5aa..e28860f90a7 100644
--- a/srcpkgs/tree-sitter/template
+++ b/srcpkgs/tree-sitter/template
@@ -2,7 +2,8 @@
 pkgname=tree-sitter
 version=0.19.2
 revision=1
-build_style=gnu-makefile
+build_style=cargo
+make_install_args="--path=cli"
 short_desc="Parser generator tool and incremental parsing library"
 maintainer="Érico Nogueira <ericonr@disroot.org>"
 license="MIT"
@@ -10,7 +11,15 @@ homepage="https://tree-sitter.github.io"
 distfiles="https://github.com/tree-sitter/${pkgname}/archive/v${version}.tar.gz"
 checksum=c1b0eace3264799a5b55415bfb8a17ef064ea086205e5e842d47df2296812fe9
 
+post_build() {
+	# Build libtree-sitter, since do_build builds the tree-sitter CLI.
+	make
+}
+
 post_install() {
+	# Install libtree-sitter, since do_install installs the tree-sitter CLI.
+	make STRIP=true PREFIX=/usr DESTDIR=${DESTDIR} install
+
 	vlicense LICENSE
 }
 
@@ -18,6 +27,7 @@ tree-sitter-devel_package() {
 	short_desc+=" - development files"
 	depends="${sourcepkg}>=${version}_${revision}"
 	pkg_install() {
+		vmove usr/bin
 		vmove usr/include
 		vmove "usr/lib/*.a"
 		vmove "usr/lib/*.so"

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (18 preceding siblings ...)
  2021-03-08 20:53 ` gbrlsnchs
@ 2021-03-08 20:56 ` gbrlsnchs
  2021-03-08 22:52 ` ericonr
                   ` (12 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: gbrlsnchs @ 2021-03-08 20:56 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 286 bytes --]

New comment by gbrlsnchs on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-793070941

Comment:
Thanks for all the tips and teachings, I have followed as you instructed, so now the tree-sitter CLI should be packaged in `tree-sitter-devel`.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (19 preceding siblings ...)
  2021-03-08 20:56 ` gbrlsnchs
@ 2021-03-08 22:52 ` ericonr
  2021-03-09  0:31 ` gbrlsnchs
                   ` (11 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: ericonr @ 2021-03-08 22:52 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 504 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-793144998

Comment:
```
 ---- tests::tags_test::test_tags_with_parse_error stdout ----
thread 'tests::tags_test::test_tags_with_parse_error' panicked at 'called `Result::unwrap()` on an `Err` value: Error(["No such file or directory (os error 2)", "Failed to read grammar.json"])', cli/src/tests/helpers/fixtures.rs:25:10
```

maybe the tests are running in the wrong directory?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (20 preceding siblings ...)
  2021-03-08 22:52 ` ericonr
@ 2021-03-09  0:31 ` gbrlsnchs
  2021-03-09  0:39 ` ericonr
                   ` (10 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: gbrlsnchs @ 2021-03-09  0:31 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 383 bytes --]

New comment by gbrlsnchs on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-793200339

Comment:
> maybe the tests are running in the wrong directory?

Just checked here, tests demand generating fixtures via scripts. Those scripts fetch files from another repository and then run some `cargo` commands. Should I skip `do_check` at all?

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (21 preceding siblings ...)
  2021-03-09  0:31 ` gbrlsnchs
@ 2021-03-09  0:39 ` ericonr
  2021-03-09  0:39 ` ericonr
                   ` (9 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: ericonr @ 2021-03-09  0:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 217 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-793205074

Comment:
Yeah probably disable :(

Or try at least running tests for the C library.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (22 preceding siblings ...)
  2021-03-09  0:39 ` ericonr
@ 2021-03-09  0:39 ` ericonr
  2021-03-09  1:02 ` gbrlsnchs
                   ` (8 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: ericonr @ 2021-03-09  0:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 253 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-793205074

Comment:
Yeah probably disable :(

Or try at least running tests for the C library. I don't remember if there were any.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (23 preceding siblings ...)
  2021-03-09  0:39 ` ericonr
@ 2021-03-09  1:02 ` gbrlsnchs
  2021-03-09  1:06 ` [PR PATCH] [Updated] " gbrlsnchs
                   ` (7 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: gbrlsnchs @ 2021-03-09  1:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 267 bytes --]

New comment by gbrlsnchs on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-793224266

Comment:
There doesn't seem to have neither a `check` nor `test` target for `make`, so, yeah... I'm disabling check for this package.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Updated] tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (24 preceding siblings ...)
  2021-03-09  1:02 ` gbrlsnchs
@ 2021-03-09  1:06 ` gbrlsnchs
  2021-03-09  8:51 ` FollieHiyuki
                   ` (6 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: gbrlsnchs @ 2021-03-09  1:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1596 bytes --]

There is an updated pull request by gbrlsnchs against master on the void-packages repository

https://github.com/gbrlsnchs/void-packages tree-sitter
https://github.com/void-linux/void-packages/pull/29272

tree-sitter: build and install tree-sitter CLI.
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/29272.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-tree-sitter-29272.patch --]
[-- Type: text/x-diff, Size: 3053 bytes --]

From fe4c7410bf5714742c32b833e125c8f6ab2c82c6 Mon Sep 17 00:00:00 2001
From: Gabriel Sanches <gabriel@gsr.dev>
Date: Mon, 8 Mar 2021 17:47:17 -0300
Subject: [PATCH 1/2] tree-sitter: update to 0.19.2.

---
 common/shlibs                | 2 +-
 srcpkgs/tree-sitter/template | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 42f37d8a08b..a4c37034bec 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -3965,4 +3965,4 @@ libsimavr.so.1 simavr-1.6_2
 libsimavrparts.so.1 simavr-1.6_2
 libsword-1.8.1.so libsword-1.8.1_6
 libpari-gmp.so.7 pari-2.13.0_1
-libtree-sitter.so.0 tree-sitter-0.19.0_1
+libtree-sitter.so.0 tree-sitter-0.19.2_1
diff --git a/srcpkgs/tree-sitter/template b/srcpkgs/tree-sitter/template
index e3218d9b444..fc1d074a5aa 100644
--- a/srcpkgs/tree-sitter/template
+++ b/srcpkgs/tree-sitter/template
@@ -1,6 +1,6 @@
 # Template file for 'tree-sitter'
 pkgname=tree-sitter
-version=0.19.0
+version=0.19.2
 revision=1
 build_style=gnu-makefile
 short_desc="Parser generator tool and incremental parsing library"
@@ -8,7 +8,7 @@ maintainer="Érico Nogueira <ericonr@disroot.org>"
 license="MIT"
 homepage="https://tree-sitter.github.io"
 distfiles="https://github.com/tree-sitter/${pkgname}/archive/v${version}.tar.gz"
-checksum=7fa56a76b29b170ae11026a5c965e5a1177c158e251bec103d353ffff16a84e9
+checksum=c1b0eace3264799a5b55415bfb8a17ef064ea086205e5e842d47df2296812fe9
 
 post_install() {
 	vlicense LICENSE

From 717276b950c72f0852c7f667ed1d4ffaaf3a89e8 Mon Sep 17 00:00:00 2001
From: Gabriel Sanches <gabriel@gsr.dev>
Date: Sat, 6 Mar 2021 14:56:08 -0300
Subject: [PATCH 2/2] tree-sitter: package the CLI.

---
 srcpkgs/tree-sitter/template | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/srcpkgs/tree-sitter/template b/srcpkgs/tree-sitter/template
index fc1d074a5aa..273bf5e5217 100644
--- a/srcpkgs/tree-sitter/template
+++ b/srcpkgs/tree-sitter/template
@@ -2,7 +2,8 @@
 pkgname=tree-sitter
 version=0.19.2
 revision=1
-build_style=gnu-makefile
+build_style=cargo
+make_install_args="--path=cli"
 short_desc="Parser generator tool and incremental parsing library"
 maintainer="Érico Nogueira <ericonr@disroot.org>"
 license="MIT"
@@ -10,7 +11,19 @@ homepage="https://tree-sitter.github.io"
 distfiles="https://github.com/tree-sitter/${pkgname}/archive/v${version}.tar.gz"
 checksum=c1b0eace3264799a5b55415bfb8a17ef064ea086205e5e842d47df2296812fe9
 
+post_build() {
+	# Build libtree-sitter, since do_build builds the tree-sitter CLI.
+	make
+}
+
+do_check() {
+	: # tests require generating fixtures from remote repositories
+}
+
 post_install() {
+	# Install libtree-sitter, since do_install installs the tree-sitter CLI.
+	make STRIP=true PREFIX=/usr DESTDIR=${DESTDIR} install
+
 	vlicense LICENSE
 }
 
@@ -18,6 +31,7 @@ tree-sitter-devel_package() {
 	short_desc+=" - development files"
 	depends="${sourcepkg}>=${version}_${revision}"
 	pkg_install() {
+		vmove usr/bin
 		vmove usr/include
 		vmove "usr/lib/*.a"
 		vmove "usr/lib/*.so"

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (25 preceding siblings ...)
  2021-03-09  1:06 ` [PR PATCH] [Updated] " gbrlsnchs
@ 2021-03-09  8:51 ` FollieHiyuki
  2021-03-15 23:48 ` [PR PATCH] [Closed]: " ericonr
                   ` (5 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: FollieHiyuki @ 2021-03-09  8:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 233 bytes --]

New comment by FollieHiyuki on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-793568665

Comment:
You can have `make_check=extended` after checksum, instead of using an empty do_check()

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: [PR PATCH] [Closed]: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (26 preceding siblings ...)
  2021-03-09  8:51 ` FollieHiyuki
@ 2021-03-15 23:48 ` ericonr
  2021-03-15 23:48 ` ericonr
                   ` (4 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: ericonr @ 2021-03-15 23:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1432 bytes --]

There's a closed pull request on the void-packages repository

tree-sitter: build and install tree-sitter CLI.
https://github.com/void-linux/void-packages/pull/29272

Description:
<!-- Mark items with [x] where applicable -->

#### General
- [ ] This is a new package and it conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-requirements)

#### Have the results of the proposed changes been tested?
- [x] I use the packages affected by the proposed changes on a regular basis and confirm this PR works for me
- [ ] I generally don't use the affected packages but briefly tested this PR

<!--
If GitHub CI cannot be used to validate the build result (for example, if the
build is likely to take several hours), make sure to
[skip CI](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration).
When skipping CI, uncomment and fill out the following section.
Note: for builds that are likely to complete in less than 2 hours, it is not
acceptable to skip CI.
-->
<!-- 
#### Does it build and run successfully? 
(Please choose at least one native build and, if supported, at least one cross build. More are better.)
- [ ] I built this PR locally for my native architecture, (ARCH-LIBC)
- [ ] I built this PR locally for these architectures (if supported. mark crossbuilds):
  - [ ] aarch64-musl
  - [ ] armv7l
  - [ ] armv6l-musl
-->


^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (27 preceding siblings ...)
  2021-03-15 23:48 ` [PR PATCH] [Closed]: " ericonr
@ 2021-03-15 23:48 ` ericonr
  2021-03-15 23:55 ` gbrlsnchs
                   ` (3 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: ericonr @ 2021-03-15 23:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 249 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-799836704

Comment:
shlibs change wasn't necessary (there was no ABI change), I squashed the commits and update to .3. Thanks :D

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (28 preceding siblings ...)
  2021-03-15 23:48 ` ericonr
@ 2021-03-15 23:55 ` gbrlsnchs
  2021-03-16  0:10 ` ericonr
                   ` (2 subsequent siblings)
  32 siblings, 0 replies; 34+ messages in thread
From: gbrlsnchs @ 2021-03-15 23:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 430 bytes --]

New comment by gbrlsnchs on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-799839219

Comment:
> shlibs change wasn't necessary (there was no ABI change), I squashed the commits and update to .3. Thanks :D

Thanks @ericonr for tidying things up.

Out of curiosity, how do I detected ABI changes in this case? I'm still learning about C and want to make better PRs in the future.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (29 preceding siblings ...)
  2021-03-15 23:55 ` gbrlsnchs
@ 2021-03-16  0:10 ` ericonr
  2021-03-16  0:11 ` ericonr
  2021-03-16 13:40 ` gbrlsnchs
  32 siblings, 0 replies; 34+ messages in thread
From: ericonr @ 2021-03-16  0:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 495 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-799844783

Comment:
> Out of curiosity, how do I detected ABI changes in this case? I'm still learning about C and want to make better PRs in the future.

Basically if functions change or are removed from the header, as well as changes to the structs described in it (especially the interface one). They seem to be good about making a 0.x.0 release for ABI breaks as well.

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (30 preceding siblings ...)
  2021-03-16  0:10 ` ericonr
@ 2021-03-16  0:11 ` ericonr
  2021-03-16 13:40 ` gbrlsnchs
  32 siblings, 0 replies; 34+ messages in thread
From: ericonr @ 2021-03-16  0:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 189 bytes --]

New comment by ericonr on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-799844913

Comment:
The header is under src/include/tree_sitter IIRC

^ permalink raw reply	[flat|nested] 34+ messages in thread

* Re: tree-sitter: build and install tree-sitter CLI.
  2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
                   ` (31 preceding siblings ...)
  2021-03-16  0:11 ` ericonr
@ 2021-03-16 13:40 ` gbrlsnchs
  32 siblings, 0 replies; 34+ messages in thread
From: gbrlsnchs @ 2021-03-16 13:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 177 bytes --]

New comment by gbrlsnchs on void-packages repository

https://github.com/void-linux/void-packages/pull/29272#issuecomment-800267076

Comment:
I see. Thanks for the explanation!

^ permalink raw reply	[flat|nested] 34+ messages in thread

end of thread, other threads:[~2021-03-16 13:40 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-06 17:58 [PR PATCH] tree-sitter: build and install tree-sitter CLI gbrlsnchs
2021-03-07 21:33 ` ericonr
2021-03-07 21:38 ` ericonr
2021-03-08  0:06 ` gbrlsnchs
2021-03-08  0:34 ` ericonr
2021-03-08  0:45 ` gbrlsnchs
2021-03-08  2:27 ` ericonr
2021-03-08 14:26 ` gbrlsnchs
2021-03-08 14:27 ` gbrlsnchs
2021-03-08 14:27 ` gbrlsnchs
2021-03-08 15:13 ` ericonr
2021-03-08 17:50 ` gbrlsnchs
2021-03-08 18:27 ` ericonr
2021-03-08 18:27 ` ericonr
2021-03-08 18:49 ` gbrlsnchs
2021-03-08 18:55 ` FollieHiyuki
2021-03-08 19:03 ` ericonr
2021-03-08 20:50 ` [PR PATCH] [Updated] " gbrlsnchs
2021-03-08 20:51 ` gbrlsnchs
2021-03-08 20:53 ` gbrlsnchs
2021-03-08 20:56 ` gbrlsnchs
2021-03-08 22:52 ` ericonr
2021-03-09  0:31 ` gbrlsnchs
2021-03-09  0:39 ` ericonr
2021-03-09  0:39 ` ericonr
2021-03-09  1:02 ` gbrlsnchs
2021-03-09  1:06 ` [PR PATCH] [Updated] " gbrlsnchs
2021-03-09  8:51 ` FollieHiyuki
2021-03-15 23:48 ` [PR PATCH] [Closed]: " ericonr
2021-03-15 23:48 ` ericonr
2021-03-15 23:55 ` gbrlsnchs
2021-03-16  0:10 ` ericonr
2021-03-16  0:11 ` ericonr
2021-03-16 13:40 ` gbrlsnchs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).