# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Crate list and dependent-crate licenses autogenerated by pycargoebuild 0.16.0

EAPI=8

CRATES="
	aho-corasick@1.1.4
	anstream@1.0.0
	anstyle-parse@1.0.0
	anstyle-query@1.1.5
	anstyle-wincon@3.0.11
	anstyle@1.0.14
	anyhow@1.0.102
	assert_cmd@2.2.2
	autocfg@1.5.1
	bitflags@2.11.1
	bstr@1.12.1
	camino@1.2.2
	cargo-platform@0.3.3
	cargo_metadata@0.23.1
	cfg-if@1.0.4
	clap@4.6.1
	clap_builder@4.6.0
	clap_derive@4.6.1
	clap_lex@1.1.0
	colorchoice@1.0.5
	crossbeam-deque@0.8.6
	crossbeam-epoch@0.9.18
	crossbeam-utils@0.8.21
	current_platform@0.2.0
	difflib@0.4.0
	either@1.16.0
	equivalent@1.0.2
	errno@0.3.14
	fastrand@2.4.1
	float-cmp@0.10.0
	foldhash@0.1.5
	getrandom@0.4.2
	hashbrown@0.15.5
	hashbrown@0.17.1
	heck@0.5.0
	hermit-abi@0.5.2
	id-arena@2.3.0
	indexmap@2.14.0
	is_terminal_polyfill@1.70.2
	itoa@1.0.18
	leb128fmt@0.1.0
	libc@0.2.186
	linux-raw-sys@0.12.1
	log@0.4.29
	memchr@2.8.0
	normalize-line-endings@0.3.0
	num-traits@0.2.19
	num_cpus@1.17.0
	once_cell@1.21.4
	once_cell_polyfill@1.70.2
	predicates-core@1.0.10
	predicates-tree@1.0.13
	predicates@3.1.4
	prettyplease@0.2.37
	proc-macro2@1.0.106
	quote@1.0.45
	r-efi@6.0.0
	rayon-core@1.13.0
	rayon@1.12.0
	regex-automata@0.4.14
	regex-syntax@0.8.10
	regex@1.12.3
	rustc_version@0.4.1
	rustix@1.1.4
	semver@1.0.28
	serde@1.0.228
	serde_core@1.0.228
	serde_derive@1.0.228
	serde_json@1.0.150
	serde_spanned@1.1.1
	strsim@0.11.1
	syn@2.0.117
	tempfile@3.27.0
	termtree@0.5.1
	thiserror-impl@2.0.18
	thiserror@2.0.18
	toml@1.1.2+spec-1.1.0
	toml_datetime@1.1.1+spec-1.1.0
	toml_parser@1.1.2+spec-1.1.0
	toml_writer@1.1.1+spec-1.1.0
	unicode-ident@1.0.24
	unicode-xid@0.2.6
	utf8parse@0.2.2
	wait-timeout@0.2.1
	wasip2@1.0.3+wasi-0.2.9
	wasip3@0.4.0+wasi-0.3.0-rc-2026-01-06
	wasm-encoder@0.244.0
	wasm-metadata@0.244.0
	wasmparser@0.244.0
	windows-link@0.2.1
	windows-sys@0.61.2
	winnow@1.0.3
	wit-bindgen-core@0.51.0
	wit-bindgen-rust-macro@0.51.0
	wit-bindgen-rust@0.51.0
	wit-bindgen@0.51.0
	wit-bindgen@0.57.1
	wit-component@0.244.0
	wit-parser@0.244.0
	zmij@1.0.21
"

inherit cargo

DESCRIPTION="Cargo subcommand for fuzzing a crate with libFuzzer"
HOMEPAGE="https://github.com/rust-fuzz/cargo-fuzz"
SRC_URI="https://github.com/rust-fuzz/cargo-fuzz/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
SRC_URI+=" ${CARGO_CRATE_URIS}"

LICENSE="|| ( Apache-2.0 MIT )"
# Dependent crate licenses
LICENSE+=" Apache-2.0 MIT Unicode-3.0 ZLIB"
SLOT="0"
KEYWORDS="~amd64 ~arm64"

# The .crate files are not mirrored by Gentoo.
RESTRICT="mirror"

# Rust does not use *FLAGS from make.conf; silence the portage warning.
QA_FLAGS_IGNORED="usr/bin/cargo-fuzz"

pkg_postinst() {
	elog "cargo-fuzz drives the fuzzer through unstable compiler flags, so the"
	elog "fuzzing run itself needs a nightly Rust toolchain -- the stable"
	elog "dev-lang/rust this package was built against is not enough:"
	elog ""
	elog "    cargo +nightly fuzz run <target>"
	elog ""
	elog "The libFuzzer runtime is vendored and built from source, so no"
	elog "separate LLVM component is required."
}