# Contributor: Adam Jensen <adam@acj.sh>
# Maintainer: Adam Jensen <adam@acj.sh>
pkgname=rbspy
pkgver=0.27.0
pkgrel=0
pkgdesc="Sampling profiler for Ruby"
url="https://rbspy.github.io/"
arch="all !armv7 !ppc64le !s390x !riscv64" # limited by cargo and build errors
license="MIT"
makedepends="cargo cargo-auditable"
checkdepends="ruby"
options="net"
source="$pkgname-$pkgver.tar.gz::https://github.com/rbspy/rbspy/archive/v$pkgver.tar.gz"


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

check() {
	# Some tests need additional privileges
	cargo test --release --locked -- \
		--skip sampler::tests \
		--skip test_current_thread_address \
		--skip test_initialize_with_disallowed_process \
		--skip test_get_exec_trace \
		--skip test_get_trace
}

package() {
	install -Dm755 "target/release/rbspy" "$pkgdir/usr/bin/rbspy"
}

sha512sums="
7f9f991832d72ecd409df2549127ef420adcadae89383cd006a3fd4fa65e8c8195779e2ef7cb1d119800599a437ded203f70132cc4294c308cb739899c9de797  rbspy-0.27.0.tar.gz
"
