Index | Thread | Search

From:
Jeremie Courreges-Anglas <jca@wxcvbn.org>
Subject:
Re: [update] textproc/tree-sitter v0.22.6
To:
Laurent Cheylus <foxy@free.fr>
Cc:
Ports <ports@openbsd.org>, edd@theunixzoo.co.uk
Date:
Fri, 24 May 2024 18:08:49 +0200

Download raw body.

Thread
On Wed, May 22, 2024 at 03:11:10PM +0200, Laurent Cheylus wrote:
> Hi
> 
> [cc edd@ as maintainer of editors/neovim]
> 
> an update for textproc/tree-sitter version 0.22.6, needed to update Neovim for version 0.10.0.
> 
> - update Makefile and distinfo
> - add NO_TEST in Makefile: tests need Rust/cargo
> - update patches/patch-Makefile
> - update pkg/PLIST via 'make update-plist'
> 
> Build OK on current/amd64.
> 
> Comments welcome and please commit if OK.

This needs:
# C11
COMPILER = base-clang ports-gcc
COMPILER_LANGS = c

plus a shared lib major bump because of added and removed public
symbols.

editors/emacs (maintainer speaking) uses this, and still builds with
base-gcc on sparc64, no C11 bits seem to have crept up in the
tree-sitter headers.

NO_TEST isn't just about rust/cargo: make test (now?) needs bash.
make test also tries to connect to github to clone some repos, that
doesn't fly with PORTS_PRIVSEP=Yes.  The NO_TEST comment could be
amended.

ok jca@ with those changes.  Disclaimer: I haven't tested -current
neovim with updated tree-sitter.

> Laurent

> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/textproc/tree-sitter/Makefile,v
> diff -u -p -r1.15 Makefile
> --- Makefile	3 Aug 2023 17:13:49 -0000	1.15
> +++ Makefile	22 May 2024 12:07:53 -0000
> @@ -5,8 +5,7 @@ COMMENT =	parser generator tool and incr
>  
>  GH_ACCOUNT =		tree-sitter
>  GH_PROJECT =		tree-sitter
> -GH_TAGNAME =		v0.20.8
> -REVISION =		1
> +GH_TAGNAME =		v0.22.6
>  
>  SHARED_LIBS +=		tree-sitter	3.0
>  
> @@ -26,5 +25,8 @@ USE_GMAKE =		Yes
>  
>  post-patch:
>  	${SUBST_CMD} ${WRKSRC}/Makefile
> +
> +# Tests need rust/cargo
> +NO_TEST =	Yes
>  
>  .include <bsd.port.mk>
> Index: distinfo
> ===================================================================
> RCS file: /cvs/ports/textproc/tree-sitter/distinfo,v
> diff -u -p -r1.7 distinfo
> --- distinfo	3 Aug 2023 16:50:47 -0000	1.7
> +++ distinfo	22 May 2024 12:07:53 -0000
> @@ -1,2 +1,2 @@
> -SHA256 (tree-sitter-0.20.8.tar.gz) = YYHt4LdHC/yjfik+fV3B0WRpuUhdE/E6YFuuxKix95E=
> -SIZE (tree-sitter-0.20.8.tar.gz) = 2941223
> +SHA256 (tree-sitter-0.22.6.tar.gz) = 4raH90NYq2QEcwt/saHO192zeAIC03WV7NeyCo9Bhh8=
> +SIZE (tree-sitter-0.22.6.tar.gz) = 3036954
> Index: patches/patch-Makefile
> ===================================================================
> RCS file: /cvs/ports/textproc/tree-sitter/patches/patch-Makefile,v
> diff -u -p -r1.3 patch-Makefile
> --- patches/patch-Makefile	11 Mar 2022 20:03:33 -0000	1.3
> +++ patches/patch-Makefile	22 May 2024 12:07:53 -0000
> @@ -5,7 +5,7 @@ the pkg-config file
>  Index: Makefile
>  --- Makefile.orig
>  +++ Makefile
> -@@ -34,8 +34,8 @@ ifeq ($(shell uname),Darwin)
> +@@ -38,8 +38,8 @@ else ifeq ($(shell uname),Darwin)
>   else
>   	SOEXT = so
>   	SOEXTVER_MAJOR = so.$(SONAME_MAJOR)
> @@ -14,28 +14,24 @@ Index: Makefile
>  +	SOEXTVER = so.${LIBtree-sitter_VERSION}
>  +	LINKSHARED += -shared
>   endif
> - ifneq (,$(filter $(shell uname),FreeBSD NetBSD DragonFly))
> + ifneq ($(filter $(shell uname),FreeBSD NetBSD DragonFly),)
>   	PCLIBDIR := $(PREFIX)/libdata/pkgconfig
> -@@ -48,21 +48,16 @@ libtree-sitter.a: $(OBJ)
> - 
> - libtree-sitter.$(SOEXTVER): $(OBJ)
> - 	$(CC) $(LDFLAGS) $(LINKSHARED) $^ $(LDLIBS) -o $@
> --	ln -sf $@ libtree-sitter.$(SOEXT)
> --	ln -sf $@ libtree-sitter.$(SOEXTVER_MAJOR)
> - 
> - install: all
> - 	install -d '$(DESTDIR)$(LIBDIR)'
> - 	install -m755 libtree-sitter.a '$(DESTDIR)$(LIBDIR)'/libtree-sitter.a
> - 	install -m755 libtree-sitter.$(SOEXTVER) '$(DESTDIR)$(LIBDIR)'/libtree-sitter.$(SOEXTVER)
> --	ln -sf libtree-sitter.$(SOEXTVER) '$(DESTDIR)$(LIBDIR)'/libtree-sitter.$(SOEXTVER_MAJOR)
> --	ln -sf libtree-sitter.$(SOEXTVER) '$(DESTDIR)$(LIBDIR)'/libtree-sitter.$(SOEXT)
> - 	install -d '$(DESTDIR)$(INCLUDEDIR)'/tree_sitter
> - 	install -m644 lib/include/tree_sitter/*.h '$(DESTDIR)$(INCLUDEDIR)'/tree_sitter/
> - 	install -d '$(DESTDIR)$(PCLIBDIR)'
> - 	sed -e 's|@LIBDIR@|$(LIBDIR)|;s|@INCLUDEDIR@|$(INCLUDEDIR)|;s|@VERSION@|$(VERSION)|' \
> --	    -e 's|=$(PREFIX)|=$${prefix}|' \
> --	    -e 's|@PREFIX@|$(PREFIX)|' \
> -+	    -e 's|@PREFIX@|$(LOCALBASE)|' \
> - 	    tree-sitter.pc.in > '$(DESTDIR)$(PCLIBDIR)'/tree-sitter.pc
> - 
> +@@ -60,8 +60,7 @@ tree-sitter.pc: tree-sitter.pc.in
> + 	sed -e 's|@VERSION@|$(VERSION)|' \
> + 		-e 's|@LIBDIR@|$(LIBDIR)|' \
> + 		-e 's|@INCLUDEDIR@|$(INCLUDEDIR)|' \
> +-		-e 's|=$(PREFIX)|=$${prefix}|' \
> +-		-e 's|@PREFIX@|$(PREFIX)|' $< > $@
> ++		-e 's|@PREFIX@|$(LOCALBASE)|' $< > $@
> +
>   clean:
> + 	$(RM) $(OBJ) tree-sitter.pc libtree-sitter.a libtree-sitter.$(SOEXT)
> +@@ -72,8 +71,6 @@ install: all
> + 	install -m644 tree-sitter.pc '$(DESTDIR)$(PCLIBDIR)'/tree-sitter.pc
> + 	install -m644 libtree-sitter.a '$(DESTDIR)$(LIBDIR)'/libtree-sitter.a
> + 	install -m755 libtree-sitter.$(SOEXT) '$(DESTDIR)$(LIBDIR)'/libtree-sitter.$(SOEXTVER)
> +-	ln -sf libtree-sitter.$(SOEXTVER) '$(DESTDIR)$(LIBDIR)'/libtree-sitter.$(SOEXTVER_MAJOR)
> +-	ln -sf libtree-sitter.$(SOEXTVER_MAJOR) '$(DESTDIR)$(LIBDIR)'/libtree-sitter.$(SOEXT)
> +
> + uninstall:
> + 	$(RM) '$(DESTDIR)$(LIBDIR)'/libtree-sitter.a \
> Index: pkg/PLIST
> ===================================================================
> RCS file: /cvs/ports/textproc/tree-sitter/pkg/PLIST,v
> diff -u -p -r1.3 PLIST
> --- pkg/PLIST	3 Aug 2023 16:50:47 -0000	1.3
> +++ pkg/PLIST	22 May 2024 12:07:53 -0000
> @@ -1,6 +1,5 @@
>  include/tree_sitter/
>  include/tree_sitter/api.h
> -include/tree_sitter/parser.h
>  @static-lib lib/libtree-sitter.a
>  @lib lib/libtree-sitter.so.${LIBtree-sitter_VERSION}
>  lib/pkgconfig/tree-sitter.pc


-- 
jca