tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Updating editors/helix to 23.05



More of a question than proposing this as an actual patch. I was poking
about seeing if I _could_ update Helix from 22.12 to 23.05. The changes
per the attached diff "worked for me" (NetBSD amd64), but I'm probably
missing some context as to why the grammar files were split out as they
were.

1. I had to export `GIT_SSL_CAINFO=/usr/pkg/share/mozilla-rootcerts/
cacert.pem`. `git` works for me normally, but I had to do this to get it
to work from the Helix build. Just mentioning it.
2. None of the patches applied, nor do they seem to be required. It
built fine without them and it seems to be running ok.
3. The pre-configure datadir bit didn't seem to be needed (and didn't
work if I kept it in)
4. If I tried to use the Makefile as it was then the grammar build
section would fail and complain about untracked files, e.g:

        Failure 122/122: qmljs Git command failed.
        Stdout:
        Stderr: error: The following untracked working tree files would be overwritten by checkout:

    I'm guessing that's due to upstream changes? I had a little look,
but couldn't say for sure. So I just went for the approach in [the docs][1] and did `hx --grammar fetch` followed by
    `hx --grammar build`

I guess my main questions are:

1. Were the grammars done that way for a reason? If so...
2. Do I need to keep that approach? I.e. figure out a way to get it to
build grammars? Maybe using `git clean`, `git switch --force`, etc?

[1]: https://docs.helix-editor.com/install.html#building-from-source
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/editors/helix/Makefile,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile
--- Makefile	7 Dec 2022 17:08:38 -0000	1.8
+++ Makefile	24 Oct 2023 20:59:44 -0000
@@ -1,7 +1,7 @@
 # $NetBSD: Makefile,v 1.8 2022/12/07 17:08:38 jperkin Exp $
 
 GITHUB_PROJECT=	helix
-DISTNAME=	22.12
+DISTNAME=	23.05
 PKGNAME=	${GITHUB_PROJECT}-${DISTNAME}
 CATEGORIES=	editors
 MASTER_SITES=	${MASTER_SITE_GITHUB:=helix-editor/}
@@ -21,25 +21,26 @@ INSTALLATION_DIRS+=	bin
 INSTALLATION_DIRS+=	share/examples/helix/completion
 
 .include "cargo-depends.mk"
-.include "tree-sitter-depends.mk"
+#.include "tree-sitter-depends.mk"
 
-post-extract:
-	${MKDIR} ${WRKSRC}/runtime/grammars/sources
-.for name rev url path in ${TS_FILES}
-	${LN} -s ${WRKDIR}/${name}-${rev} ${WRKSRC}/runtime/grammars/sources/${path}
-.endfor
-
-SUBST_CLASSES+=		datadir
-SUBST_STAGE.datadir=	pre-configure
-SUBST_MESSAGE.datadir=	Fixing datadir
-SUBST_FILES.datadir=	helix-loader/src/lib.rs
-SUBST_SED.datadir+=	-e 's,%%DATADIR%%,${PREFIX}/share/helix,g'
+#post-extract:
+#	${MKDIR} ${WRKSRC}/runtime/grammars/sources
+#.for name rev url path in ${TS_FILES}
+#	${LN} -s ${WRKDIR}/${name}-${rev} ${WRKSRC}/runtime/grammars/sources/${path}
+#.endfor
+
+#SUBST_CLASSES+=		datadir
+#SUBST_STAGE.datadir=	pre-configure
+#SUBST_MESSAGE.datadir=	Fixing datadir
+#SUBST_FILES.datadir=	helix-loader/src/lib.rs
+#SUBST_SED.datadir+=	-e 's,%%DATADIR%%,${PREFIX}/share/helix,g'
 
 .include "../../mk/bsd.prefs.mk"
 
 post-build:
-	${RUN} cd ${WRKSRC} && env HELIX_RUNTIME=${WRKSRC}/runtime \
-		./target/release/hx --grammar build
+	${RUN} cd ${WRKSRC} && \
+		env HELIX_RUNTIME=${WRKSRC}/runtime ./target/release/hx --grammar fetch && \
+		env HELIX_RUNTIME=${WRKSRC}/runtime ./target/release/hx --grammar build
 .if ${OPSYS} == "Darwin"
 	${RUN} cd ${WRKSRC}/runtime/grammars &&				\
 	for f in *.so; do						\


Home | Main Index | Thread Index | Old Index