pkgsrc-Changes archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
CVS commit: pkgsrc/textproc/tree-sitter
Module Name: pkgsrc
Committed By: wiz
Date: Wed Jan 18 08:18:16 UTC 2023
Added Files:
pkgsrc/textproc/tree-sitter: grammar.mk
Log Message:
tree-sitter: add fragment intended to be used by tree-sitter grammars
To generate a diff of this commit:
cvs rdiff -u -r0 -r1.1 pkgsrc/textproc/tree-sitter/grammar.mk
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Added files:
Index: pkgsrc/textproc/tree-sitter/grammar.mk
diff -u /dev/null pkgsrc/textproc/tree-sitter/grammar.mk:1.1
--- /dev/null Wed Jan 18 08:18:16 2023
+++ pkgsrc/textproc/tree-sitter/grammar.mk Wed Jan 18 08:18:16 2023
@@ -0,0 +1,25 @@
+# $NetBSD: grammar.mk,v 1.1 2023/01/18 08:18:16 wiz Exp $
+#
+# Common logic to build and install tree-sitter grammars.
+#
+# GRAMMAR_LIBRARY_NAME
+# Name of the grammar library to build and install.
+#
+
+GRAMMAR_LIBRARY_NAME?= lib${PKGNAME}
+
+USE_LANGUAGES+= c c++
+
+do-build:
+ cd ${WRKSRC}/src && \
+ ${CC} ${CFLAGS} -std=c99 -I. -c -fPIC parser.c
+ cd ${WRKSRC}/src && \
+ if [ -f scanner.c ]; then ${CC} ${CFLAGS} -std=c99 -I. -c -fPIC scanner.c; else \
+ ${CXX} ${CXXFLAGS} -I. -c -fPIC scanner.cc; fi
+ cd ${WRKSRC}/src && \
+ ${CXX} -shared -o ${GRAMMAR_LIBRARY_NAME}.so scanner.o parser.o
+
+INSTALLATION_DIRS+= lib
+
+do-install:
+ ${INSTALL_LIB} ${WRKSRC}/src/${GRAMMAR_LIBRARY_NAME}.so ${DESTDIR}${PREFIX}/lib
Home |
Main Index |
Thread Index |
Old Index