summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: a8ace837f817646e7ef6aed9235e57f2a1acd34a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# Maintainer: Kevin Schoon <me at kevinschoon dot com>

pkgname=tree-sitter-capnp
pkgver=1.5.0
pkgrel=2
pkgdesc="capnp grammar for tree-sitter"
arch=('x86_64')
url="https://github.com/amaanq/tree-sitter-capnp"
license=('MIT')
groups=('tree-sitter-grammars')
makedepends=('tree-sitter' 'tree-sitter-cli' 'npm')
provides=('libtree-sitter-capnp')
source=("$pkgname-$pkgver.tar.gz::$url/archive/refs/tags/v$pkgver.tar.gz")
sha256sums=('65631f0bb3d221b9dbacbb0b4c05daf514b080a8328d0e52200f162c7273636a')

prepare() {
	cd "$pkgname-$pkgver"
	tree-sitter generate
}

build() {
	cd "$pkgname-$pkgver/src/"
	cc -shared -fno-exceptions -g -fPIC \
		-o "$srcdir/parser.so" parser.c
}

package() {
	install -Dvm644 parser.so "$pkgdir/usr/lib/libtree-sitter-capnp.so"
	install -dv "$pkgdir/usr/share/tree-sitter/queries/capnp"
	cd "$pkgname-$pkgver"
	install -Dvm644 README.md -t "$pkgdir/usr/share/doc/$pkgname/"
	install -Dvm644 "queries/highlights.scm" "$pkgdir/usr/share/tree-sitter/queries/capnp/highlights.scm"
	install -Dvm644 "queries/injections.scm" "$pkgdir/usr/share/tree-sitter/queries/capnp/injections.scm"
	install -Dvm644 "queries/indents.scm" "$pkgdir/usr/share/tree-sitter/queries/capnp/indents.scm"
	install -Dvm644 "queries/locals.scm" "$pkgdir/usr/share/tree-sitter/queries/capnp/locals.scm"
	install -Dvm644 "queries/folds.scm" "$pkgdir/usr/share/tree-sitter/queries/capnp/folds.scm"
}