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

# Autogenerated by pycargoebuild 0.10

EAPI=8

CRATES="
	aho-corasick@1.1.4
	aliasable@0.1.3
	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
	askama@0.16.0
	askama_derive@0.16.0
	askama_macros@0.16.0
	askama_parser@0.16.0
	assert_cmd@2.2.2
	bincode@1.3.3
	bitflags@2.11.1
	bstr@1.12.1
	cfg-if@1.0.4
	clap@4.6.1
	clap_builder@4.6.0
	clap_complete@4.6.5
	clap_complete_fig@4.5.2
	clap_complete_nushell@4.6.0
	clap_derive@4.6.1
	clap_lex@1.1.0
	color-print-proc-macro@0.3.7
	color-print@0.3.7
	colorchoice@1.0.5
	deranged@0.5.8
	difflib@0.4.0
	dirs-sys@0.5.0
	dirs@6.0.0
	dunce@1.0.5
	equivalent@1.0.2
	errno@0.3.14
	fastrand@2.4.1
	foldhash@0.1.5
	getrandom@0.2.17
	getrandom@0.4.2
	glob@0.3.3
	hashbrown@0.15.5
	hashbrown@0.17.1
	heck@0.4.1
	heck@0.5.0
	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
	libredox@0.1.16
	linux-raw-sys@0.12.1
	log@0.4.29
	memchr@2.8.0
	minimal-lexical@0.2.1
	nom@7.1.3
	num-conv@0.2.1
	once_cell@1.21.4
	once_cell_polyfill@1.70.2
	option-ext@0.2.0
	ouroboros@0.18.5
	ouroboros_macro@0.18.5
	percent-encoding@2.3.2
	powerfmt@0.2.0
	ppv-lite86@0.2.21
	predicates-core@1.0.10
	predicates-tree@1.0.13
	predicates@3.1.4
	prettyplease@0.2.37
	proc-macro2-diagnostics@0.10.1
	proc-macro2@1.0.106
	quote@1.0.45
	r-efi@6.0.0
	rand@0.8.6
	rand_chacha@0.3.1
	rand_core@0.6.4
	redox_users@0.5.2
	regex-automata@0.4.14
	regex-syntax@0.8.10
	regex@1.12.3
	relative-path@1.9.3
	rstest@0.26.1
	rstest_macros@0.26.1
	rstest_reuse@0.7.0
	rustc-hash@2.1.2
	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.149
	static_assertions@1.1.0
	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
	time-core@0.1.8
	time-macros@0.2.27
	time@0.3.47
	unicode-ident@1.0.24
	unicode-xid@0.2.6
	utf8parse@0.2.2
	version_check@0.9.5
	wait-timeout@0.2.1
	wasi@0.11.1+wasi-snapshot-preview1
	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
	which@8.0.2
	windows-link@0.2.1
	windows-sys@0.61.2
	winnow@1.0.2
	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
	yansi@1.0.1
	zerocopy-derive@0.8.48
	zerocopy@0.8.48
	zmij@1.0.21
"

RUST_MIN_VER="1.85.0"

inherit cargo shell-completion

DESCRIPTION="A smarter cd command for your terminal"
HOMEPAGE="https://github.com/ajeetdsouza/zoxide"
SRC_URI="
	https://github.com/ajeetdsouza/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
	${CARGO_CRATE_URIS}
"

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

QA_FLAGS_IGNORED="usr/bin/zoxide"

src_prepare() {
	sed -i 's:strip = true:strip = false:g' Cargo.toml || die
	default
}

src_install() {
	cargo_src_install

	doman man/man1/*
	dodoc README.md CHANGELOG.md

	newbashcomp contrib/completions/"${PN}".bash "${PN}"
	dozshcomp contrib/completions/_"${PN}"
	dofishcomp contrib/completions/"${PN}".fish

	insinto /usr/share/"${PN}"
	doins init.fish
	doins zoxide.plugin.zsh
}
