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

# Autogenerated by pycargoebuild 0.15.0

EAPI=8

if [[ ${PV} != *9999 ]]; then
	CRATES="
		anstream@0.6.21
		anstyle-parse@0.2.7
		anstyle-query@1.1.5
		anstyle-wincon@3.0.11
		anstyle@1.0.13
		arrayvec@0.7.6
		atty@0.2.14
		bitflags@2.10.0
		clap@4.5.53
		clap_builder@4.5.53
		clap_lex@0.7.6
		colorchoice@1.0.4
		crossbeam-channel@0.5.15
		crossbeam-deque@0.8.6
		crossbeam-epoch@0.9.18
		crossbeam-utils@0.8.21
		either@1.15.0
		errno@0.3.14
		fuchsia-cprng@0.1.1
		hermit-abi@0.1.19
		humansize@2.1.3
		is_terminal_polyfill@1.70.2
		itoa@1.0.15
		libc@0.2.178
		libm@0.2.15
		linux-raw-sys@0.11.0
		num-format@0.4.4
		once_cell_polyfill@1.70.2
		rand@0.4.6
		rand_core@0.3.1
		rand_core@0.4.2
		rayon-core@1.13.0
		rayon@1.11.0
		rdrand@0.4.0
		remove_dir_all@0.5.3
		rustix@1.1.2
		strsim@0.11.1
		tempdir@0.3.7
		terminal_size@0.4.3
		utf8parse@0.2.2
		winapi-i686-pc-windows-gnu@0.4.0
		winapi-x86_64-pc-windows-gnu@0.4.0
		winapi@0.3.9
		windows-link@0.2.1
		windows-sys@0.60.2
		windows-sys@0.61.2
		windows-targets@0.53.5
		windows_aarch64_gnullvm@0.53.1
		windows_aarch64_msvc@0.53.1
		windows_i686_gnu@0.53.1
		windows_i686_gnullvm@0.53.1
		windows_i686_msvc@0.53.1
		windows_x86_64_gnu@0.53.1
		windows_x86_64_gnullvm@0.53.1
		windows_x86_64_msvc@0.53.1
		${P}
	"
fi

inherit cargo

DESCRIPTION="A minimal, fast alternative to 'du -sh'."
HOMEPAGE="https://github.com/sharkdp/diskus"

if [[ ${PV} == *9999 ]]; then
	EGIT_REPO_URI="https://github.com/sharkdp/${PN}.git"
	inherit git-r3

	src_unpack() {
		git-r3_src_unpack
		cargo_live_src_unpack
	}
else
	SRC_URI="${CARGO_CRATE_URIS}"
	KEYWORDS="~amd64 ~arm ~arm64 ~x86"
fi
LICENSE="|| ( Apache-2.0 MIT )"
# Dependent crate licenses
LICENSE+=" ISC MIT"
SLOT="0"

RDEPEND="${DEPEND}"

#QA_FLAGS_IGNORED="usr/bin/${PN}"

src_install() {
	cargo_src_install
	einstalldocs
}