[PATCH] gnu: Add tree-sitter.

  • Done
  • quality assurance status badge
Details
7 participants
  • Efraim Flashner
  • Ludovic Courtès
  • Luis Henrique Gomes Higino
  • li zongyuan
  • Nicolas Goaziou
  • Maxime Devos
  • Pierre Langlois
Owner
unassigned
Submitted by
Luis Henrique Gomes Higino
Severity
normal
L
L
Luis Henrique Gomes Higino wrote on 25 Jan 2022 15:33
(address . guix-patches@gnu.org)(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)
98a6180737981490316bca8c03c787289dbddcb6.1643120885.git.luishenriquegh2701@gmail.com
Hi guixers,

this series of patches adds the new required dependency for neovim,
tree-sitter, updates neovim to the newest upstream version and adds
the package variant neovim-luajit, which switches the lua
implementation used from Lua 5.1 to LuaJIT 2.1.0-beta3.

* gnu/packages/text-editors.scm (tree-sitter): New variable.
---
gnu/packages/text-editors.scm | 45 +++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)

Toggle diff (62 lines)
diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 2c5f5de719..9273a8f10b 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
;;; Copyright © 2021 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2021 Calum Irwin <calumirwin1@gmail.com>
+;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1165,3 +1166,47 @@ (define-public virtaal
provided by the Translate Toolkit, including XLIFF and PO.")
(home-page "https://virtaal.translatehouse.org/")
(license license:gpl2+)))
+
+(define-public tree-sitter
+ (package
+ (name "tree-sitter")
+ (version "0.20.4")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/tree-sitter/tree-sitter")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1yldgdbf3l5l4ki52abdf81nwkcbvg219gwr3ydcjwfsg7hf7zhz"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'fix-hardcoded-paths
+ (lambda _
+ (substitute* "Makefile"
+ (("/usr/local") (assoc-ref %outputs "out"))))))
+ #:tests? #f
+ #:make-flags
+ (list (string-append "prefix="
+ (assoc-ref %outputs "out"))
+ (string-append "CC="
+ ,(cc-for-target)))))
+ (home-page "https://tree-sitter.github.io/tree-sitter/")
+ (synopsis "Incremental parsing system for programming tools")
+ (description
+ "Tree-sitter is a parser generator tool and an incremental parsing
+library. It can build a concrete syntax tree for a source file and efficiently
+update the syntax tree as the source file is edited. Tree-sitter aims to be:
+
+@itemize
+@item General enough to parse any programming language
+@item Fast enough to parse on every keystroke in a text editor
+@item Robust enough to provide useful results even in the presence of syntax errors
+@item Dependency-free so that the runtime library (which is written in pure C)
+can be embedded in any application
+@end itemize
+")
+ (license license:expat)))
--
2.34.0
L
L
Luis Henrique Gomes Higino wrote on 25 Jan 2022 17:56
[PATCH 1/2] gnu: neovim: Update to 0.6.1.
(address . 53523@debbugs.gnu.org)(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)
cba6b5aa3594a97deb0089d4372a7888e39a3fd3.1643129740.git.luishenriquegh2701@gmail.com
* gnu/packages/vim.scm (neovim): Update to 0.6.1.
---
gnu/packages/vim.scm | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)

Toggle diff (42 lines)
diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index d5667851a8..7a43044caa 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -12,6 +12,7 @@
;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2021 Tissevert <tissevert+guix@marvid.fr>
;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
+;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -661,7 +662,7 @@ (define-public neovim-syntastic
(define-public neovim
(package
(name "neovim")
- (version "0.4.4")
+ (version "0.6.1")
(source
(origin
(method git-fetch)
@@ -670,7 +671,7 @@ (define-public neovim
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "11zyj6jvkwas3n6w1ckj3pk6jf81z1g7ngg4smmwm7c27y2a6f2m"))))
+ (base32 "10p6lg5yv9n6wcwdprwvvi56dfcm4wsj54nm0invyx3mhf7374lx"))))
(build-system cmake-build-system)
(arguments
`(#:modules ((srfi srfi-26)
@@ -721,7 +722,8 @@ (define-public neovim
("lua-luv" ,lua5.1-luv)
("lua-lpeg" ,lua5.1-lpeg)
("lua-bitop" ,lua5.1-bitop)
- ("lua-libmpack" ,lua5.1-libmpack)))
+ ("lua-libmpack" ,lua5.1-libmpack)
+ ("tree-sitter" ,tree-sitter)))
(native-inputs
`(("pkg-config" ,pkg-config)
("gettext" ,gettext-minimal)
--
2.34.0
L
L
Luis Henrique Gomes Higino wrote on 25 Jan 2022 17:56
[PATCH 2/2] gnu: Add neovim-luajit.
(address . 53523@debbugs.gnu.org)(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)
5d93b3a5c97096e5ae10adada97ea9800d057195.1643129740.git.luishenriquegh2701@gmail.com
* gnu/packages/vim.scm (neovim-luajit): New variable.
---
gnu/packages/vim.scm | 13 +++++++++++++
1 file changed, 13 insertions(+)

Toggle diff (26 lines)
diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index 7a43044caa..9d06089492 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -743,6 +743,19 @@ (define-public neovim
;; except for parts that were contributed under the Vim license.
(license (list license:asl2.0 license:vim))))
+(define-public neovim-luajit
+ (package
+ (inherit neovim)
+ (name "neovim-luajit")
+ (inputs (modify-inputs (package-inputs neovim)
+ (replace "lua" luajit)))
+ (arguments
+ (substitute-keyword-arguments (package-arguments neovim)
+ ((#:configure-flags cf) `(delete "-DPREFER_LUA:BOOL=YES"
+ ,cf))))
+ (synopsis
+ "Fork of vim focused on extensibility and agility - built with LuaJIT")))
+
(define-public eovim
(package
(name "eovim")
--
2.34.0
M
M
Maxime Devos wrote on 25 Jan 2022 18:39
f956e369f345a0bb4fd320d8975b3017647bc123.camel@telenet.be
Luis Henrique Gomes Higino schreef op di 25-01-2022 om 13:56 [-0300]:
Toggle quote (14 lines)
> * gnu/packages/vim.scm (neovim-luajit): New variable.
> +(define-public neovim-luajit
> + (package
> + (inherit neovim)
> + (name "neovim-luajit")
> + (inputs (modify-inputs (package-inputs neovim)
> + (replace "lua" luajit)))
> + (arguments
> + (substitute-keyword-arguments (package-arguments neovim)
> + ((#:configure-flags cf) `(delete "-DPREFER_LUA:BOOL=YES"
> + ,cf))))
> + (synopsis
> + "Fork of vim focused on extensibility and agility - built with LuaJIT")))

Does this need to be a separate package? I.e., can we use luajit
in the 'neovim' package on systems that support luajit, so not for
powerpc)?

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYfA1uRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7onkAQD4X8xxmOcuqqKG/4+sWQ57pAM/
z3dFC7IaYPafg1G5ogEAzRCTM/HpOmeJcoxFe6SUlFRrRHamH+qKJp0NSGb+Fws=
=zuf6
-----END PGP SIGNATURE-----


L
L
Luis Henrique Gomes Higino wrote on 26 Jan 2022 12:28
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 53523@debbugs.gnu.org)
87sftapvku.fsf@gmail.com
Maxime Devos <maximedevos@telenet.be> writes:

Toggle quote (30 lines)
> [[PGP Signed Part:Undecided]]
> Luis Henrique Gomes Higino schreef op di 25-01-2022 om 13:56
> [-0300]:
>> * gnu/packages/vim.scm (neovim-luajit): New variable.
>> +(define-public neovim-luajit
>> + (package
>> + (inherit neovim)
>> + (name "neovim-luajit")
>> + (inputs (modify-inputs (package-inputs neovim)
>> + (replace "lua" luajit)))
>> + (arguments
>> + (substitute-keyword-arguments (package-arguments neovim)
>> + ((#:configure-flags cf) `(delete
>> "-DPREFER_LUA:BOOL=YES"
>> + ,cf))))
>> + (synopsis
>> + "Fork of vim focused on extensibility and agility - built
>> with LuaJIT")))
>
> Does this need to be a separate package? I.e., can we use
> luajit
> in the 'neovim' package on systems that support luajit, so not
> for
> powerpc)?
>
> Greetings,
> Maxime.
>
> [[End of PGP Signed Part]]

I initially choose a package variant because it seemed the easiest
way to permit
both, but I think we can choose which implementation of Lua to use
based on
the target's architecture and it is possibly a better solution. My
only
problem with it is that I'm not sure this conforms to the
reproducible
building mindset. If choosing a dependency based on hardware is
OK for Guix, I'll configure `qemu-binfmt-service-type` and try to
implement this.

--
Regards,
Luis H. Higino
E
E
Efraim Flashner wrote on 26 Jan 2022 12:48
(name . Maxime Devos)(address . maximedevos@telenet.be)
YfE1Id57jXPC19XE@3900XT
On Tue, Jan 25, 2022 at 05:39:05PM +0000, Maxime Devos wrote:
Toggle quote (19 lines)
> Luis Henrique Gomes Higino schreef op di 25-01-2022 om 13:56 [-0300]:
> > * gnu/packages/vim.scm (neovim-luajit): New variable.
> > +(define-public neovim-luajit
> > + (package
> > + (inherit neovim)
> > + (name "neovim-luajit")
> > + (inputs (modify-inputs (package-inputs neovim)
> > + (replace "lua" luajit)))
> > + (arguments
> > + (substitute-keyword-arguments (package-arguments neovim)
> > + ((#:configure-flags cf) `(delete "-DPREFER_LUA:BOOL=YES"
> > + ,cf))))
> > + (synopsis
> > + "Fork of vim focused on extensibility and agility - built with LuaJIT")))
>
> Does this need to be a separate package? I.e., can we use luajit
> in the 'neovim' package on systems that support luajit, so not for
> powerpc)?

I believe in the past we've discussed using luajit as the default lua
for neovim. My guess is we should fall back to lua(-5.1?) on
(not (package-supported-system luajit))


--
Efraim Flashner <efraim@flashner.co.il> ????? ?????
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmHxNR0ACgkQQarn3Mo9
g1Hy0w//eqqk+jYmEk6Q0/R/HHycDS7LGnsLitk+D4D6as2uTn+CfYQcdX9mFQDq
p8HSWdprJOCNcbowlrEnA7upSsfZR1HDKYM7GEeK8emgOcAV8ov5elwdOnFuitjW
WrhcODa243bIurHCHyQ80/PZA2JnFRlZYu6RM5122R3lUzGFYFdvenXOi86j+hls
T9CQrsvg8cFaxqLe4HCLkGugSEGXPzX+pib3xeIlHSU+5lKGKRdx3G9ViI7EARit
ot75m0yVg5tq89pJlnfIg/HwEZoeboSPolGyjh1DtY8gwpkv5dk5FLXnNHEUABov
Pg0Lahcw2/XL0NWkWnbvP2BHKD+7wlVXKdlLBi3pKsuJi7bJotn+swmeGHeG3ojy
hetIcJByKT9MDYt9GenoFShTdiGL12KYlNteKRTe8NzummxHre7vNiTLzCSaa2C5
S/ArqHc+pq1rxb0Le5D+gdOKA1FicsPa7UEPEREAHtIpe2E3uiGaDaf/DCSZOeiN
G7SMuKdPwXz2VVzMocK4pQKvjInSuAVFWr78a4fGOnZZV6PFXjorQ+Jl+fIQ1lWq
YoKWh/YjJeXIcmUHeWm8JXvz3doC+novjNwZ9odajRtoGS+wqtfJZGpIyLwFBMDv
xHbHF2nZYEIeIl8vw7GLHVIvNxroT+EoYyJHm2NYYXbC3eSg9HE=
=kvdk
-----END PGP SIGNATURE-----


L
L
Luis Henrique Gomes Higino wrote on 26 Jan 2022 13:07
(name . Efraim Flashner)(address . efraim@flashner.co.il)
87o83ypucv.fsf@gmail.com
Efraim Flashner <efraim@flashner.co.il> writes:

Toggle quote (20 lines)
> [[PGP Signed Part:Undecided]]
> On Tue, Jan 25, 2022 at 05:39:05PM +0000, Maxime Devos wrote:
>> Luis Henrique Gomes Higino schreef op di 25-01-2022 om 13:56
>> [-0300]:
>> > * gnu/packages/vim.scm (neovim-luajit): New variable.
>> > +(define-public neovim-luajit
>> > + (package
>> > + (inherit neovim)
>> > + (name "neovim-luajit")
>> > + (inputs (modify-inputs (package-inputs neovim)
>> > + (replace "lua" luajit)))
>> > + (arguments
>> > + (substitute-keyword-arguments (package-arguments
>> > neovim)
>> > + ((#:configure-flags cf) `(delete
>> > "-DPREFER_LUA:BOOL=YES"
>> > + ,cf))))
>> > + (synopsis
>> > + "Fork of vim focused on extensibility and agility - built
>> > with
LuaJIT")))
Toggle quote (12 lines)
>>
>> Does this need to be a separate package? I.e., can we use
>> luajit
>> in the 'neovim' package on systems that support luajit, so not
>> for
>> powerpc)?
>
> I believe in the past we've discussed using luajit as the
> default lua
> for neovim. My guess is we should fall back to lua(-5.1?) on
> (not (package-supported-system luajit))

Yes, I believe this is the best solution if it is acceptable by
Guix standards.

--
Regards,
Luis H. Higino
E
E
Efraim Flashner wrote on 26 Jan 2022 15:22
(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)
YfFZEtd3rJQ4ICy+@3900XT
On Wed, Jan 26, 2022 at 09:07:04AM -0300, Luis Henrique Gomes Higino wrote:
Toggle quote (33 lines)
>
> Efraim Flashner <efraim@flashner.co.il> writes:
>
> > [[PGP Signed Part:Undecided]]
> > On Tue, Jan 25, 2022 at 05:39:05PM +0000, Maxime Devos wrote:
> > > Luis Henrique Gomes Higino schreef op di 25-01-2022 om 13:56
> > > [-0300]:
> > > > * gnu/packages/vim.scm (neovim-luajit): New variable.
> > > > +(define-public neovim-luajit
> > > > + (package
> > > > + (inherit neovim)
> > > > + (name "neovim-luajit")
> > > > + (inputs (modify-inputs (package-inputs neovim)
> > > > + (replace "lua" luajit)))
> > > > + (arguments
> > > > + (substitute-keyword-arguments (package-arguments > neovim)
> > > > + ((#:configure-flags cf) `(delete > "-DPREFER_LUA:BOOL=YES"
> > > > + ,cf))))
> > > > + (synopsis
> > > > + "Fork of vim focused on extensibility and agility - built > with
> LuaJIT")))
> > >
> > > Does this need to be a separate package? I.e., can we use luajit
> > > in the 'neovim' package on systems that support luajit, so not for
> > > powerpc)?
> >
> > I believe in the past we've discussed using luajit as the default lua
> > for neovim. My guess is we should fall back to lua(-5.1?) on
> > (not (package-supported-system luajit))
>
> Yes, I believe this is the best solution if it is acceptable by Guix
> standards.

IMO it's basically the same as only adding pandoc for systems with
Haskell support. I think we have a couple of other examples I can't
think of right now.

--
Efraim Flashner <efraim@flashner.co.il> ????? ?????
GPG key = A28B F40C 3E55 1372 662D 14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEoov0DD5VE3JmLRT3Qarn3Mo9g1EFAmHxWRIACgkQQarn3Mo9
g1G9iRAAwHyGITuFmaqI/ZJL0wqr3tevXumehlhE6iLFMne9HB6EwttoqZsa7ON9
jM58Wsre2Oqdv8ekLfdACeEvkHCKCXqKK3DXjdS8l/YRKZEY/FFKRruRflXKRJlE
0LrkZb7cMAM+v+uO9EENtEDjSdZCpoO3WrOCbiu9m0/cAuUDb8cml0rwwEWOowdA
YGP6oW9FCOBF51iLQElWVY2dUl4tgXFsE5cBpbqpYhXdybaVtLWG83VVn0KtT35z
jRmJaVGcU3/7Q9LhMkJRqgT3anJDOEbo/ocYDjqWzx3wJQGg/NWhj8NSGT2uK/QJ
9TVXmssHucuKIF1pt6SiArhsh9pbJSCJ7SIuvBoOh/K5eI3MvXZzuozcX836E8MI
EvX6G/PlNhg4kr3peMuVkUHMij9tXMtGi/MenecFVpkLBoqEQR6dER6Zvy4bzK83
OsSKs4NRyP9w1nzuE8mQNkint2FEjo2LZdFa+otszheszBzse78o4oVtUUn3jmaH
baqbt+FBUpRVLEy2Dj7SKAKWrFjJPsdFETt5ebdOactPiXUMyyBOWoRslMQi12w7
hm9WvkWb0jC2u8DerLG+uwZBLU5V/UNMXTMJbU+xePWZ9VWo0jFCcm0bOGzCtsKa
pMZ+NrRlU32jhAKCEM9Cu5nqqwkV6u7gmsKQVcWMRJcYoSENK5c=
=pKZ9
-----END PGP SIGNATURE-----


N
N
Nicolas Goaziou wrote on 28 Jan 2022 11:00
Re: [bug#53523] [PATCH] gnu: Add tree-sitter.
(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)(address . 53523@debbugs.gnu.org)
87v8y4tc26.fsf@nicolasgoaziou.fr
Hello,

Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com> writes:

Toggle quote (7 lines)
> this series of patches adds the new required dependency for neovim,
> tree-sitter, updates neovim to the newest upstream version and adds
> the package variant neovim-luajit, which switches the lua
> implementation used from Lua 5.1 to LuaJIT 2.1.0-beta3.
>
> * gnu/packages/text-editors.scm (tree-sitter): New variable.

Thank you.

Note there is already a pending patch set to add tree-sitter in Guix:
https://issues.guix.gnu.org/issue/49946/. You may want to look at it
and see if both works can be merged somehow.

Regards,
--
Nicolas Goaziou
L
L
Luis Henrique Gomes Higino wrote on 28 Jan 2022 13:39
(no subject)
(address . 53523@debbugs.gnu.org)
871r0sm33r.fsf@gmail.com
I'll try implementing what Efraim Flashner suggested. Then, I'll
see if I can merge my first patch, the one that adds tree-sitter, with the one mentioned by
Nicolas Goaziou. If anyone can point me to a resource on how this
could be done in regards to the technicalities, feel free to share
it! Thanks for the feedback!

Regards,
--
Luis H. Higino
L
L
Luis Henrique Gomes Higino wrote on 1 Feb 2022 14:04
[PATCH v2 1/2] gnu: Add tree-sitter.
(address . 53523@debbugs.gnu.org)(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)
ea588a8f8429862ade9647a3b96fbebd25f32a1b.1643720048.git.luishenriquegh2701@gmail.com
Hi guixers,

this adds tree-sitter, just as the previous patch series, but now
there is no neovim-luajit and neovim uses LuaJIT on supported
platforms.

--
Regards,
Luis H. Higino

* gnu/packages/text-editors.scm (tree-sitter): New variable.
---
gnu/packages/text-editors.scm | 45 +++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)

Toggle diff (62 lines)
diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 2c5f5de719..9273a8f10b 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
;;; Copyright © 2021 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2021 Calum Irwin <calumirwin1@gmail.com>
+;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -1165,3 +1166,47 @@ (define-public virtaal
provided by the Translate Toolkit, including XLIFF and PO.")
(home-page "https://virtaal.translatehouse.org/")
(license license:gpl2+)))
+
+(define-public tree-sitter
+ (package
+ (name "tree-sitter")
+ (version "0.20.4")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/tree-sitter/tree-sitter")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1yldgdbf3l5l4ki52abdf81nwkcbvg219gwr3ydcjwfsg7hf7zhz"))))
+ (build-system gnu-build-system)
+ (arguments
+ `(#:phases (modify-phases %standard-phases
+ (delete 'configure)
+ (add-after 'unpack 'fix-hardcoded-paths
+ (lambda _
+ (substitute* "Makefile"
+ (("/usr/local") (assoc-ref %outputs "out"))))))
+ #:tests? #f
+ #:make-flags
+ (list (string-append "prefix="
+ (assoc-ref %outputs "out"))
+ (string-append "CC="
+ ,(cc-for-target)))))
+ (home-page "https://tree-sitter.github.io/tree-sitter/")
+ (synopsis "Incremental parsing system for programming tools")
+ (description
+ "Tree-sitter is a parser generator tool and an incremental parsing
+library. It can build a concrete syntax tree for a source file and efficiently
+update the syntax tree as the source file is edited. Tree-sitter aims to be:
+
+@itemize
+@item General enough to parse any programming language
+@item Fast enough to parse on every keystroke in a text editor
+@item Robust enough to provide useful results even in the presence of syntax errors
+@item Dependency-free so that the runtime library (which is written in pure C)
+can be embedded in any application
+@end itemize
+")
+ (license license:expat)))
--
2.34.0
L
L
Luis Henrique Gomes Higino wrote on 1 Feb 2022 14:04
[PATCH v2 2/2] gnu: neovim: Update to 0.6.1.
(address . 53523@debbugs.gnu.org)(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)
92a9d1557cbf6d0a4aba1b80dbc69f289aa71850.1643720048.git.luishenriquegh2701@gmail.com
* gnu/packages/vim.scm (neovim): Update to 0.6.1.

Build neovim with LuaJIT in the supported platforms.
---
gnu/packages/vim.scm | 21 ++++++++++++++++-----
1 file changed, 16 insertions(+), 5 deletions(-)

Toggle diff (63 lines)
diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index d5667851a8..942df27107 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -12,6 +12,7 @@
;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2021 Tissevert <tissevert+guix@marvid.fr>
;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
+;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -661,7 +662,7 @@ (define-public neovim-syntastic
(define-public neovim
(package
(name "neovim")
- (version "0.4.4")
+ (version "0.6.1")
(source
(origin
(method git-fetch)
@@ -670,13 +671,18 @@ (define-public neovim
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "11zyj6jvkwas3n6w1ckj3pk6jf81z1g7ngg4smmwm7c27y2a6f2m"))))
+ (base32 "10p6lg5yv9n6wcwdprwvvi56dfcm4wsj54nm0invyx3mhf7374lx"))))
(build-system cmake-build-system)
(arguments
`(#:modules ((srfi srfi-26)
(guix build cmake-build-system)
(guix build utils))
- #:configure-flags '("-DPREFER_LUA:BOOL=YES")
+ #:configure-flags
+ (list ,@(if (member (or (%current-target-system)
+ (%current-system))
+ (package-supported-systems luajit))
+ '()
+ '("-DPREFER_LUA:BOOL=YES")))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'set-lua-paths
@@ -717,11 +723,16 @@ (define-public neovim
("unibilium" ,unibilium)
("jemalloc" ,jemalloc)
("libiconv" ,libiconv)
- ("lua" ,lua-5.1)
+ ("lua" ,(if (member (or (%current-target-system)
+ (%current-system))
+ (package-supported-systems luajit))
+ luajit
+ lua-5.1))
("lua-luv" ,lua5.1-luv)
("lua-lpeg" ,lua5.1-lpeg)
("lua-bitop" ,lua5.1-bitop)
- ("lua-libmpack" ,lua5.1-libmpack)))
+ ("lua-libmpack" ,lua5.1-libmpack)
+ ("tree-sitter" ,tree-sitter)))
(native-inputs
`(("pkg-config" ,pkg-config)
("gettext" ,gettext-minimal)
--
2.34.0
M
M
Maxime Devos wrote on 5 Feb 2022 12:02
285051946cd07294bdebc439fb69dd535d6ab112.camel@telenet.be
Luis Henrique Gomes Higino schreef op di 01-02-2022 om 10:04 [-0300]:
Toggle quote (5 lines)
> +       #:configure-flags
> +       (list ,@(if (member (or (%current-target-system)
> +                               (%current-system))
> +                           (package-supported-systems luajit))

This does not work, (%current-target-system) is a GNU triplet
whereas (%current-system) is a nix system, see


Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYf5ZSxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7pr/AP9sFvTZldv2++pcCw0rEfoYlSy1
H+9fkRVc2DgvV2CNuwEAzE29aqDvy5FPKX623DRpmIHkC2VxVohlg4nkpGtMjgM=
=bN3K
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 5 Feb 2022 12:09
Re: [bug#53523] [PATCH v2 1/2] gnu: Add tree-sitter.
f78cf84241b5fda8c012b00f89e52ff761f58703.camel@telenet.be
Luis Henrique Gomes Higino schreef op di 01-02-2022 om 10:04 [-0300]:
Toggle quote (5 lines)
> +                  (add-after 'unpack 'fix-hardcoded-paths
> +                    (lambda _
> +                      (substitute* "Makefile"
> +                        (("/usr/local") (assoc-ref %outputs "out"))))))

%outputs and friends are being phased out, use G-exps instead:

(list #:phases
#~(modify-phases ...
(add-after 'unpack ...
(lambda _
(substitute* "Makefile"
(("/usr/local") #$output))))
[...])
[...])

Toggle quote (2 lines)
> +       #:tests? #f

Why are they disabled?

Toggle quote (4 lines)
> +       #:make-flags
> +       (list (string-append "prefix="
> +                            (assoc-ref %outputs "out"))

Likewise (G-exps).

Toggle quote (3 lines)
> +             (string-append "CC="
> +                            ,(cc-for-target)))))

If G-exps are used, ',' needs to be replaced by #$.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYf5a1xccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7nxsAQCNNWzwcMHAh8ZLRniI74MiaEa7
kouVnKUJHWJSVqK5oAD8CPpZ8krCIOLeP1kyUDs0U+38hH5WvrgljUsGei+GBgI=
=38dJ
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 5 Feb 2022 12:11
16431dfaec2780d93a543375db852501ac414078.camel@telenet.be
Luis Henrique Gomes Higino schreef op di 01-02-2022 om 10:04 [-0300]:
Toggle quote (3 lines)
> +                      (substitute* "Makefile"
> +                        (("/usr/local") (assoc-ref %outputs "out"))))))

Is this necessary? The Makefile does 'PREFIX ?= /usr/local', so it
would seem to me that overriding PREFIX by setting #:make-flags
appropriately should be sufficient.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYf5bSRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7ktkAP9sZd+Ttqbjh8qx5X+AUvPBXk7v
8Yq/tt8a6eRSt44xVwD/c2sVwELlau6enw9Q6yGa/3AdFP1HsxV9OcWeNviM5gc=
=qLL6
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 5 Feb 2022 12:12
d0928a6d99590c70d2fc7b8fcb7af0219d66d0c2.camel@telenet.be
Luis Henrique Gomes Higino schreef op di 01-02-2022 om 10:04 [-0300]:
Toggle quote (4 lines)
> +              (uri (git-reference
> +                    (url "https://github.com/tree-sitter/tree-sitter")
> +                    (commit (string-append "v" version))))

tree-sitter is bundling some parts of ICU
can they be unbundled?

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iIwEABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYf5bkRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7vkbAPdoGbk0i/Pp7smKfiw5WxHeWcGv
RmhWYJ+maIrTvYyxAP0dEb+xl+MkHAMqCoQDGUs37ddgxq5ivEIVSmEIMJwiDA==
=Fih6
-----END PGP SIGNATURE-----


M
M
Maxime Devos wrote on 5 Feb 2022 12:14
4773f85f77e945738fb708831173af60d32ef733.camel@telenet.be
Luis Henrique Gomes Higino schreef op di 01-02-2022 om 10:04 [-0300]:
Toggle quote (3 lines)
> +       (list (string-append "prefix="
> +                            (assoc-ref %outputs "out"))

The Makefile has a 'PREFIX' variable, not a 'prefix' variable,
so this doesn't seem to have any effect?

Greetings,
Maxime
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYf5cHBccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7jAoAQD0d5j45kWfVoXo33UtdzU/vuDk
/QFsZG9IFxqk74mf6AD9E3W/a+z5Xni5y1qxs5FItVotMI7I56IUxdMLEUedfQE=
=UuXt
-----END PGP SIGNATURE-----


L
L
Luis Henrique Gomes Higino wrote on 5 Feb 2022 19:17
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 53523@debbugs.gnu.org)
87wni9tbq3.fsf@gmail.com
Maxime Devos <maximedevos@telenet.be> writes:

Toggle quote (8 lines)
> Luis Henrique Gomes Higino schreef op di 01-02-2022 om 10:04
> [-0300]:
>
>> +       #:tests? #f
>
> Why are they disabled?
>

tree-sitter's test suite depends on downloading additional
grammars, so I found it easier to just disable testing. If you
think tests should be added as an additional origin field, I can
try doing it.

--
Luis H. Higino
L
L
Luis Henrique Gomes Higino wrote on 5 Feb 2022 19:23
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 53523@debbugs.gnu.org)
87pmo1tb8m.fsf@gmail.com
Maxime Devos <maximedevos@telenet.be> writes:

Toggle quote (12 lines)
> Luis Henrique Gomes Higino schreef op di 01-02-2022 om 10:04
> [-0300]:
>> +                      (substitute* "Makefile"
>> +                        (("/usr/local") (assoc-ref %outputs
>> "out"))))))
>
> Is this necessary? The Makefile does 'PREFIX ?= /usr/local', so
> it
> would seem to me that overriding PREFIX by setting #:make-flags
> appropriately should be sufficient.
>

You're right, I was using "prefix" on #:make-flags when it should
be "PREFIX", thanks for pointing it out!

--
Luis H. Higino
M
M
Maxime Devos wrote on 5 Feb 2022 19:38
(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)(address . 53523@debbugs.gnu.org)
4fd8ad96e0aca16b02981694ee27269cf11fb486.camel@telenet.be
Luis Henrique Gomes Higino schreef op za 05-02-2022 om 15:17 [-0300]:
Toggle quote (15 lines)
> Maxime Devos <maximedevos@telenet.be> writes:
>
> > Luis Henrique Gomes Higino schreef op di 01-02-2022 om 10:04
> > [-0300]:
> >
> > > +       #:tests? #f
> >
> > Why are they disabled?
> >
>
> tree-sitter's test suite depends on downloading additional
> grammars, so I found it easier to just disable testing. If you
> think tests should be added as an additional origin field, I can
> try doing it.

If you figure out how to eliminate the downloads, great.
If it's too complicated, #:tests? #f could be acceptable, though it
deserves a comment in the source code.

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYf7EHRccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7kVVAP0ZLZkqq0T2fFGL25GeX+OnS+Ad
XBadtr8BftZrrIqmLgD/Tasq2alZeEHSGRgGwHYZH4f1NcuDI1H8SPf1p/uuNQc=
=D2o4
-----END PGP SIGNATURE-----


L
L
Luis Henrique Gomes Higino wrote on 5 Feb 2022 20:36
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 53523@debbugs.gnu.org)
87leypt82j.fsf@gmail.com
Maxime Devos <maximedevos@telenet.be> writes:

Toggle quote (9 lines)
> [[PGP Signed Part:Undecided]]
> Luis Henrique Gomes Higino schreef op di 01-02-2022 om 10:04
> [-0300]:
>
> tree-sitter is bundling some parts of ICU
> (https://github.com/tree-sitter/tree-sitter/tree/master/lib/src/unicode),
> can they be unbundled?
>

I managed to remove the "src/unicode" directory with an origin
snippet and, after some patching through `substitute*`, I have a
working build again. I'll be sending the new patch series
soon. Thanks for your expressive feedback Maxime, learned a lot
about Guix today :D.

--
Luis H. Higino
L
L
Luis Henrique Gomes Higino wrote on 5 Feb 2022 20:41
About luajit supported platforms
(address . 53523@debbugs.gnu.org)
87h79dt7vn.fsf@gmail.com
I was doing some tests today with the Guile REPL and it seems like
luajit has been ported to more platforms recently. From my
impression, it seems like now there's no need to fallback to Lua
5.1 on any system. Running `(eq? (package-supported-systems
luajit) (package-supported-systems lua))` returns `#t`. Can anyone
confirm this?

--
Luis H. Higino
L
L
L
li zongyuan wrote on 14 Mar 2022 03:30
[PATCH]%20gnu:%20Add%20tree-sitter.
(address . 53523@debbugs.gnu.org)
CAG_6QKrKzpgJ3x5-OSpfQ=MEC4TDcFkFOEZGmPykwx8-iCo1aQ@mail.gmail.com
Any further working on this patch, or if any help is still needed? I'm very
excited to have neovim 0.6.1 in guix!

I did some research on source code of lua package. From


we can find that luajit deleted "powerpc64le-linux" from the supported
system list, which lua package didn't. So I think we should keep that
fallback.
Attachment: file
L
L
Luis Henrique Gomes Higino wrote on 14 Mar 2022 18:03
Re: [bug#53523] About luajit supported platforms
(name . li zongyuan)(address . lyzongyuan@gmail.com)(address . guix-patches@gnu.org)
87sfrkzcn5.fsf@gmail.com
li zongyuan <lyzongyuan@gmail.com> writes:

Toggle quote (4 lines)
> we can find that luajit deleted "powerpc64le-linux" from the
> supported system list, which lua package didn't. So I think we
> should keep that fallback.

Thanks for bringing attention to this! I'll keep it then.

Regards,

--
Luis H. Higino
L
L
Luis Henrique Gomes Higino wrote on 15 Mar 2022 00:31
[PATCH v3 1/2] gnu: Add tree-sitter.
(address . 53523@debbugs.gnu.org)(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)
78ed09339d88b859d34798faff950ea7a2d4d6c9.1647300645.git.luishenriquegh2701@gmail.com
* gnu/packages/text-editors.scm (tree-sitter): New variable.
---
gnu/packages/text-editors.scm | 54 +++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)

Toggle diff (85 lines)
diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 2c5f5de719..d333d78e22 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
;;; Copyright © 2021 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2021 Calum Irwin <calumirwin1@gmail.com>
+;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -39,6 +40,7 @@ (define-module (gnu packages text-editors)
#:use-module (guix gexp)
#:use-module (guix git-download)
#:use-module (guix utils)
+ #:use-module (guix build utils)
#:use-module (guix build-system cargo)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
@@ -61,6 +63,7 @@ (define-module (gnu packages text-editors)
#:use-module (gnu packages gtk)
#:use-module (gnu packages guile)
#:use-module (gnu packages haskell-xyz)
+ #:use-module (gnu packages icu4c)
#:use-module (gnu packages image)
#:use-module (gnu packages libbsd)
#:use-module (gnu packages libreoffice)
@@ -1165,3 +1168,54 @@ (define-public virtaal
provided by the Translate Toolkit, including XLIFF and PO.")
(home-page "https://virtaal.translatehouse.org/")
(license license:gpl2+)))
+
+(define-public tree-sitter
+ (package
+ (name "tree-sitter")
+ (version "0.20.6")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/tree-sitter/tree-sitter")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1z20518snyg0zp75qgs5bxmzjqws4dd19vnp6sya494za3qp5b6d"))
+ (modules '((guix build utils)))
+ (snippet '(begin
+ ;; Remove bundled ICU parts
+ (delete-file-recursively "lib/src/unicode")
+ #t))))
+ (build-system gnu-build-system)
+ (inputs (list icu4c))
+ (arguments
+ (list #:phases
+ '(modify-phases %standard-phases
+ (delete 'configure))
+ #:tests? #f
+ #:make-flags
+ #~(list (string-append "PREFIX="
+ #$output)
+ (string-append "CC="
+ #$(cc-for-target)))))
+ (home-page "https://tree-sitter.github.io/tree-sitter/")
+ (synopsis "Incremental parsing system for programming tools")
+ (description
+ "Tree-sitter is a parser generator tool and an incremental parsing
+library. It can build a concrete syntax tree for a source file and efficiently
+update the syntax tree as the source file is edited.
+
+Tree-sitter aims to be:
+
+@itemize
+@item General enough to parse any programming language
+@item Fast enough to parse on every keystroke in a text editor
+@item Robust enough to provide useful results even in the presence of syntax errors
+@item Dependency-free so that the runtime library (which is written in pure C)
+can be embedded in any application
+@end itemize
+
+This package includes the @code{libtree-sitter} runtime library.
+")
+ (license license:expat)))
--
2.34.0
L
L
Luis Henrique Gomes Higino wrote on 15 Mar 2022 00:31
[PATCH v3 2/2] gnu: neovim: Update to 0.6.1.
(address . 53523@debbugs.gnu.org)(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)
552d90160ec90419add7cccefdd44d2c67b579c1.1647300645.git.luishenriquegh2701@gmail.com
* gnu/packages/vim.scm (neovim): Update to 0.6.1.

Build neovim with LuaJIT in the supported platforms.
---
gnu/packages/vim.scm | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)

Toggle diff (67 lines)
diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index d5667851a8..10fb20a5e7 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -12,6 +12,7 @@
;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2021 Tissevert <tissevert+guix@marvid.fr>
;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
+;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -661,7 +662,7 @@ (define-public neovim-syntastic
(define-public neovim
(package
(name "neovim")
- (version "0.4.4")
+ (version "0.6.1")
(source
(origin
(method git-fetch)
@@ -670,13 +671,20 @@ (define-public neovim
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "11zyj6jvkwas3n6w1ckj3pk6jf81z1g7ngg4smmwm7c27y2a6f2m"))))
+ (base32 "10p6lg5yv9n6wcwdprwvvi56dfcm4wsj54nm0invyx3mhf7374lx"))))
(build-system cmake-build-system)
(arguments
`(#:modules ((srfi srfi-26)
(guix build cmake-build-system)
(guix build utils))
- #:configure-flags '("-DPREFER_LUA:BOOL=YES")
+ #:configure-flags
+ (list ,@(if (member (or (if (%current-target-system)
+ (gnu-triplet->nix-system (%current-target-system))
+ #f)
+ (%current-system))
+ (package-supported-systems luajit))
+ '()
+ '("-DPREFER_LUA:BOOL=YES")))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'set-lua-paths
@@ -717,11 +725,18 @@ (define-public neovim
("unibilium" ,unibilium)
("jemalloc" ,jemalloc)
("libiconv" ,libiconv)
- ("lua" ,lua-5.1)
+ ("lua" ,(if (member (or (if (%current-target-system)
+ (gnu-triplet->nix-system (%current-target-system))
+ #f)
+ (%current-system))
+ (package-supported-systems luajit))
+ luajit
+ lua-5.1))
("lua-luv" ,lua5.1-luv)
("lua-lpeg" ,lua5.1-lpeg)
("lua-bitop" ,lua5.1-bitop)
- ("lua-libmpack" ,lua5.1-libmpack)))
+ ("lua-libmpack" ,lua5.1-libmpack)
+ ("tree-sitter" ,tree-sitter)))
(native-inputs
`(("pkg-config" ,pkg-config)
("gettext" ,gettext-minimal)
--
2.34.0
P
P
Pierre Langlois wrote on 15 Mar 2022 00:43
Re: [bug#53523] [PATCH v3 1/2] gnu: Add tree-sitter.
(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)
87lexcjdoz.fsf@gmx.com
Hi Luis,

Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com> writes:

Toggle quote (2 lines)
> * gnu/packages/text-editors.scm (tree-sitter): New variable.

I'm not a maintainer, but the patch looks good to me with just a minor
comment!

As mentioned before, I'll rebase on top of this after its merged, I
still have a bit more work to do on the emacs support for tree-sitter.

Toggle quote (63 lines)
> ---
> gnu/packages/text-editors.scm | 54 +++++++++++++++++++++++++++++++++++
> 1 file changed, 54 insertions(+)
>
> diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
> index 2c5f5de719..d333d78e22 100644
> --- a/gnu/packages/text-editors.scm
> +++ b/gnu/packages/text-editors.scm
> @@ -17,6 +17,7 @@
> ;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
> ;;; Copyright © 2021 Pierre Langlois <pierre.langlois@gmx.com>
> ;;; Copyright © 2021 Calum Irwin <calumirwin1@gmail.com>
> +;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> @@ -39,6 +40,7 @@ (define-module (gnu packages text-editors)
> #:use-module (guix gexp)
> #:use-module (guix git-download)
> #:use-module (guix utils)
> + #:use-module (guix build utils)
> #:use-module (guix build-system cargo)
> #:use-module (guix build-system cmake)
> #:use-module (guix build-system gnu)
> @@ -61,6 +63,7 @@ (define-module (gnu packages text-editors)
> #:use-module (gnu packages gtk)
> #:use-module (gnu packages guile)
> #:use-module (gnu packages haskell-xyz)
> + #:use-module (gnu packages icu4c)
> #:use-module (gnu packages image)
> #:use-module (gnu packages libbsd)
> #:use-module (gnu packages libreoffice)
> @@ -1165,3 +1168,54 @@ (define-public virtaal
> provided by the Translate Toolkit, including XLIFF and PO.")
> (home-page "https://virtaal.translatehouse.org/")
> (license license:gpl2+)))
> +
> +(define-public tree-sitter
> + (package
> + (name "tree-sitter")
> + (version "0.20.6")
> + (source (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/tree-sitter/tree-sitter")
> + (commit (string-append "v" version))))
> + (file-name (git-file-name name version))
> + (sha256
> + (base32
> + "1z20518snyg0zp75qgs5bxmzjqws4dd19vnp6sya494za3qp5b6d"))
> + (modules '((guix build utils)))
> + (snippet '(begin
> + ;; Remove bundled ICU parts
> + (delete-file-recursively "lib/src/unicode")
> + #t))))
> + (build-system gnu-build-system)
> + (inputs (list icu4c))
> + (arguments
> + (list #:phases
> + '(modify-phases %standard-phases
> + (delete 'configure))
> + #:tests? #f

It might be nice to add a short comment to say that there are no tests
for the runtime library itself. A "; no check target." comment might
suffice, we do that often.

Toggle quote (26 lines)
> + #:make-flags
> + #~(list (string-append "PREFIX="
> + #$output)
> + (string-append "CC="
> + #$(cc-for-target)))))
> + (home-page "https://tree-sitter.github.io/tree-sitter/")
> + (synopsis "Incremental parsing system for programming tools")
> + (description
> + "Tree-sitter is a parser generator tool and an incremental parsing
> +library. It can build a concrete syntax tree for a source file and efficiently
> +update the syntax tree as the source file is edited.
> +
> +Tree-sitter aims to be:
> +
> +@itemize
> +@item General enough to parse any programming language
> +@item Fast enough to parse on every keystroke in a text editor
> +@item Robust enough to provide useful results even in the presence of syntax errors
> +@item Dependency-free so that the runtime library (which is written in pure C)
> +can be embedded in any application
> +@end itemize
> +
> +This package includes the @code{libtree-sitter} runtime library.
> +")
> + (license license:expat)))

Thanks,
Pierre
Z
Z
Zongyuan Li wrote on 16 Mar 2022 04:07
Re: [PATCH v3 2/2] gnu: neovim: Update to 0.6.1.
(address . 53523@debbugs.gnu.org)(address . luishenriquegh2701@gmail.com)
f4828cde-970d-3459-4e2f-ad242274a44b@gmail.com
Hi Luis,

I tried to apply `[PATCH v3 2/2] gnu: neovim: Update to 0.6.1.` to the
current main branch of Guix, but failed.

It seems like we import 'libiconv' which is not used as dependency in
previous neovim, from these code:

> @@ -717,11 +725,18 @@ (define-public neovim
>         ("unibilium" ,unibilium)
>         ("jemalloc" ,jemalloc)
>         ("libiconv" ,libiconv)
> -       ("lua" ,lua-5.1)
> +      ("lua" ,(if (member (or (if (%current-target-system)
> +                                   (gnu-triplet->nix-system
(%current-target-system))
> +                                   #f)
> +                               (%current-system))
> +                           (package-supported-systems luajit))
> +                   luajit
> +                   lua-5.1))
>         ("lua-luv" ,lua5.1-luv)
>         ("lua-lpeg" ,lua5.1-lpeg)
>         ("lua-bitop" ,lua5.1-bitop)
> -       ("lua-libmpack" ,lua5.1-libmpack)))
> +      ("lua-libmpack" ,lua5.1-libmpack)
> +      ("tree-sitter" ,tree-sitter)))

Did you write this patch on any commit which is not included in the Guix
main branch?

Maybe we should rebase this patch set on main branch.

Li
L
L
Luis Henrique Gomes Higino wrote on 17 Mar 2022 14:44
[PATCH v4 1/2] gnu: Add tree-sitter.
(address . 53523@debbugs.gnu.org)(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)
1e4edd37cfd4e6724ef6b65547da01efdf023d71.1647524617.git.luishenriquegh2701@gmail.com
* gnu/packages/text-editors.scm (tree-sitter): New variable.
---
gnu/packages/text-editors.scm | 54 +++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)

Toggle diff (87 lines)
diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 45cc61765a..d6ec000dc6 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
;;; Copyright © 2021 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2021 Calum Irwin <calumirwin1@gmail.com>
+;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -39,6 +40,7 @@ (define-module (gnu packages text-editors)
#:use-module (guix gexp)
#:use-module (guix git-download)
#:use-module (guix utils)
+ #:use-module (guix build utils)
#:use-module (guix build-system cargo)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
@@ -62,6 +64,7 @@ (define-module (gnu packages text-editors)
#:use-module (gnu packages gtk)
#:use-module (gnu packages guile)
#:use-module (gnu packages haskell-xyz)
+ #:use-module (gnu packages icu4c)
#:use-module (gnu packages image)
#:use-module (gnu packages libbsd)
#:use-module (gnu packages libreoffice)
@@ -1165,3 +1168,54 @@ (define-public virtaal
provided by the Translate Toolkit, including XLIFF and PO.")
(home-page "https://virtaal.translatehouse.org/")
(license license:gpl2+)))
+
+(define-public tree-sitter
+ (package
+ (name "tree-sitter")
+ (version "0.20.6")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/tree-sitter/tree-sitter")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1z20518snyg0zp75qgs5bxmzjqws4dd19vnp6sya494za3qp5b6d"))
+ (modules '((guix build utils)))
+ (snippet '(begin
+ ;; Remove bundled ICU parts
+ (delete-file-recursively "lib/src/unicode")
+ #t))))
+ (build-system gnu-build-system)
+ (inputs (list icu4c))
+ (arguments
+ (list #:phases
+ '(modify-phases %standard-phases
+ (delete 'configure))
+ #:tests? #f ; there are no tests for the runtime library
+ #:make-flags
+ #~(list (string-append "PREFIX="
+ #$output)
+ (string-append "CC="
+ #$(cc-for-target)))))
+ (home-page "https://tree-sitter.github.io/tree-sitter/")
+ (synopsis "Incremental parsing system for programming tools")
+ (description
+ "Tree-sitter is a parser generator tool and an incremental parsing
+library. It can build a concrete syntax tree for a source file and efficiently
+update the syntax tree as the source file is edited.
+
+Tree-sitter aims to be:
+
+@itemize
+@item General enough to parse any programming language
+@item Fast enough to parse on every keystroke in a text editor
+@item Robust enough to provide useful results even in the presence of syntax errors
+@item Dependency-free so that the runtime library (which is written in pure C)
+can be embedded in any application
+@end itemize
+
+This package includes the @code{libtree-sitter} runtime library.
+")
+ (license license:expat)))

base-commit: bae2201a8ddf789dff3f625327f5b2d0a686bc77
--
2.34.0
L
L
Luis Henrique Gomes Higino wrote on 17 Mar 2022 14:44
[PATCH v4 2/2] gnu: neovim: Update to 0.6.1.
(address . 53523@debbugs.gnu.org)(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)
03f1d49dc58a163aadabe638eca370e0e75120ee.1647524617.git.luishenriquegh2701@gmail.com
* gnu/packages/vim.scm (neovim): Update to 0.6.1.

Build neovim with LuaJIT in the supported platforms.
---
gnu/packages/vim.scm | 26 +++++++++++++++++++++-----
1 file changed, 21 insertions(+), 5 deletions(-)

Toggle diff (68 lines)
diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index 28944dd640..1d5904935f 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -12,6 +12,7 @@
;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2021 Tissevert <tissevert+guix@marvid.fr>
;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
+;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -661,7 +662,7 @@ (define-public neovim-syntastic
(define-public neovim
(package
(name "neovim")
- (version "0.4.4")
+ (version "0.6.1")
(source
(origin
(method git-fetch)
@@ -670,13 +671,20 @@ (define-public neovim
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "11zyj6jvkwas3n6w1ckj3pk6jf81z1g7ngg4smmwm7c27y2a6f2m"))))
+ (base32 "10p6lg5yv9n6wcwdprwvvi56dfcm4wsj54nm0invyx3mhf7374lx"))))
(build-system cmake-build-system)
(arguments
`(#:modules ((srfi srfi-26)
(guix build cmake-build-system)
(guix build utils))
- #:configure-flags '("-DPREFER_LUA:BOOL=YES")
+ #:configure-flags
+ (list ,@(if (member (or (if (%current-target-system)
+ (gnu-triplet->nix-system (%current-target-system))
+ #f)
+ (%current-system))
+ (package-supported-systems luajit))
+ '()
+ '("-DPREFER_LUA:BOOL=YES")))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'set-lua-paths
@@ -716,11 +724,19 @@ (define-public neovim
("libvterm" ,libvterm)
("unibilium" ,unibilium)
("jemalloc" ,jemalloc)
- ("lua" ,lua-5.1)
+ ("libiconv" ,libiconv)
+ ("lua" ,(if (member (or (if (%current-target-system)
+ (gnu-triplet->nix-system (%current-target-system))
+ #f)
+ (%current-system))
+ (package-supported-systems luajit))
+ luajit
+ lua-5.1))
("lua-luv" ,lua5.1-luv)
("lua-lpeg" ,lua5.1-lpeg)
("lua-bitop" ,lua5.1-bitop)
- ("lua-libmpack" ,lua5.1-libmpack)))
+ ("lua-libmpack" ,lua5.1-libmpack)
+ ("tree-sitter" ,tree-sitter)))
(native-inputs
`(("pkg-config" ,pkg-config)
("gettext" ,gettext-minimal)
--
2.34.0
L
L
Luis Henrique Gomes Higino wrote on 17 Mar 2022 14:47
Re: [PATCH v3 2/2] gnu: neovim: Update to 0.6.1.
(name . Zongyuan Li)(address . lyzongyuan@gmail.com)(address . 53523@debbugs.gnu.org)
871qz0adtd.fsf@gmail.com
Zongyuan Li <lyzongyuan@gmail.com> writes:

Toggle quote (4 lines)
> Did you write this patch on any commit which is not included in
> the
> Guix main branch?

I wrote the patch on the latest master commit at the time and have
no idea why didn't work for you. I just sent the new version of
the patch series with the `--base=auto` option so that we can find
out what's happening.

Regards,

--
Luis H. Higino
L
L
Luis Henrique Gomes Higino wrote on 17 Mar 2022 14:58
(name . Zongyuan Li)(address . lyzongyuan@gmail.com)(address . 53523@debbugs.gnu.org)
87wngs8yq7.fsf@gmail.com
Zongyuan Li <lyzongyuan@gmail.com> writes:

Toggle quote (4 lines)
> It seems like we import 'libiconv' which is not used as
> dependency in
> previous neovim, from these code:

I just noticed you're right, libiconv is not present at master
since this commit:
for noticing it, I'll remove it and send the patches again.

Regards,

--
Luis H. Higino
L
L
Luis Henrique Gomes Higino wrote on 17 Mar 2022 15:01
[PATCH v5 1/2] gnu: Add tree-sitter.
(address . 53523@debbugs.gnu.org)(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)
1e4edd37cfd4e6724ef6b65547da01efdf023d71.1647525709.git.luishenriquegh2701@gmail.com
* gnu/packages/text-editors.scm (tree-sitter): New variable.
---
gnu/packages/text-editors.scm | 54 +++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)

Toggle diff (87 lines)
diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 45cc61765a..d6ec000dc6 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
;;; Copyright © 2021 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2021 Calum Irwin <calumirwin1@gmail.com>
+;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -39,6 +40,7 @@ (define-module (gnu packages text-editors)
#:use-module (guix gexp)
#:use-module (guix git-download)
#:use-module (guix utils)
+ #:use-module (guix build utils)
#:use-module (guix build-system cargo)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
@@ -62,6 +64,7 @@ (define-module (gnu packages text-editors)
#:use-module (gnu packages gtk)
#:use-module (gnu packages guile)
#:use-module (gnu packages haskell-xyz)
+ #:use-module (gnu packages icu4c)
#:use-module (gnu packages image)
#:use-module (gnu packages libbsd)
#:use-module (gnu packages libreoffice)
@@ -1165,3 +1168,54 @@ (define-public virtaal
provided by the Translate Toolkit, including XLIFF and PO.")
(home-page "https://virtaal.translatehouse.org/")
(license license:gpl2+)))
+
+(define-public tree-sitter
+ (package
+ (name "tree-sitter")
+ (version "0.20.6")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/tree-sitter/tree-sitter")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1z20518snyg0zp75qgs5bxmzjqws4dd19vnp6sya494za3qp5b6d"))
+ (modules '((guix build utils)))
+ (snippet '(begin
+ ;; Remove bundled ICU parts
+ (delete-file-recursively "lib/src/unicode")
+ #t))))
+ (build-system gnu-build-system)
+ (inputs (list icu4c))
+ (arguments
+ (list #:phases
+ '(modify-phases %standard-phases
+ (delete 'configure))
+ #:tests? #f ; there are no tests for the runtime library
+ #:make-flags
+ #~(list (string-append "PREFIX="
+ #$output)
+ (string-append "CC="
+ #$(cc-for-target)))))
+ (home-page "https://tree-sitter.github.io/tree-sitter/")
+ (synopsis "Incremental parsing system for programming tools")
+ (description
+ "Tree-sitter is a parser generator tool and an incremental parsing
+library. It can build a concrete syntax tree for a source file and efficiently
+update the syntax tree as the source file is edited.
+
+Tree-sitter aims to be:
+
+@itemize
+@item General enough to parse any programming language
+@item Fast enough to parse on every keystroke in a text editor
+@item Robust enough to provide useful results even in the presence of syntax errors
+@item Dependency-free so that the runtime library (which is written in pure C)
+can be embedded in any application
+@end itemize
+
+This package includes the @code{libtree-sitter} runtime library.
+")
+ (license license:expat)))

base-commit: bae2201a8ddf789dff3f625327f5b2d0a686bc77
--
2.34.0
L
L
Luis Henrique Gomes Higino wrote on 17 Mar 2022 15:01
[PATCH v5 2/2] gnu: neovim: Update to 0.6.1.
(address . 53523@debbugs.gnu.org)(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)
725e87adeda2ce8a7092c319c6d50c1b3116ec6f.1647525709.git.luishenriquegh2701@gmail.com
* gnu/packages/vim.scm (neovim): Update to 0.6.1.

Build neovim with LuaJIT in the supported platforms.
---
gnu/packages/vim.scm | 25 ++++++++++++++++++++-----
1 file changed, 20 insertions(+), 5 deletions(-)

Toggle diff (67 lines)
diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index 28944dd640..62c0bc2b5c 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -12,6 +12,7 @@
;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2021 Tissevert <tissevert+guix@marvid.fr>
;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
+;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -661,7 +662,7 @@ (define-public neovim-syntastic
(define-public neovim
(package
(name "neovim")
- (version "0.4.4")
+ (version "0.6.1")
(source
(origin
(method git-fetch)
@@ -670,13 +671,20 @@ (define-public neovim
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "11zyj6jvkwas3n6w1ckj3pk6jf81z1g7ngg4smmwm7c27y2a6f2m"))))
+ (base32 "10p6lg5yv9n6wcwdprwvvi56dfcm4wsj54nm0invyx3mhf7374lx"))))
(build-system cmake-build-system)
(arguments
`(#:modules ((srfi srfi-26)
(guix build cmake-build-system)
(guix build utils))
- #:configure-flags '("-DPREFER_LUA:BOOL=YES")
+ #:configure-flags
+ (list ,@(if (member (or (if (%current-target-system)
+ (gnu-triplet->nix-system (%current-target-system))
+ #f)
+ (%current-system))
+ (package-supported-systems luajit))
+ '()
+ '("-DPREFER_LUA:BOOL=YES")))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'set-lua-paths
@@ -716,11 +724,18 @@ (define-public neovim
("libvterm" ,libvterm)
("unibilium" ,unibilium)
("jemalloc" ,jemalloc)
- ("lua" ,lua-5.1)
+ ("lua" ,(if (member (or (if (%current-target-system)
+ (gnu-triplet->nix-system (%current-target-system))
+ #f)
+ (%current-system))
+ (package-supported-systems luajit))
+ luajit
+ lua-5.1))
("lua-luv" ,lua5.1-luv)
("lua-lpeg" ,lua5.1-lpeg)
("lua-bitop" ,lua5.1-bitop)
- ("lua-libmpack" ,lua5.1-libmpack)))
+ ("lua-libmpack" ,lua5.1-libmpack)
+ ("tree-sitter" ,tree-sitter)))
(native-inputs
`(("pkg-config" ,pkg-config)
("gettext" ,gettext-minimal)
--
2.34.0
M
M
Maxime Devos wrote on 17 Mar 2022 18:29
Re: [bug#53523] [PATCH v4 2/2] gnu: neovim: Update to 0.6.1.
3ff575f386858851b72cb2d94e15af4ae4162f33.camel@telenet.be
Luis Henrique Gomes Higino schreef op do 17-03-2022 om 10:44 [-0300]:
Toggle quote (5 lines)
> +       ("lua" ,(if (member (or (if (%current-target-system)
> +                                   (gnu-triplet->nix-system (%current-target-system))
> +                                   #f)
> +                               (%current-system))

This can be simplified to

(member
(if (%current-target-system) (gnu-triplet->...) (%current-system))
(package-supported-systems ...))

Greetings,
Maxime.
-----BEGIN PGP SIGNATURE-----

iI0EABYKADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYjNv7hccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7psYAQDH2D+M5AmjkYTCeFfKApWt6ojq
tafo2ZQo07Cw1wKjjAD/Q/q33feB6bvDmFG52Os5QVAB8fHgiidh6Z0pf1jxIQY=
=VZVR
-----END PGP SIGNATURE-----


L
L
Luis Henrique Gomes Higino wrote on 17 Mar 2022 23:27
[PATCH v6 1/2] gnu: Add tree-sitter.
(address . 53523@debbugs.gnu.org)(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)
1e4edd37cfd4e6724ef6b65547da01efdf023d71.1647556069.git.luishenriquegh2701@gmail.com
* gnu/packages/text-editors.scm (tree-sitter): New variable.
---
gnu/packages/text-editors.scm | 54 +++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)

Toggle diff (87 lines)
diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 45cc61765a..d6ec000dc6 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
;;; Copyright © 2021 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2021 Calum Irwin <calumirwin1@gmail.com>
+;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -39,6 +40,7 @@ (define-module (gnu packages text-editors)
#:use-module (guix gexp)
#:use-module (guix git-download)
#:use-module (guix utils)
+ #:use-module (guix build utils)
#:use-module (guix build-system cargo)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
@@ -62,6 +64,7 @@ (define-module (gnu packages text-editors)
#:use-module (gnu packages gtk)
#:use-module (gnu packages guile)
#:use-module (gnu packages haskell-xyz)
+ #:use-module (gnu packages icu4c)
#:use-module (gnu packages image)
#:use-module (gnu packages libbsd)
#:use-module (gnu packages libreoffice)
@@ -1165,3 +1168,54 @@ (define-public virtaal
provided by the Translate Toolkit, including XLIFF and PO.")
(home-page "https://virtaal.translatehouse.org/")
(license license:gpl2+)))
+
+(define-public tree-sitter
+ (package
+ (name "tree-sitter")
+ (version "0.20.6")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/tree-sitter/tree-sitter")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1z20518snyg0zp75qgs5bxmzjqws4dd19vnp6sya494za3qp5b6d"))
+ (modules '((guix build utils)))
+ (snippet '(begin
+ ;; Remove bundled ICU parts
+ (delete-file-recursively "lib/src/unicode")
+ #t))))
+ (build-system gnu-build-system)
+ (inputs (list icu4c))
+ (arguments
+ (list #:phases
+ '(modify-phases %standard-phases
+ (delete 'configure))
+ #:tests? #f ; there are no tests for the runtime library
+ #:make-flags
+ #~(list (string-append "PREFIX="
+ #$output)
+ (string-append "CC="
+ #$(cc-for-target)))))
+ (home-page "https://tree-sitter.github.io/tree-sitter/")
+ (synopsis "Incremental parsing system for programming tools")
+ (description
+ "Tree-sitter is a parser generator tool and an incremental parsing
+library. It can build a concrete syntax tree for a source file and efficiently
+update the syntax tree as the source file is edited.
+
+Tree-sitter aims to be:
+
+@itemize
+@item General enough to parse any programming language
+@item Fast enough to parse on every keystroke in a text editor
+@item Robust enough to provide useful results even in the presence of syntax errors
+@item Dependency-free so that the runtime library (which is written in pure C)
+can be embedded in any application
+@end itemize
+
+This package includes the @code{libtree-sitter} runtime library.
+")
+ (license license:expat)))

base-commit: bae2201a8ddf789dff3f625327f5b2d0a686bc77
--
2.34.0
L
L
Luis Henrique Gomes Higino wrote on 17 Mar 2022 23:27
[PATCH v6 2/2] gnu: neovim: Update to 0.6.1.
(address . 53523@debbugs.gnu.org)(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)
f390b97010ba68264967138c98dc8dd9e283c176.1647556069.git.luishenriquegh2701@gmail.com
* gnu/packages/vim.scm (neovim): Update to 0.6.1.

Build neovim with LuaJIT in the supported platforms.
---
gnu/packages/vim.scm | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)

Toggle diff (66 lines)
diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index 28944dd640..e7f4464429 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -12,6 +12,7 @@
;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2021 Tissevert <tissevert+guix@marvid.fr>
;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
+;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -661,7 +662,7 @@ (define-public neovim-syntastic
(define-public neovim
(package
(name "neovim")
- (version "0.4.4")
+ (version "0.6.1")
(source
(origin
(method git-fetch)
@@ -670,13 +671,20 @@ (define-public neovim
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "11zyj6jvkwas3n6w1ckj3pk6jf81z1g7ngg4smmwm7c27y2a6f2m"))))
+ (base32 "10p6lg5yv9n6wcwdprwvvi56dfcm4wsj54nm0invyx3mhf7374lx"))))
(build-system cmake-build-system)
(arguments
`(#:modules ((srfi srfi-26)
(guix build cmake-build-system)
(guix build utils))
- #:configure-flags '("-DPREFER_LUA:BOOL=YES")
+ #:configure-flags
+ (list ,@(if (member (or (if (%current-target-system)
+ (gnu-triplet->nix-system (%current-target-system))
+ #f)
+ (%current-system))
+ (package-supported-systems luajit))
+ '()
+ '("-DPREFER_LUA:BOOL=YES")))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'set-lua-paths
@@ -716,11 +724,17 @@ (define-public neovim
("libvterm" ,libvterm)
("unibilium" ,unibilium)
("jemalloc" ,jemalloc)
- ("lua" ,lua-5.1)
+ ("lua" ,(if (member (if (%current-target-system)
+ (gnu-triplet->nix-system (%current-target-system))
+ (%current-system))
+ (package-supported-systems luajit))
+ luajit
+ lua-5.1))
("lua-luv" ,lua5.1-luv)
("lua-lpeg" ,lua5.1-lpeg)
("lua-bitop" ,lua5.1-bitop)
- ("lua-libmpack" ,lua5.1-libmpack)))
+ ("lua-libmpack" ,lua5.1-libmpack)
+ ("tree-sitter" ,tree-sitter)))
(native-inputs
`(("pkg-config" ,pkg-config)
("gettext" ,gettext-minimal)
--
2.34.0
L
L
Luis Henrique Gomes Higino wrote on 18 Mar 2022 00:04
[PATCH v7 1/2] gnu: Add tree-sitter.
(address . 53523@debbugs.gnu.org)(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)
1e4edd37cfd4e6724ef6b65547da01efdf023d71.1647558246.git.luishenriquegh2701@gmail.com
* gnu/packages/text-editors.scm (tree-sitter): New variable.
---
gnu/packages/text-editors.scm | 54 +++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)

Toggle diff (87 lines)
diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 45cc61765a..d6ec000dc6 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
;;; Copyright © 2021 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2021 Calum Irwin <calumirwin1@gmail.com>
+;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -39,6 +40,7 @@ (define-module (gnu packages text-editors)
#:use-module (guix gexp)
#:use-module (guix git-download)
#:use-module (guix utils)
+ #:use-module (guix build utils)
#:use-module (guix build-system cargo)
#:use-module (guix build-system cmake)
#:use-module (guix build-system gnu)
@@ -62,6 +64,7 @@ (define-module (gnu packages text-editors)
#:use-module (gnu packages gtk)
#:use-module (gnu packages guile)
#:use-module (gnu packages haskell-xyz)
+ #:use-module (gnu packages icu4c)
#:use-module (gnu packages image)
#:use-module (gnu packages libbsd)
#:use-module (gnu packages libreoffice)
@@ -1165,3 +1168,54 @@ (define-public virtaal
provided by the Translate Toolkit, including XLIFF and PO.")
(home-page "https://virtaal.translatehouse.org/")
(license license:gpl2+)))
+
+(define-public tree-sitter
+ (package
+ (name "tree-sitter")
+ (version "0.20.6")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/tree-sitter/tree-sitter")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1z20518snyg0zp75qgs5bxmzjqws4dd19vnp6sya494za3qp5b6d"))
+ (modules '((guix build utils)))
+ (snippet '(begin
+ ;; Remove bundled ICU parts
+ (delete-file-recursively "lib/src/unicode")
+ #t))))
+ (build-system gnu-build-system)
+ (inputs (list icu4c))
+ (arguments
+ (list #:phases
+ '(modify-phases %standard-phases
+ (delete 'configure))
+ #:tests? #f ; there are no tests for the runtime library
+ #:make-flags
+ #~(list (string-append "PREFIX="
+ #$output)
+ (string-append "CC="
+ #$(cc-for-target)))))
+ (home-page "https://tree-sitter.github.io/tree-sitter/")
+ (synopsis "Incremental parsing system for programming tools")
+ (description
+ "Tree-sitter is a parser generator tool and an incremental parsing
+library. It can build a concrete syntax tree for a source file and efficiently
+update the syntax tree as the source file is edited.
+
+Tree-sitter aims to be:
+
+@itemize
+@item General enough to parse any programming language
+@item Fast enough to parse on every keystroke in a text editor
+@item Robust enough to provide useful results even in the presence of syntax errors
+@item Dependency-free so that the runtime library (which is written in pure C)
+can be embedded in any application
+@end itemize
+
+This package includes the @code{libtree-sitter} runtime library.
+")
+ (license license:expat)))

base-commit: bae2201a8ddf789dff3f625327f5b2d0a686bc77
--
2.34.0
L
L
Luis Henrique Gomes Higino wrote on 18 Mar 2022 00:04
[PATCH v7 2/2] gnu: neovim: Update to 0.6.1.
(address . 53523@debbugs.gnu.org)(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)
52f6eca6dc79d92bf5b821e8f8857e82b54eddf6.1647558246.git.luishenriquegh2701@gmail.com
* gnu/packages/vim.scm (neovim): Update to 0.6.1.

Build neovim with LuaJIT in the supported platforms.
---
gnu/packages/vim.scm | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)

Toggle diff (65 lines)
diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index 28944dd640..5a417cb456 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -12,6 +12,7 @@
;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2021 Tissevert <tissevert+guix@marvid.fr>
;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
+;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -661,7 +662,7 @@ (define-public neovim-syntastic
(define-public neovim
(package
(name "neovim")
- (version "0.4.4")
+ (version "0.6.1")
(source
(origin
(method git-fetch)
@@ -670,13 +671,19 @@ (define-public neovim
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "11zyj6jvkwas3n6w1ckj3pk6jf81z1g7ngg4smmwm7c27y2a6f2m"))))
+ (base32 "10p6lg5yv9n6wcwdprwvvi56dfcm4wsj54nm0invyx3mhf7374lx"))))
(build-system cmake-build-system)
(arguments
`(#:modules ((srfi srfi-26)
(guix build cmake-build-system)
(guix build utils))
- #:configure-flags '("-DPREFER_LUA:BOOL=YES")
+ #:configure-flags
+ (list ,@(if (member (if (%current-target-system)
+ (gnu-triplet->nix-system (%current-target-system))
+ (%current-system))
+ (package-supported-systems luajit))
+ '()
+ '("-DPREFER_LUA:BOOL=YES")))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'set-lua-paths
@@ -716,11 +723,17 @@ (define-public neovim
("libvterm" ,libvterm)
("unibilium" ,unibilium)
("jemalloc" ,jemalloc)
- ("lua" ,lua-5.1)
+ ("lua" ,(if (member (if (%current-target-system)
+ (gnu-triplet->nix-system (%current-target-system))
+ (%current-system))
+ (package-supported-systems luajit))
+ luajit
+ lua-5.1))
("lua-luv" ,lua5.1-luv)
("lua-lpeg" ,lua5.1-lpeg)
("lua-bitop" ,lua5.1-bitop)
- ("lua-libmpack" ,lua5.1-libmpack)))
+ ("lua-libmpack" ,lua5.1-libmpack)
+ ("tree-sitter" ,tree-sitter)))
(native-inputs
`(("pkg-config" ,pkg-config)
("gettext" ,gettext-minimal)
--
2.34.0
L
L
li zongyuan wrote on 18 Mar 2022 04:50
(address . luishenriquegh2701@gmail.com)(address . 53523@debbugs.gnu.org)
CAG_6QKpMYuW1_OhXf1LMS9skdiTmX2BCJVJ6UcB1GJeRuvADwQ@mail.gmail.com
Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com> writes:

Toggle quote (23 lines)
> @@ -670,13 +671,19 @@ (define-public neovim
> (commit (string-append "v" version))))
> (file-name (git-file-name name version))
> (sha256
> - (base32 "11zyj6jvkwas3n6w1ckj3pk6jf81z1g7ngg4smmwm7c27y2a6f2m"))))
> + (base32 "10p6lg5yv9n6wcwdprwvvi56dfcm4wsj54nm0invyx3mhf7374lx"))))
> (build-system cmake-build-system)
> (arguments
> `(#:modules ((srfi srfi-26)
> (guix build cmake-build-system)
> (guix build utils))
> - #:configure-flags '("-DPREFER_LUA:BOOL=YES")
> + #:configure-flags
> + (list ,@(if (member (if (%current-target-system)
> + (gnu-triplet->nix-system (%current-target-system))
> + (%current-system))
> + (package-supported-systems luajit))
> + '()
> + '("-DPREFER_LUA:BOOL=YES")))
> #:phases
> (modify-phases %standard-phases
> (add-after 'unpack 'set-lua-paths

We can just remove `-DPREFER_LUA:BOOL` flags. Since we have a fallback
from luajit to lua,
this macro won't take any effect.

FYI, you can take a look about usage of this macro from here:


BTW, I have tested this patch set on the x86_64 platform and it works
perfectly. Maybe it's time to involve committers for reviewing this
patch.
L
L
Luis Henrique Gomes Higino wrote on 19 Mar 2022 19:38
(name . li zongyuan)(address . lyzongyuan@gmail.com)(address . 53523@debbugs.gnu.org)
87a6dlwwnn.fsf@gmail.com
li zongyuan <lyzongyuan@gmail.com> writes:

Toggle quote (5 lines)
> We can just remove `-DPREFER_LUA:BOOL` flags. Since we have a
> fallback
> from luajit to lua,
> this macro won't take any effect.

I tried building it on powerpc64le-linux, through `--system`,
without this flag and had this error:

Toggle snippet (13 lines)
CMake Error at
/gnu/store/7vfcp65x5ys1a3jal9qys1davs2zk9rs-cmake-minimal-3.21.4/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:230
(message):
Could NOT find LuaJit (missing: LUAJIT_LIBRARY
LUAJIT_INCLUDE_DIR)
Call Stack (most recent call first):
/gnu/store/7vfcp65x5ys1a3jal9qys1davs2zk9rs-cmake-minimal-3.21.4/share/cmake-3.21/Modules/FindPackageHandleStandardArgs.cmake:594
(_FPHSA_FAILURE_MESSAGE)
cmake/FindLuaJit.cmake:35 (find_package_handle_standard_args)
CMakeLists.txt:422 (find_package)


Toggle quote (6 lines)
> BTW, I have tested this patch set on the x86_64 platform and it
> works
> perfectly. Maybe it's time to involve committers for reviewing
> this
> patch.

I agree! I sense it is really close to done.

Regards,

--
Luis H. Higino
L
L
li zongyuan wrote on 23 Mar 2022 08:42
[PATCH v7 1/2] gnu: Add tree-sitter.
(address . 53523@debbugs.gnu.org)(address . iyzsong@outlook.com)
CAG_6QKpK891Jd-aDKb7qjMLabY+WaG5PGdchc1_KbfkkSjOh-A@mail.gmail.com
Hi Song,

Would you mind take a look about this patch?

This could be great for vim user if it can be applied.

Thanks,
Li
P
P
Pierre Langlois wrote on 25 Mar 2022 13:49
(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)
87sfr66vhg.fsf@gmx.com
Hi!

Toggle quote (2 lines)
> * gnu/packages/text-editors.scm (tree-sitter): New variable.

I applied the patch locally and tested it, just one small nit otherwise
LGTM.

Tested-by: Pierre Langlois <pierre.langlois@gmx.com>
Reviewed-by: Pierre Langlois <pierre.langlois@gmx.com>

Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com> writes:
Toggle quote (22 lines)
> ---
> gnu/packages/text-editors.scm | 54 +++++++++++++++++++++++++++++++++++
> 1 file changed, 54 insertions(+)
>
> diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
> index 45cc61765a..d6ec000dc6 100644
> --- a/gnu/packages/text-editors.scm
> +++ b/gnu/packages/text-editors.scm
> @@ -17,6 +17,7 @@
> ;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
> ;;; Copyright © 2021 Pierre Langlois <pierre.langlois@gmx.com>
> ;;; Copyright © 2021 Calum Irwin <calumirwin1@gmail.com>
> +;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> @@ -39,6 +40,7 @@ (define-module (gnu packages text-editors)
> #:use-module (guix gexp)
> #:use-module (guix git-download)
> #:use-module (guix utils)
> + #:use-module (guix build utils)

I don't think you need this import right? You'll have probably noticed
a warning:

WARNING: (gnu packages text-editors): `which' imported from both (guix build utils) and (gnu packages base)
When this happens we can resolve the conflict with a prefix, so we can
have the `which' procedure and the `base::which' package.

#:use-module ((gnu packages base) #:prefix base:)
In this case though we just don't need the import at all though I think.

Thanks!
Pierre
-----BEGIN PGP SIGNATURE-----

iQFMBAEBCgA2FiEEctU9gYy29KFyWDdMqPyeRH9PfVQFAmI9vBsYHHBpZXJyZS5s
YW5nbG9pc0BnbXguY29tAAoJEKj8nkR/T31Ua/AH/0xSp1o4SV278YRMOvXhkcj9
2Hqg8k4EYpH5E0ceLiB/wm9BtLCMwHFVdDr9pzP8OjM0JxOmG/jyhkwnT8EQjQif
VR7qu04Km7gnG5KGrC3VGj1YR7yT4VqE5z8VattyH05v2HBSDEZlmrx39ZR1KzzT
aHmr/5B0u+7Pl0/wLk3Y5YXDoiW7kP200ea61s+Lq1MwSl61oPAxTUGKSGWmjCHm
VrXt0NqlcagiV4tPUCBJYzGd7c5+7Iz/C04c79xyOo3V8Oz5b9Bftz6V1xn//rJW
ynLVOR6wyhhyXBUU4gi1mOWPAI1TTWJNmHg6gvxFb+eKDlaz24Hd7i90HrLfK14=
=GQ7v
-----END PGP SIGNATURE-----

L
L
Luis Henrique Gomes Higino wrote on 28 Mar 2022 00:25
(name . Pierre Langlois)(address . pierre.langlois@gmx.com)
87k0cfdo5o.fsf@gmail.com
Pierre Langlois <pierre.langlois@gmx.com> writes:

Toggle quote (3 lines)
> In this case though we just don't need the import at all though
> I think.

You are right. I thought it was necessary to import a module
externally to be able to use it on an origin snippet, through the
`modules` field. However, after reading the guix manual with more
attention, I understood it is not. Just to be sure, I tested
building tree-sitter without this import and it was
successful. I'll be sending the new patch series in a minute.

Regards,

--
Luis H. Higino
L
L
Luis Henrique Gomes Higino wrote on 28 Mar 2022 00:31
[PATCH v8 2/2] gnu: neovim: Update to 0.6.1.
(address . 53523@debbugs.gnu.org)(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)
1b466abec478b683e7bb42866ba2ae0842b47ce4.1648420270.git.luishenriquegh2701@gmail.com
* gnu/packages/vim.scm (neovim): Update to 0.6.1.

Build neovim with LuaJIT in the supported platforms.
---
gnu/packages/vim.scm | 23 ++++++++++++++++++-----
1 file changed, 18 insertions(+), 5 deletions(-)

Toggle diff (65 lines)
diff --git a/gnu/packages/vim.scm b/gnu/packages/vim.scm
index ef6c62cc69..bc5e36c6f2 100644
--- a/gnu/packages/vim.scm
+++ b/gnu/packages/vim.scm
@@ -12,6 +12,7 @@
;;; Copyright © 2021 Simon Tournier <zimon.toutoune@gmail.com>
;;; Copyright © 2021 Tissevert <tissevert+guix@marvid.fr>
;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo@hotmail.com>
+;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -662,7 +663,7 @@ (define-public neovim-syntastic
(define-public neovim
(package
(name "neovim")
- (version "0.4.4")
+ (version "0.6.1")
(source
(origin
(method git-fetch)
@@ -671,13 +672,19 @@ (define-public neovim
(commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
- (base32 "11zyj6jvkwas3n6w1ckj3pk6jf81z1g7ngg4smmwm7c27y2a6f2m"))))
+ (base32 "10p6lg5yv9n6wcwdprwvvi56dfcm4wsj54nm0invyx3mhf7374lx"))))
(build-system cmake-build-system)
(arguments
`(#:modules ((srfi srfi-26)
(guix build cmake-build-system)
(guix build utils))
- #:configure-flags '("-DPREFER_LUA:BOOL=YES")
+ #:configure-flags
+ (list ,@(if (member (if (%current-target-system)
+ (gnu-triplet->nix-system (%current-target-system))
+ (%current-system))
+ (package-supported-systems luajit))
+ '()
+ '("-DPREFER_LUA:BOOL=YES")))
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'set-lua-paths
@@ -717,11 +724,17 @@ (define-public neovim
("libvterm" ,libvterm)
("unibilium" ,unibilium)
("jemalloc" ,jemalloc)
- ("lua" ,lua-5.1)
+ ("lua" ,(if (member (if (%current-target-system)
+ (gnu-triplet->nix-system (%current-target-system))
+ (%current-system))
+ (package-supported-systems luajit))
+ luajit
+ lua-5.1))
("lua-luv" ,lua5.1-luv)
("lua-lpeg" ,lua5.1-lpeg)
("lua-bitop" ,lua5.1-bitop)
- ("lua-libmpack" ,lua5.1-libmpack)))
+ ("lua-libmpack" ,lua5.1-libmpack)
+ ("tree-sitter" ,tree-sitter)))
(native-inputs
`(("pkg-config" ,pkg-config)
("gettext" ,gettext-minimal)
--
2.34.0
L
L
Luis Henrique Gomes Higino wrote on 28 Mar 2022 00:31
[PATCH v8 1/2] gnu: Add tree-sitter.
(address . 53523@debbugs.gnu.org)(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)
c8921abb924fb3e186ce60299745f39d80727f70.1648420270.git.luishenriquegh2701@gmail.com
* gnu/packages/text-editors.scm (tree-sitter): New variable.
---
gnu/packages/text-editors.scm | 53 +++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)

Toggle diff (79 lines)
diff --git a/gnu/packages/text-editors.scm b/gnu/packages/text-editors.scm
index 45cc61765a..7cbad042c9 100644
--- a/gnu/packages/text-editors.scm
+++ b/gnu/packages/text-editors.scm
@@ -17,6 +17,7 @@
;;; Copyright © 2021 Leo Famulari <leo@famulari.name>
;;; Copyright © 2021 Pierre Langlois <pierre.langlois@gmx.com>
;;; Copyright © 2021 Calum Irwin <calumirwin1@gmail.com>
+;;; Copyright © 2022 Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -62,6 +63,7 @@ (define-module (gnu packages text-editors)
#:use-module (gnu packages gtk)
#:use-module (gnu packages guile)
#:use-module (gnu packages haskell-xyz)
+ #:use-module (gnu packages icu4c)
#:use-module (gnu packages image)
#:use-module (gnu packages libbsd)
#:use-module (gnu packages libreoffice)
@@ -1165,3 +1167,54 @@ (define-public virtaal
provided by the Translate Toolkit, including XLIFF and PO.")
(home-page "https://virtaal.translatehouse.org/")
(license license:gpl2+)))
+
+(define-public tree-sitter
+ (package
+ (name "tree-sitter")
+ (version "0.20.6")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/tree-sitter/tree-sitter")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "1z20518snyg0zp75qgs5bxmzjqws4dd19vnp6sya494za3qp5b6d"))
+ (modules '((guix build utils)))
+ (snippet '(begin
+ ;; Remove bundled ICU parts
+ (delete-file-recursively "lib/src/unicode")
+ #t))))
+ (build-system gnu-build-system)
+ (inputs (list icu4c))
+ (arguments
+ (list #:phases
+ '(modify-phases %standard-phases
+ (delete 'configure))
+ #:tests? #f ; there are no tests for the runtime library
+ #:make-flags
+ #~(list (string-append "PREFIX="
+ #$output)
+ (string-append "CC="
+ #$(cc-for-target)))))
+ (home-page "https://tree-sitter.github.io/tree-sitter/")
+ (synopsis "Incremental parsing system for programming tools")
+ (description
+ "Tree-sitter is a parser generator tool and an incremental parsing
+library. It can build a concrete syntax tree for a source file and efficiently
+update the syntax tree as the source file is edited.
+
+Tree-sitter aims to be:
+
+@itemize
+@item General enough to parse any programming language
+@item Fast enough to parse on every keystroke in a text editor
+@item Robust enough to provide useful results even in the presence of syntax errors
+@item Dependency-free so that the runtime library (which is written in pure C)
+can be embedded in any application
+@end itemize
+
+This package includes the @code{libtree-sitter} runtime library.
+")
+ (license license:expat)))

base-commit: 2344fb10972a4cefead8e7aa3e0b807da4cf4570
--
2.34.0
L
L
Ludovic Courtès wrote on 29 Mar 2022 12:02
Re: bug#53523: [PATCH] gnu: Add tree-sitter.
(name . Luis Henrique Gomes Higino)(address . luishenriquegh2701@gmail.com)
877d8d2i1a.fsf_-_@gnu.org
Hi Luis,

Luis Henrique Gomes Higino <luishenriquegh2701@gmail.com> skribis:

Toggle quote (2 lines)
> * gnu/packages/text-editors.scm (tree-sitter): New variable.

[...]

Toggle quote (2 lines)
> * gnu/packages/vim.scm (neovim): Update to 0.6.1.

Applied.

Thank you and thanks everyone who commented!

Ludo’.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 53523@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 53523
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch