pkgsrc-WIP-changes archive

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

emacs-git: make tree-sitter optional



Module Name:	pkgsrc-wip
Committed By:	Thomas Klausner <wiz%gatalith.at@localhost>
Pushed By:	wiz
Date:		Wed Jan 18 14:55:30 2023 +0100
Changeset:	63557b296db6b377e93b72b057ba139e1c889fc9

Modified Files:
	emacs-git/Makefile
	emacs-git/options.mk

Log Message:
emacs-git: make tree-sitter optional

on the other hand, install all grammars that emacs supports
and that are packaged
TODO: package the rest

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=63557b296db6b377e93b72b057ba139e1c889fc9

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 emacs-git/Makefile   |  1 -
 emacs-git/options.mk | 23 +++++++++++++++++++++--
 2 files changed, 21 insertions(+), 3 deletions(-)

diffs:
diff --git a/emacs-git/Makefile b/emacs-git/Makefile
index 951206d24c..8d58319ea1 100644
--- a/emacs-git/Makefile
+++ b/emacs-git/Makefile
@@ -70,6 +70,5 @@ post-install:
 .include "../../fonts/harfbuzz/buildlink3.mk"
 .include "../../graphics/hicolor-icon-theme/buildlink3.mk"
 .include "../../graphics/libimagequant/buildlink3.mk"
-.include "../../textproc/tree-sitter/buildlink3.mk"
 .include "../../sysutils/desktop-file-utils/desktopdb.mk"
 .include "../../mk/bsd.pkg.mk"
diff --git a/emacs-git/options.mk b/emacs-git/options.mk
index 077c90f27a..3f1ad868ae 100644
--- a/emacs-git/options.mk
+++ b/emacs-git/options.mk
@@ -2,7 +2,7 @@
 
 ### Set options
 PKG_OPTIONS_VAR=			PKG_OPTIONS.emacs
-PKG_SUPPORTED_OPTIONS=			dbus gnutls imagemagick jansson svg xaw3d xml
+PKG_SUPPORTED_OPTIONS=			dbus gnutls imagemagick jansson svg tree-sitter xaw3d xml
 # xaw3d is only valid with tookit = xaw
 
 PKG_OPTIONS_OPTIONAL_GROUPS+=		window-system
@@ -22,7 +22,7 @@ PKG_OPTIONS_GROUP.toolkit=		gtk gtk2 gtk3 xaw
 # imagemagick is disabled because of stability/security
 # svg is omitted because it is rarely needed and heavyweight due to the rust dependency
 # xaw3d is omitted because it is only valid with xaw
-PKG_SUGGESTED_OPTIONS=	dbus gnutls gtk3 jansson xml x11
+PKG_SUGGESTED_OPTIONS=	dbus gnutls gtk3 jansson tree-sitter xml x11
 
 .include "../../mk/bsd.options.mk"
 
@@ -179,6 +179,25 @@ CONFIGURE_ARGS+=	--without-gif
 CONFIGURE_ARGS+=	--without-png
 .endif
 
+.if !empty(PKG_OPTIONS:Mtree-sitter)
+# at least the following modes still have tree-sitter support
+# TODO: package the grammars and depend on them
+#share/emacs/${PKGVERSION}/lisp/progmodes/dockerfile-ts-mode.elc
+#share/emacs/${PKGVERSION}/lisp/progmodes/go-ts-mode.elc
+#share/emacs/${PKGVERSION}/lisp/progmodes/java-ts-mode.elc
+#share/emacs/${PKGVERSION}/lisp/progmodes/ruby-ts-mode.elc
+#share/emacs/${PKGVERSION}/lisp/progmodes/typescript-ts-mode.elc
+DEPENDS+=	tree-sitter-c-[0-9]*:../../textproc/tree-sitter-c
+DEPENDS+=	tree-sitter-cmake-[0-9]*:../../textproc/tree-sitter-cmake
+DEPENDS+=	tree-sitter-cpp-[0-9]*:../../textproc/tree-sitter-cpp
+DEPENDS+=	tree-sitter-json-[0-9]*:../../textproc/tree-sitter-json
+DEPENDS+=	tree-sitter-python-[0-9]*:../../textproc/tree-sitter-python
+DEPENDS+=	tree-sitter-rust-[0-9]*:../../textproc/tree-sitter-rust
+DEPENDS+=	tree-sitter-toml-[0-9]*:../../textproc/tree-sitter-toml
+DEPENDS+=	tree-sitter-yaml-[0-9]*:../../textproc/tree-sitter-yaml
+.include "../../textproc/tree-sitter/buildlink3.mk"
+.endif
+
 # Local Variables:
 # mode: outline-minor
 # outline-regexp: "\\(.[ \t]*\\(if\\|endif\\|else\\|elif\\|include.*options\\|PKG_SUGGES\\)\\)\\|### .\\|# Local"


Home | Main Index | Thread Index | Old Index