diff options
-rw-r--r-- | .SRCINFO | 17 | ||||
-rw-r--r-- | PKGBUILD | 44 |
2 files changed, 61 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..ddfd1171ae4f --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,17 @@ +pkgbase = tree-sitter-commonlisp-git + pkgdesc = Common Lisp grammar for tree-sitter + pkgver = r42.48189d1 + pkgrel = 1 + url = https://github.com/thehamsta/tree-sitter-commonlisp + arch = x86_64 + groups = tree-sitter-grammars + license = GPL3 + makedepends = git + makedepends = tree-sitter + makedepends = npm + provides = tree-sitter-commonlisp + conflicts = tree-sitter-commonlisp + source = tree-sitter-commonlisp-git::git+https://github.com/thehamsta/tree-sitter-commonlisp + sha256sums = SKIP + +pkgname = tree-sitter-commonlisp-git diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..c723e51a98e0 --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,44 @@ +# Maintainer: Luis Martinez <luis dot martinez at tuta dot io> + +pkgname=tree-sitter-commonlisp-git +pkgver=r42.48189d1 +pkgrel=1 +pkgdesc="Common Lisp grammar for tree-sitter" +arch=('x86_64') +url="https://github.com/thehamsta/tree-sitter-commonlisp" +license=('GPL3') +groups=('tree-sitter-grammars') +makedepends=('git' 'tree-sitter' 'npm') +provides=("${pkgname%-git}") +conflicts=("${pkgname%-git}") +source=("$pkgname::git+$url") +sha256sums=('SKIP') + +pkgver() { + cd "$pkgname" + ( set -o pipefail + git describe --long --tags 2>/dev/null | sed 's/^v//;s/-/.r/;s/-/./' || + printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)" + ) +} + +prepare() { + cd "$pkgname" + npm install --cache "$srcdir/npm-cache" tree-sitter-clojure + tree-sitter generate +} + +build() { + cd "$pkgname/src/" + cc $CFLAGS -std=c99 -c parser.c + cc $LDFLAGS -shared parser.o -o "$srcdir/parser.so" +} + +package() { + install -Dvm 644 parser.so "$pkgdir/usr/lib/libtree-sitter-commonlisp.so" + install -d "$pkgdir/usr/share/nvim/runtime/parser/" + ln -s "/usr/lib/libtree-sitter-commonlisp.so" "$pkgdir/usr/share/nvim/runtime/parser/commonlisp.so" + cd "$pkgname" + install -Dvm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname/" +} + |