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

# Autogenerated by pycargoebuild 0.10

EAPI=8

CRATES="
	ahash@0.8.11
	aho-corasick@1.1.3
	aliasable@0.1.3
	anstream@0.6.15
	anstyle-parse@0.2.5
	anstyle-query@1.1.1
	anstyle-wincon@3.0.4
	anstyle@1.0.8
	anyhow@1.0.89
	assert_cmd@2.0.16
	autocfg@1.3.0
	bincode@1.3.3
	bitflags@2.6.0
	bstr@1.10.0
	byteorder@1.5.0
	cfg-if@1.0.0
	cfg_aliases@0.2.1
	clap@4.5.17
	clap_builder@4.5.17
	clap_complete@4.5.28
	clap_complete_fig@4.5.2
	clap_derive@4.5.13
	clap_lex@0.7.2
	color-print-proc-macro@0.3.6
	color-print@0.3.6
	colorchoice@1.0.2
	difflib@0.4.0
	dirs-sys@0.4.1
	dirs@5.0.1
	doc-comment@0.3.3
	dunce@1.0.5
	either@1.13.0
	errno@0.3.9
	fastrand@2.1.1
	getrandom@0.2.15
	glob@0.3.1
	hashbrown@0.14.5
	heck@0.4.1
	heck@0.5.0
	home@0.5.9
	is_terminal_polyfill@1.70.1
	itertools@0.12.1
	itoa@1.0.11
	libc@0.2.158
	libredox@0.1.3
	linux-raw-sys@0.4.14
	lock_api@0.4.12
	memchr@2.7.4
	mime@0.3.17
	mime_guess@2.0.5
	minimal-lexical@0.2.1
	nix@0.29.0
	nom@7.1.3
	once_cell@1.19.0
	once_map@0.4.19
	option-ext@0.2.0
	ouroboros@0.18.4
	ouroboros_macro@0.18.4
	parking_lot@0.12.3
	parking_lot_core@0.9.10
	ppv-lite86@0.2.20
	predicates-core@1.0.8
	predicates-tree@1.0.11
	predicates@3.1.2
	proc-macro2-diagnostics@0.10.1
	proc-macro2@1.0.86
	quote@1.0.37
	rand@0.8.5
	rand_chacha@0.3.1
	rand_core@0.6.4
	redox_syscall@0.5.4
	redox_users@0.4.6
	regex-automata@0.4.7
	regex-syntax@0.8.4
	regex@1.10.6
	relative-path@1.9.3
	rinja@0.3.3
	rinja_derive@0.3.3
	rinja_parser@0.3.3
	rstest@0.23.0
	rstest_macros@0.23.0
	rstest_reuse@0.7.0
	rustc-hash@2.0.0
	rustc_version@0.4.1
	rustix@0.38.37
	scopeguard@1.2.0
	semver@1.0.23
	serde@1.0.210
	serde_derive@1.0.210
	smallvec@1.13.2
	stable_deref_trait@1.2.0
	static_assertions@1.1.0
	strsim@0.11.1
	syn@2.0.87
	tempfile@3.12.0
	termtree@0.4.1
	thiserror-impl@1.0.63
	thiserror@1.0.63
	unicase@2.7.0
	unicode-ident@1.0.13
	utf8parse@0.2.2
	version_check@0.9.5
	wait-timeout@0.2.0
	wasi@0.11.0+wasi-snapshot-preview1
	which@6.0.3
	windows-sys@0.48.0
	windows-sys@0.52.0
	windows-sys@0.59.0
	windows-targets@0.48.5
	windows-targets@0.52.6
	windows_aarch64_gnullvm@0.48.5
	windows_aarch64_gnullvm@0.52.6
	windows_aarch64_msvc@0.48.5
	windows_aarch64_msvc@0.52.6
	windows_i686_gnu@0.48.5
	windows_i686_gnu@0.52.6
	windows_i686_gnullvm@0.52.6
	windows_i686_msvc@0.48.5
	windows_i686_msvc@0.52.6
	windows_x86_64_gnu@0.48.5
	windows_x86_64_gnu@0.52.6
	windows_x86_64_gnullvm@0.48.5
	windows_x86_64_gnullvm@0.52.6
	windows_x86_64_msvc@0.48.5
	windows_x86_64_msvc@0.52.6
	winsafe@0.0.19
	yansi@1.0.1
	zerocopy-derive@0.7.35
	zerocopy@0.7.35
"

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-DFS-2016
	|| ( 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
}