# Contributor: Adam Jensen <adam@acj.sh>
# Maintainer: Adam Jensen <adam@acj.sh>
pkgname=rbspy
pkgver=0.25.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="
6348566349d9c300d7169a7449f7ec9e3d801d3be16046fa7567eab409af11e41bab0e158f451840dd0dca4e0c172f01f85ffaa533bfcb8e136180ec0f7929a2  rbspy-0.25.0.tar.gz
"
