summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO17
-rw-r--r--PKGBUILD42
2 files changed, 59 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..353745ab247c
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,17 @@
+pkgbase = tree-sitter-swift-git
+ pkgdesc = Swift grammar for tree-sitter
+ pkgver = r368.a22fa5e
+ pkgrel = 1
+ url = https://github.com/tree-sitter/tree-sitter-swift
+ arch = x86_64
+ groups = tree-sitter-grammars
+ license = unknown
+ makedepends = git
+ makedepends = tree-sitter
+ makedepends = npm
+ provides = tree-sitter-swift
+ conflicts = tree-sitter-swift
+ source = tree-sitter-swift-git::git+https://github.com/tree-sitter/tree-sitter-swift
+ sha256sums = SKIP
+
+pkgname = tree-sitter-swift-git
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..c0299d297850
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,42 @@
+# Maintainer: Luis Martinez <luis dot martinez at tuta dot io>
+
+pkgname=tree-sitter-swift-git
+pkgver=r368.a22fa5e
+pkgrel=1
+pkgdesc="Swift grammar for tree-sitter"
+arch=('x86_64')
+url="https://github.com/tree-sitter/tree-sitter-swift"
+license=('unknown')
+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"
+ tree-sitter generate
+}
+
+build() {
+ cd "$pkgname/src"
+ cc $CFLAGS -std=c99 -fPIC -c parser.c
+ cc $LDFLAGS -shared parser.o -o "$srcdir/parser.so"
+}
+
+package() {
+ install -Dvm 644 parser.so "$pkgdir/usr/lib/libtree-sitter-swift.so"
+ install -d "$pkgdir/usr/share/nvim/runtime/parser/"
+ ln -s "/usr/lib/libtree-sitter-swift.so" "$pkgdir/usr/share/nvim/runtime/parser/swift.so"
+ cd "$pkgname"
+ install -Dvm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname/"
+}