maintainer="qaqland <qaq@qaq.land>"
pkgname=code-minimap
pkgver=0.6.7
pkgrel=0
pkgdesc="A high performance code minimap render"
url="https://github.com/wfxr/code-minimap"
arch="all"
license="MIT AND Apache-2.0"
makedepends="cargo cargo-auditable"
subpackages="$pkgname-doc"
source="https://github.com/wfxr/code-minimap/archive/v$pkgver/code-minimap-$pkgver.tar.gz"
options="net" # cargo fetch

# upstream does have completion for shells, but it is often invoked by plugins
# rather than people. So we don't build completion-subpackages here.

prepare() {
	default_prepare

	# support loongarch64
	cargo update -p libc --precise 0.2.155

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --frozen --release
}

check() {
	cargo test --frozen
}

package() {
	install -Dm755 target/release/code-minimap -t "$pkgdir"/usr/bin/

	install -Dm644 README.md LICENSE-MIT LICENSE-APACHE \
		-t "$pkgdir"/usr/share/doc/$pkgname
}

sha512sums="
f8dae908edeaea377a9852cda7068e82a1681bc8a077eb935bb86e5df27b96246b923ad821d45c1954302b9c9fba3ea65b263f3e5208239639e6908ed39b458e  code-minimap-0.6.7.tar.gz
"
