# Maintainer: Yigit Sever # Contributor: lilydjwg # Contributor: Clayton Craft pkgname=py-spy pkgver=0.4.1 pkgrel=1 pkgdesc="Sampling profiler for Python programs" arch=('x86_64') license=('MIT') url="https://github.com/benfred/py-spy" makedepends=('rust' 'cargo' 'libunwind') source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz") sha256sums=('6abc303d4e2db30d472997838f83d547a990df7747e1d327249a757863ee9225') prepare() { cd "${pkgname}-${pkgver}" export RUSTUP_TOOLCHAIN=stable cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" } build() { cd "${pkgname}-${pkgver}" export RUSTUP_TOOLCHAIN=stable export CARGO_TARGET_DIR=target cargo build --frozen --release --all-features } package() { cd "${pkgname}-${pkgver}" install -Dm0755 "target/release/py-spy" "${pkgdir}/usr/bin/py-spy" install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" install -Dm644 README.md "${pkgdir}/usr/share/doc/${pkgname}/README.md" }