mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-07-24 03:35:38 +03:00
this does not download deps that won't be used for the default build target (the ctarget we are building for implicitly). this makes quite a few fetches faster.. because a ton of crates download a 10mb "windows-sys" that is never used, amongst other things. maybe breaks a thing or two.
60 lines
1.7 KiB
Text
60 lines
1.7 KiB
Text
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
|
|
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
|
|
pkgname=diffsitter
|
|
pkgver=0.7.1
|
|
pkgrel=0
|
|
pkgdesc="A tree-sitter based AST difftool to get meaningful semantic diffs"
|
|
url="https://github.com/afnanenayet/diffsitter"
|
|
arch="aarch64 armhf armv7 ppc64le x86 x86_64" # limited by rust/cargo
|
|
license="MIT"
|
|
checkdepends="
|
|
tree-sitter-cpp
|
|
tree-sitter-python
|
|
tree-sitter-rust
|
|
"
|
|
makedepends="cargo"
|
|
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 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-rust grammar.
|
|
cargo test $_cargo_opts -- \
|
|
--skip=_medium_rust_rs_false_expects \
|
|
--skip=_medium_rust_rs_true_expects \
|
|
--skip=_short_rust_rs_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/completions/$_binname.fish
|
|
install -D -m644 comp/$_binname.zsh "$pkgdir"/usr/share/zsh/site-functions/_$_binname
|
|
}
|
|
|
|
sha512sums="
|
|
d609d0b34c9b1bb3ac14211197db6b3952bdae51bef46c3876e5d63a7dc253a2d1a47b0c0d1ebcf3501cafee6c5b530ba6ea6f7d38aa593a729a19ad8dcff6e8 diffsitter-0.7.1.tar.gz
|
|
"
|