mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-24 19:55:26 +03:00
64 lines
1.9 KiB
Text
64 lines
1.9 KiB
Text
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
|
|
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
|
|
pkgname=diffsitter
|
|
pkgver=0.9.0
|
|
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/diffsitter-$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="
|
|
0ec403ce6a17a64b0f824700869942c03806b519e51f57e744a7e54775b94c14c398e47c348e87b77d1ef67f2c93ab18347d2db13737fa9e1186406e7fada24e diffsitter-0.9.0.tar.gz
|
|
"
|