aboutsummaryrefslogtreecommitdiffstats
path: root/community/diffsitter/APKBUILD
diff options
context:
space:
mode:
Diffstat (limited to 'community/diffsitter/APKBUILD')
-rw-r--r--community/diffsitter/APKBUILD64
1 files changed, 64 insertions, 0 deletions
diff --git a/community/diffsitter/APKBUILD b/community/diffsitter/APKBUILD
new file mode 100644
index 00000000000..3705ad3fe33
--- /dev/null
+++ b/community/diffsitter/APKBUILD
@@ -0,0 +1,64 @@
+# Contributor: Jakub Jirutka <jakub@jirutka.cz>
+# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
+pkgname=diffsitter
+pkgver=0.8.2
+pkgrel=0
+pkgdesc="A tree-sitter based AST difftool to get meaningful semantic diffs"
+url="https://github.com/afnanenayet/diffsitter"
+arch="all"
+license="MIT"
+checkdepends="
+ tree-sitter-python
+ tree-sitter-rust
+ "
+makedepends="cargo cargo-auditable"
+install="$pkgname.post-install"
+subpackages="
+ $pkgname-bash-completion
+ $pkgname-fish-completion
+ $pkgname-zsh-completion
+"
+source="https://github.com/afnanenayet/diffsitter/archive/v$pkgver/$pkgname-$pkgver.tar.gz"
+
+_cargo_opts="--frozen --no-default-features --features dynamic-grammar-libs"
+_binname=$pkgname
+
+
+prepare() {
+ default_prepare
+
+ cargo fetch --target="$CTARGET" --locked
+}
+
+build() {
+ cargo auditable build $_cargo_opts --release
+
+ mkdir -p comp
+ local shell; for shell in bash fish zsh; do
+ ./target/release/$_binname gen-completion $shell > comp/$_binname.$shell
+ done
+}
+
+check() {
+ # Skipped tests fail due to differences in the tree-sitter grammars.
+ cargo test $_cargo_opts -- \
+ --skip=_medium_cpp_cpp_false_true_expects \
+ --skip=_medium_cpp_cpp_true_true_expects \
+ --skip=_medium_rust_rs_false_false_expects \
+ --skip=_medium_rust_rs_true_false_expects \
+ --skip=_short_go_go_true_true_expects \
+ --skip=_short_markdown_md_true_true_expects \
+ --skip=_short_rust_rs_true_true_expects
+}
+
+package() {
+ install -D -m755 target/release/$_binname -t "$pkgdir"/usr/bin/
+
+ install -D -m644 comp/$_binname.bash "$pkgdir"/usr/share/bash-completion/completions/$_binname
+ install -D -m644 comp/$_binname.fish "$pkgdir"/usr/share/fish/vendor_completions.d/$_binname.fish
+ install -D -m644 comp/$_binname.zsh "$pkgdir"/usr/share/zsh/site-functions/_$_binname
+}
+
+sha512sums="
+60a5c7f695240ed53ba5fc6b61e9a50e65575dc823d915e08e90de8c4c56ade4cd9e0b66f0bbb53b40041d2b2360512a19ba6eebe95fac973eb0209d0c31620e diffsitter-0.8.2.tar.gz
+"