PORTNAME=	py-spy # despite its name this is NOT a Python package, but a Rust-based profiler for Python program
PORTVERSION=	0.4.1
PORTREVISION=	1
CATEGORIES=	devel python
MASTER_SITES=	${MASTER_SITE_PYPI}
MASTER_SITE_SUBDIR=	source/p/py_spy
DISTFILES=	${PORTNAME:S/-/_/}-${DISTVERSION}${EXTRACT_SUFX}

MAINTAINER=	yuri@FreeBSD.org
COMMENT=	Sampling profiler for Python programs
WWW=		https://github.com/benfred/py-spy

LICENSE=	MIT
LICENSE_FILE=	${WRKSRC}/LICENSE

BROKEN_i386=	fails to compile: attempt to compute `16_usize - 20_usize`, which would overflow

USES=		cargo llvm

WRKSRC=		${WRKDIR}/${PORTNAME:S/-/_/}-${DISTVERSION}

CARGO_CRATES=	addr2line-0.25.0 \
		adler2-2.0.0 \
		ahash-0.8.11 \
		aho-corasick-1.1.3 \
		android-tzdata-0.1.1 \
		android_system_properties-0.1.5 \
		anstream-0.6.15 \
		anstyle-1.0.8 \
		anstyle-parse-0.2.5 \
		anstyle-query-1.1.1 \
		anstyle-wincon-3.0.4 \
		anyhow-1.0.89 \
		arrayvec-0.7.6 \
		atty-0.2.14 \
		autocfg-1.4.0 \
		bindgen-0.70.1 \
		bitflags-1.3.2 \
		bitflags-2.6.0 \
		bumpalo-3.16.0 \
		bytemuck-1.19.0 \
		byteorder-1.5.0 \
		cc-1.1.30 \
		cexpr-0.6.0 \
		cfg-if-1.0.1 \
		cfg_aliases-0.2.1 \
		chrono-0.4.38 \
		clang-sys-1.8.1 \
		clap-3.2.25 \
		clap-4.5.20 \
		clap_builder-4.5.20 \
		clap_complete-3.2.5 \
		clap_derive-3.2.25 \
		clap_derive-4.5.18 \
		clap_lex-0.2.4 \
		clap_lex-0.7.2 \
		colorchoice-1.0.2 \
		console-0.16.0 \
		core-foundation-sys-0.8.7 \
		cpp_demangle-0.4.4 \
		crc32fast-1.4.2 \
		crossbeam-channel-0.5.15 \
		crossbeam-utils-0.8.20 \
		ctrlc-3.4.5 \
		dashmap-6.1.0 \
		either-1.13.0 \
		encode_unicode-1.0.0 \
		env_filter-0.1.2 \
		env_logger-0.11.5 \
		equivalent-1.0.1 \
		errno-0.3.9 \
		fallible-iterator-0.3.0 \
		fastrand-2.1.1 \
		flate2-1.0.34 \
		getrandom-0.2.15 \
		gimli-0.32.0 \
		glob-0.3.1 \
		goblin-0.10.0 \
		hashbrown-0.12.3 \
		hashbrown-0.13.2 \
		hashbrown-0.14.5 \
		hashbrown-0.15.0 \
		heck-0.4.1 \
		heck-0.5.0 \
		hermit-abi-0.1.19 \
		hermit-abi-0.3.9 \
		humantime-2.1.0 \
		iana-time-zone-0.1.61 \
		iana-time-zone-haiku-0.1.2 \
		indexmap-1.9.3 \
		indexmap-2.6.0 \
		indicatif-0.18.0 \
		inferno-0.12.3 \
		io-lifetimes-1.0.11 \
		is_terminal_polyfill-1.70.1 \
		itertools-0.13.0 \
		itoa-1.0.11 \
		js-sys-0.3.72 \
		lazy_static-1.5.0 \
		libc-0.2.159 \
		libloading-0.8.5 \
		libm-0.2.8 \
		libproc-0.14.10 \
		linux-raw-sys-0.3.8 \
		linux-raw-sys-0.4.14 \
		lock_api-0.4.12 \
		log-0.4.22 \
		lru-0.10.1 \
		mach-0.3.2 \
		mach2-0.4.2 \
		mach_o_sys-0.1.1 \
		memchr-2.7.4 \
		memmap2-0.9.7 \
		minimal-lexical-0.2.1 \
		miniz_oxide-0.8.0 \
		nix-0.26.4 \
		nix-0.29.0 \
		nom-7.1.3 \
		num-format-0.4.4 \
		num-traits-0.2.19 \
		object-0.37.1 \
		once_cell-1.20.2 \
		os_str_bytes-6.6.1 \
		page_size-0.6.0 \
		parking_lot_core-0.9.10 \
		plain-0.2.3 \
		portable-atomic-1.9.0 \
		ppv-lite86-0.2.20 \
		prettyplease-0.2.22 \
		proc-macro-error-1.0.4 \
		proc-macro-error-attr-1.0.4 \
		proc-macro2-1.0.88 \
		proc-maps-0.4.0 \
		py-spy-testdata-0.1.0 \
		quick-xml-0.37.5 \
		quote-1.0.37 \
		rand-0.8.5 \
		rand_chacha-0.3.1 \
		rand_core-0.6.4 \
		rand_distr-0.4.3 \
		read-process-memory-0.1.6 \
		redox_syscall-0.5.7 \
		regex-1.11.0 \
		regex-automata-0.4.8 \
		regex-syntax-0.8.5 \
		remoteprocess-0.5.1 \
		rgb-0.8.50 \
		rustc-demangle-0.1.24 \
		rustc-hash-1.1.0 \
		rustix-0.37.27 \
		rustix-0.38.37 \
		ruzstd-0.8.1 \
		ryu-1.0.18 \
		scopeguard-1.2.0 \
		scroll-0.13.0 \
		scroll_derive-0.13.0 \
		serde-1.0.210 \
		serde_derive-1.0.210 \
		serde_json-1.0.128 \
		shlex-1.3.0 \
		smallvec-1.13.2 \
		stable_deref_trait-1.2.0 \
		str_stack-0.1.0 \
		strsim-0.10.0 \
		strsim-0.11.1 \
		syn-1.0.109 \
		syn-2.0.79 \
		tempfile-3.13.0 \
		termcolor-1.4.1 \
		terminal_size-0.2.6 \
		termios-0.3.3 \
		textwrap-0.16.1 \
		twox-hash-2.1.1 \
		typed-arena-2.0.2 \
		unicode-ident-1.0.13 \
		unicode-width-0.2.1 \
		unit-prefix-0.5.1 \
		utf8parse-0.2.2 \
		version_check-0.9.5 \
		wasi-0.11.0+wasi-snapshot-preview1 \
		wasm-bindgen-0.2.95 \
		wasm-bindgen-backend-0.2.95 \
		wasm-bindgen-macro-0.2.95 \
		wasm-bindgen-macro-support-0.2.95 \
		wasm-bindgen-shared-0.2.95 \
		web-time-1.1.0 \
		winapi-0.3.9 \
		winapi-i686-pc-windows-gnu-0.4.0 \
		winapi-util-0.1.9 \
		winapi-x86_64-pc-windows-gnu-0.4.0 \
		windows-core-0.52.0 \
		windows-link-0.1.3 \
		windows-sys-0.48.0 \
		windows-sys-0.52.0 \
		windows-sys-0.59.0 \
		windows-sys-0.60.2 \
		windows-targets-0.48.5 \
		windows-targets-0.52.6 \
		windows-targets-0.53.3 \
		windows_aarch64_gnullvm-0.48.5 \
		windows_aarch64_gnullvm-0.52.6 \
		windows_aarch64_gnullvm-0.53.0 \
		windows_aarch64_msvc-0.48.5 \
		windows_aarch64_msvc-0.52.6 \
		windows_aarch64_msvc-0.53.0 \
		windows_i686_gnu-0.48.5 \
		windows_i686_gnu-0.52.6 \
		windows_i686_gnu-0.53.0 \
		windows_i686_gnullvm-0.52.6 \
		windows_i686_gnullvm-0.53.0 \
		windows_i686_msvc-0.48.5 \
		windows_i686_msvc-0.52.6 \
		windows_i686_msvc-0.53.0 \
		windows_x86_64_gnu-0.48.5 \
		windows_x86_64_gnu-0.52.6 \
		windows_x86_64_gnu-0.53.0 \
		windows_x86_64_gnullvm-0.48.5 \
		windows_x86_64_gnullvm-0.52.6 \
		windows_x86_64_gnullvm-0.53.0 \
		windows_x86_64_msvc-0.48.5 \
		windows_x86_64_msvc-0.52.6 \
		windows_x86_64_msvc-0.53.0 \
		zerocopy-0.7.35 \
		zerocopy-derive-0.7.35

MAKE_ENV=	LIBCLANG_PATH=${LLVM_PREFIX}/lib \
		LLVM_CONFIG_PATH=${LLVM_CONFIG}

PLIST_FILES=	bin/${PORTNAME}

.include <bsd.port.mk>
