# 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="
	addr2line@0.25.1
	adler2@2.0.1
	aho-corasick@1.1.5
	android_system_properties@0.1.6
	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.104
	argfile@0.2.1
	arrayvec@0.7.8
	async-broadcast@0.7.2
	async-channel@2.5.0
	async-executor@1.14.0
	async-io@2.6.0
	async-lock@3.4.2
	async-priority-channel@0.2.0
	async-process@2.5.0
	async-recursion@1.1.1
	async-signal@0.2.14
	async-task@4.7.1
	async-trait@0.1.92
	atomic-take@1.1.0
	atomic-waker@1.1.2
	autocfg@1.5.1
	axum-core@0.5.6
	axum@0.8.9
	backtrace-ext@0.2.1
	backtrace@0.3.76
	base64@0.22.1
	bitflags@1.3.2
	bitflags@2.13.1
	blake3@1.8.7
	block-buffer@0.10.4
	block2@0.6.2
	blocking@1.7.0
	boxcar@0.2.14
	bstr@1.13.1
	bumpalo@3.20.3
	byteorder@1.5.0
	bytes@1.12.1
	c-gull@0.22.3
	c-scape@0.22.3
	cc@1.4.5
	cfg-if@1.0.4
	cfg_aliases@0.2.2
	chacha20@0.10.2
	chrono@0.4.45
	clap@4.6.6
	clap_builder@4.6.6
	clap_complete@4.6.9
	clap_complete_nushell@4.6.2
	clap_derive@4.6.4
	clap_lex@1.1.0
	clap_mangen@0.2.33
	clearscreen@4.0.6
	colorchoice@1.0.5
	concurrent-queue@2.5.0
	console-api@0.9.0
	console-subscriber@0.5.0
	constant_time_eq@0.4.2
	core-foundation-sys@0.8.7
	cpufeatures@0.2.17
	cpufeatures@0.3.1
	crc32fast@1.5.1
	crossbeam-channel@0.5.17
	crossbeam-deque@0.8.8
	crossbeam-epoch@0.9.21
	crossbeam-utils@0.8.23
	crypto-common@0.1.7
	dashmap@6.2.1
	defmt-macros@1.1.1
	defmt-parser@1.0.0
	defmt@1.1.1
	deranged@0.5.8
	digest@0.10.7
	dirs-sys@0.5.0
	dirs@6.0.0
	dispatch2@0.3.1
	dunce@1.0.5
	dyn-clone@1.0.20
	either@1.18.0
	embed-resource@3.0.11
	endi@1.1.1
	endian-type@0.2.0
	enumflags2@0.7.12
	enumflags2_derive@0.7.12
	env_filter@2.0.0
	env_logger@0.11.11
	equivalent@1.0.2
	errno@0.3.14
	event-listener-strategy@0.5.4
	event-listener@4.0.3
	event-listener@5.4.2
	eyra@0.22.0
	faster-hex@0.10.0
	fastrand@2.5.0
	find-msvc-tools@0.1.12
	flate2@1.1.10
	fnv@1.0.7
	foldhash@0.1.5
	fs-err@2.11.0
	fsevent-sys@4.1.0
	futures-channel@0.3.34
	futures-core@0.3.34
	futures-executor@0.3.34
	futures-io@0.3.34
	futures-lite@2.6.1
	futures-macro@0.3.34
	futures-sink@0.3.34
	futures-task@0.3.34
	futures-util@0.3.34
	futures@0.3.34
	generic-array@0.14.7
	getrandom@0.2.17
	getrandom@0.3.4
	getrandom@0.4.3
	gimli@0.32.3
	gimli@0.34.0
	gix-actor@0.41.2
	gix-config-value@0.19.1
	gix-config@0.59.0
	gix-date@0.15.6
	gix-error@0.2.5
	gix-features@0.49.1
	gix-fs@0.22.1
	gix-glob@0.27.1
	gix-hash@0.26.2
	gix-hashtable@0.16.0
	gix-lock@24.0.0
	gix-object@0.63.0
	gix-path@0.12.6
	gix-ref@0.66.0
	gix-sec@0.14.2
	gix-tempfile@24.0.0
	gix-trace@0.1.21
	gix-utils@0.3.6
	gix-validate@0.11.4
	globset@0.4.20
	h2@0.4.19
	hash32@0.3.1
	hashbrown@0.14.5
	hashbrown@0.17.1
	hdrhistogram@7.6.0
	heapless@0.8.0
	heck@0.5.0
	hermit-abi@0.5.3
	hex@0.4.3
	hifijson@0.2.3
	http-body-util@0.1.5
	http-body@1.1.0
	http@1.5.0
	httparse@1.10.1
	httpdate@1.0.3
	humantime@2.4.0
	hyper-timeout@0.5.2
	hyper-util@0.1.20
	hyper@1.11.1
	iana-time-zone-haiku@0.1.2
	iana-time-zone@0.1.65
	ignore@0.4.33
	indexmap@2.14.2
	inotify-sys@0.1.8
	inotify@0.11.5
	is_ci@1.2.0
	is_terminal_polyfill@1.70.2
	itertools@0.14.0
	itoa@1.0.18
	jaq-core@2.2.1
	jaq-json@1.1.3
	jaq-std@2.1.2
	jiff-core@0.1.0
	jiff-static@0.2.35
	jiff-tzdb-platform@0.1.3
	jiff-tzdb@0.1.8
	jiff@0.2.35
	js-sys@0.3.105
	kqueue-sys@1.1.2
	kqueue@1.2.1
	lazy_static@1.5.0
	libc@0.2.189
	libm@0.2.16
	libmimalloc-sys@0.1.49
	libredox@0.1.23
	linux-raw-sys@0.12.1
	linux-raw-sys@0.9.4
	listenfd@1.0.2
	lock_api@0.4.14
	log@0.4.34
	mac-notification-sys@0.6.15
	matchers@0.2.0
	matchit@0.8.4
	memchr@2.8.3
	memmap2@0.9.11
	memoffset@0.9.1
	miette-derive@7.6.0
	miette@7.6.0
	mimalloc@0.1.52
	mime@0.3.17
	minimal-lexical@0.2.1
	miniz_oxide@0.8.9
	miniz_oxide@0.9.1
	mio@1.2.3
	nibble_vec@0.1.0
	nix@0.31.3
	nom@7.1.3
	nom@8.0.0
	normalize-line-endings@0.3.0
	normalize-path@0.2.1
	notify-rust@4.18.0
	notify-types@2.1.0
	notify@8.2.0
	nu-ansi-term@0.50.3
	num-complex@0.4.6
	num-conv@0.2.2
	num-traits@0.2.19
	objc2-core-foundation@0.3.2
	objc2-encode@4.1.0
	objc2-foundation@0.3.2
	objc2@0.6.4
	object@0.37.3
	once_cell@1.21.4
	once_cell_polyfill@1.70.2
	option-ext@0.2.0
	ordered-stream@0.2.0
	origin@0.26.2
	os_str_bytes@7.2.1
	owo-colors@4.4.0
	parking@2.2.1
	parking_lot@0.12.5
	parking_lot_core@0.9.12
	percent-encoding@2.3.2
	phf@0.11.3
	phf_codegen@0.11.3
	phf_generator@0.11.3
	phf_shared@0.11.3
	pid1@0.1.6
	pin-project-internal@1.1.13
	pin-project-lite@0.2.17
	pin-project@1.1.13
	piper@0.2.5
	polling@3.11.0
	portable-atomic-util@0.2.8
	portable-atomic@1.15.0
	posix-regex@0.1.4
	powerfmt@0.2.0
	ppv-lite86@0.2.21
	printf-compat@0.3.1
	proc-macro-crate@3.5.0
	proc-macro2@1.0.107
	process-wrap@9.1.0
	prodash@31.0.0
	prost-derive@0.14.4
	prost-types@0.14.4
	prost@0.14.4
	quote@1.0.47
	r-efi@5.3.0
	r-efi@6.0.0
	radix_trie@0.3.0
	rand@0.10.2
	rand@0.8.8
	rand@0.9.5
	rand_chacha@0.9.0
	rand_core@0.10.1
	rand_core@0.6.4
	rand_core@0.9.5
	rand_pcg@0.9.0
	rayon-core@1.13.0
	realpath-ext@0.1.3
	redox_syscall@0.5.18
	redox_users@0.5.2
	regex-automata@0.4.18
	regex-lite@0.1.9
	regex-syntax@0.8.11
	regex@1.13.1
	roff@1.1.1
	rustc-demangle@0.1.28
	rustc_version@0.4.1
	rustix-dlmalloc@0.2.2
	rustix-futex-sync@0.4.0
	rustix-openpty@0.2.0
	rustix@1.1.4
	rustversion@1.0.23
	same-file@1.0.6
	scopeguard@1.2.0
	semver@1.0.28
	serde@1.0.229
	serde_core@1.0.229
	serde_derive@1.0.229
	serde_json@1.0.151
	serde_repr@0.1.21
	serde_spanned@1.1.1
	sha1-checked@0.10.0
	sha1@0.10.7
	sharded-slab@0.1.7
	shlex@2.0.1
	signal-hook-registry@1.4.8
	signal-hook@0.4.4
	simd-adler32@0.3.10
	similar@3.2.0
	siphasher@1.0.3
	slab@0.4.12
	smallvec@1.16.0
	snapbox-macros@1.1.0
	snapbox@1.2.2
	socket2@0.6.5
	stable_deref_trait@1.2.1
	strsim@0.11.1
	supports-color@3.0.2
	supports-hyperlinks@3.2.0
	supports-unicode@3.0.0
	symlink@0.1.0
	syn@2.0.119
	syn@3.0.5
	sync_wrapper@1.0.2
	tauri-winrt-notification@0.7.3
	tempfile@3.27.0
	termcolor@1.4.1
	terminal_size@0.4.4
	terminfo@0.9.0
	textwrap@0.16.2
	thiserror-impl@2.0.20
	thiserror@2.0.20
	thread_local@1.1.10
	time-core@0.1.9
	time-macros@0.2.32
	time@0.3.55
	tinyvec@1.13.2
	tinyvec_macros@0.1.1
	tokio-macros@2.7.2
	tokio-stream@0.1.19
	tokio-util@0.7.19
	tokio@1.53.1
	toml@1.1.5+spec-1.1.0
	toml_datetime@1.1.1+spec-1.1.0
	toml_edit@0.25.13+spec-1.1.0
	toml_parser@1.1.3+spec-1.1.0
	toml_writer@1.1.2+spec-1.1.0
	tonic-prost@0.14.6
	tonic@0.14.6
	tower-layer@0.3.3
	tower-service@0.3.3
	tower@0.5.3
	tracing-appender@0.2.5
	tracing-attributes@0.1.31
	tracing-core@0.1.36
	tracing-log@0.2.0
	tracing-serde@0.2.0
	tracing-subscriber@0.3.23
	tracing-test-macro@0.2.6
	tracing-test@0.2.6
	tracing@0.1.44
	try-lock@0.2.5
	typed-arena@2.0.2
	typenum@1.20.1
	tz-rs@0.7.3
	uds_windows@1.2.1
	unicode-bom@2.0.3
	unicode-ident@1.0.24
	unicode-linebreak@0.1.5
	unicode-normalization@0.1.25
	unicode-width@0.1.14
	unicode-width@0.2.2
	unwinding@0.2.10
	urlencoding@2.1.3
	utf8parse@0.2.2
	uuid@1.26.0
	valuable@0.1.1
	version_check@0.9.5
	vswhom-sys@0.1.3
	vswhom@0.1.0
	walkdir@2.5.0
	want@0.3.1
	wasi@0.11.1+wasi-snapshot-preview1
	wasip2@1.0.4+wasi-0.2.12
	wasm-bindgen-macro-support@0.2.128
	wasm-bindgen-macro@0.2.128
	wasm-bindgen-shared@0.2.128
	wasm-bindgen@0.2.128
	which@8.0.6
	winapi-i686-pc-windows-gnu@0.4.0
	winapi-util@0.1.11
	winapi-x86_64-pc-windows-gnu@0.4.0
	winapi@0.3.9
	windows-collections@0.2.0
	windows-collections@0.3.2
	windows-core@0.61.2
	windows-core@0.62.2
	windows-future@0.2.1
	windows-future@0.3.2
	windows-implement@0.60.2
	windows-interface@0.59.3
	windows-link@0.1.3
	windows-link@0.2.1
	windows-numerics@0.2.0
	windows-numerics@0.3.1
	windows-result@0.3.4
	windows-result@0.4.1
	windows-strings@0.4.2
	windows-strings@0.5.1
	windows-sys@0.59.0
	windows-sys@0.60.2
	windows-sys@0.61.2
	windows-targets@0.52.6
	windows-targets@0.53.5
	windows-threading@0.1.0
	windows-threading@0.2.1
	windows-version@0.1.7
	windows@0.61.3
	windows@0.62.2
	windows_aarch64_gnullvm@0.52.6
	windows_aarch64_gnullvm@0.53.1
	windows_aarch64_msvc@0.52.6
	windows_aarch64_msvc@0.53.1
	windows_i686_gnu@0.52.6
	windows_i686_gnu@0.53.1
	windows_i686_gnullvm@0.52.6
	windows_i686_gnullvm@0.53.1
	windows_i686_msvc@0.52.6
	windows_i686_msvc@0.53.1
	windows_x86_64_gnu@0.52.6
	windows_x86_64_gnu@0.53.1
	windows_x86_64_gnullvm@0.52.6
	windows_x86_64_gnullvm@0.53.1
	windows_x86_64_msvc@0.52.6
	windows_x86_64_msvc@0.53.1
	winnow@1.0.4
	winreg@0.55.0
	wit-bindgen@0.57.1
	zbus@5.19.0
	zbus_macros@5.19.0
	zbus_names@4.3.4
	zcheapstr@1.1.0
	zerocopy-derive@0.8.56
	zerocopy@0.8.56
	zlib-rs@0.6.7
	zmij@1.0.23
	zvariant@5.15.0
	zvariant_derive@5.15.0
	zvariant_utils@4.2.0
"

RUST_MIN_VER="1.88.0"

inherit cargo shell-completion

DESCRIPTION="Executes commands in response to file modifications"
HOMEPAGE="https://watchexec.github.io"
SRC_URI="https://github.com/watchexec/watchexec/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
SRC_URI+=" ${CARGO_CRATE_URIS}"

LICENSE="Apache-2.0"
# Dependent crate licenses
LICENSE+="
	Apache-2.0 BSD CC0-1.0 ISC MIT MPL-2.0 Unicode-3.0 WTFPL-2 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/watchexec"

DOCS=( crates/cli/README.md )

src_compile() {
	cargo_src_compile --manifest-path=crates/cli/Cargo.toml
}

src_test() {
	cargo_src_test --manifest-path=crates/cli/Cargo.toml
}

src_install() {
	cargo_src_install --path crates/cli
	einstalldocs

	local shell
	for shell in bash zsh fish; do
		"${ED}"/usr/bin/watchexec --completions "${shell}" > "${T}/${PN}.${shell}" ||
			die "generating ${shell} completion failed"
	done

	newbashcomp "${T}/${PN}.bash" "${PN}"
	newzshcomp "${T}/${PN}.zsh" "_${PN}"
	dofishcomp "${T}/${PN}.fish"
}