# 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.5
	anstream@1.0.1
	anstyle-parse@1.0.1
	anstyle-query@1.1.6
	anstyle-wincon@3.0.12
	anstyle@1.0.15
	anyhow@1.0.105
	askama@0.16.1
	askama_derive@0.16.1
	askama_macros@0.16.1
	askama_parser@0.16.1
	assert_cmd@2.2.2
	bincode@1.3.3
	bitflags@2.13.2
	bstr@1.14.0
	cfg-if@1.0.5
	clap@4.6.10
	clap_builder@4.6.10
	clap_complete@4.6.12
	clap_complete_fig@4.5.2
	clap_complete_nushell@4.6.3
	clap_derive@4.6.9
	clap_lex@1.1.2
	color-print-proc-macro@0.3.7
	color-print@0.3.7
	colorchoice@1.0.6
	deranged@0.5.9
	difflib@0.4.0
	dirs-sys@0.5.0
	dirs@7.0.0
	dunce@1.0.5
	errno@0.3.15
	fastrand@2.5.0
	getrandom@0.2.17
	getrandom@0.4.3
	glob@0.3.4
	heck@0.5.0
	is_terminal_polyfill@1.70.2
	itoa@1.0.19
	libc@0.2.191
	libredox@0.1.25
	linux-raw-sys@0.12.1
	memchr@2.8.3
	minimal-lexical@0.2.1
	nom@7.1.3
	num-conv@0.2.2
	once_cell@1.21.4
	once_cell_polyfill@1.70.2
	option-ext@0.2.0
	percent-encoding@2.3.2
	powerfmt@0.2.1
	ppv-lite86@0.2.21
	predicates-core@1.0.10
	predicates-tree@1.0.13
	predicates@3.1.4
	proc-macro2@1.0.107
	quote@1.0.47
	r-efi@6.0.0
	rand@0.8.8
	rand_chacha@0.3.1
	rand_core@0.6.4
	redox_users@0.5.3
	regex-automata@0.4.19
	regex-syntax@0.8.12
	regex@1.13.2
	relative-path@1.9.3
	rstest@0.29.1
	rstest_macros@0.29.1
	rstest_reuse@0.7.2
	rustc-hash@2.1.3
	rustc_version@0.4.1
	rustix@1.1.6
	semver@1.0.28
	serde@1.0.229
	serde_core@1.0.229
	serde_derive@1.0.229
	serde_json@1.0.154
	strsim@0.11.1
	syn@2.0.119
	syn@3.0.10
	tempfile@3.27.0
	termtree@0.5.1
	thiserror-impl@2.0.21
	thiserror@2.0.21
	time-core@0.1.9
	time-macros@0.2.32
	time@0.3.55
	unicode-ident@1.0.27
	utf8parse@0.2.2
	wait-timeout@0.2.1
	wasi@0.11.1+wasi-snapshot-preview1
	which@8.0.6
	windows-link@0.101.0
	windows-link@0.2.1
	windows-sys@0.101.0
	windows-sys@0.61.2
	winnow@1.0.5
	zerocopy-derive@0.8.66
	zerocopy@0.8.66
	zmij@1.0.23
"

RUST_MIN_VER="1.95.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
	|| ( 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
}
