testing/diffsitter: upgrade to 0.6.8

This commit is contained in:
Jakub Jirutka 2021-12-23 23:48:25 +01:00
parent ffd6fe3f27
commit deadee938f
2 changed files with 30 additions and 36 deletions

View File

@ -1,64 +1,48 @@
# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=diffsitter
pkgver=0.6.6
pkgver=0.6.8
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"
makedepends="cargo rsync"
source="https://dev.alpinelinux.org/archive/$pkgname/$pkgname-$pkgver.tar.gz"
checkdepends="tree-sitter-python tree-sitter-rust"
makedepends="cargo"
install="$pkgname.post-install"
source="https://github.com/afnanenayet/diffsitter/archive/v$pkgver/$pkgname-$pkgver.tar.gz"
# https://github.com/afnanenayet/diffsitter/issues/159
snapshot() {
local tarball="$pkgname-$pkgver.tar.gz"
clean
deps
mkdir -p "$srcdir"
cd "$srcdir"
msg 'Clonning source repository'
git clone \
--depth 1 \
--shallow-submodules \
--recurse-submodules \
--branch "v$pkgver" \
https://github.com/afnanenayet/diffsitter.git ${tarball%.tar.gz}
# Create reproducible tarball (always same checksum for same content).
tar -cz \
--owner=0 --group=0 --mtime='1970-01-01' \
--exclude-vcs \
-f "$SRCDEST/$tarball" ${tarball%.tar.gz}
msg "Uploading $tarball"
rsync --progress "$SRCDEST/$tarball" dev.alpinelinux.org:/archive/$pkgname/
}
_cargo_opts="--frozen --no-default-features --features dynamic-grammar-libs"
prepare() {
default_prepare
# Optimize binary for size.
cat >> Cargo.toml <<-EOF
[profile.release]
codegen-units = 1
lto = true
opt-level = "z"
panic = "abort"
EOF
cargo fetch --locked
}
# NOTE: Building with -Oz, panic=abort etc. doesn't help in this case
# (11.5 -> 10.7 MiB).
build() {
cargo build --frozen --release
cargo build $_cargo_opts --release
}
check() {
cargo test --frozen
cargo test $_cargo_opts
}
package() {
cargo install --frozen --offline --path . --root="$pkgdir/usr"
cargo install $_cargo_opts --offline --path . --root="$pkgdir/usr"
rm "$pkgdir"/usr/.crates*
}
sha512sums="
eee59c62bc62e76953c4bffbb70712a7b7583b9554b69c7abbed616232c7474c5f82f607cc4d36eb1f047024a3d1d5dfec856c062303ba2db85b78ce7a8ff999 diffsitter-0.6.6.tar.gz
ecb2e4653c5bfae38911baf13379715eb816088a4c3e677ac2637cd834d99e1256a97c5d95a1e7e95858b89877ba11088a1051c23734c19f6709ce6d3a28e566 diffsitter-0.6.8.tar.gz
"

View File

@ -0,0 +1,10 @@
#!/bin/sh
cat >&2 <<EOF
*
* diffsitter uses tree-sitter grammars that are provided in standalone packages
* 'tree-sitter-<lang>' (e.g. tree-sitter-c) and must be installed separately.
*
EOF
exit 0