2021-08-28 02:49:15 +02:00

59 lines
1.5 KiB
Plaintext

# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=diffsitter
pkgver=0.6.6
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"
# 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/
}
# NOTE: Building with -Oz, panic=abort etc. doesn't help in this case
# (11.5 -> 10.7 MiB).
build() {
cargo build --release --locked
}
check() {
cargo test --locked
}
package() {
cargo install --locked --path . --root="$pkgdir/usr"
rm "$pkgdir"/usr/.crates*
}
sha512sums="
eee59c62bc62e76953c4bffbb70712a7b7583b9554b69c7abbed616232c7474c5f82f607cc4d36eb1f047024a3d1d5dfec856c062303ba2db85b78ce7a8ff999 diffsitter-0.6.6.tar.gz
"