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

# Auto-Generated by cargo-ebuild 0.5.4-r1

EAPI=8

CRATES="
	anstream@0.5.0
	anstyle@1.0.3
	anstyle-parse@0.2.1
	anstyle-query@1.0.0
	anstyle-wincon@2.1.0
	clap@4.4.4
	clap_builder@4.4.4
	clap_derive@4.4.2
	clap_lex@0.5.1
	colorchoice@1.0.0
	heck@0.4.1
	lazy_static@1.4.0
	proc-macro2@1.0.67
	quote@1.0.33
	strsim@0.10.0
	syn@2.0.37
	unicode-ident@1.0.12
	utf8parse@0.2.1
	windows-sys@0.48.0
	windows-targets@0.48.5
	windows_aarch64_gnullvm@0.48.5
	windows_aarch64_msvc@0.48.5
	windows_i686_gnu@0.48.5
	windows_i686_msvc@0.48.5
	windows_x86_64_gnu@0.48.5
	windows_x86_64_gnullvm@0.48.5
	windows_x86_64_msvc@0.48.5
"

inherit cargo

DESCRIPTION="A container runtimer wrapper for OCI (distrobox/toolbox, also podman/docker)"
# Double check the homepage as the cargo_metadata crate
# does not provide this value so instead repository is used
HOMEPAGE="https://github.com/xz-dev/distrobox-boost"
SRC_URI="${CARGO_CRATE_URIS}"
if [[ ${PV} == 9999 ]]; then
	inherit git-r3
	EGIT_REPO_URI="https://github.com/xz-dev/${PN}.git"
else
	SRC_URI+=" https://github.com/xz-dev/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
fi

# License set may be more restrictive as OR is not respected
# use cargo-license for a more accurate license picture
LICENSE="MIT"
SLOT="0"
KEYWORDS="~amd64 ~x86"

DEPEND="app-containers/distrobox"
RDEPEND="${DEPEND}"

# rust does not use *FLAGS from make.conf, silence portage warning
# update with proper path to binaries this crate installs, omit leading /
QA_FLAGS_IGNORED="usr/bin/${PN}"

src_unpack() {
	if [[ ${PV} = *9999* ]]; then
		git-r3_src_unpack
		cargo_live_src_unpack
	else
		cargo_src_unpack
	fi
}