# Copyright 2020-2021 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Auto-Generated by cargo-ebuild 0.3.1

EAPI=7

CRATES="
ahash-0.4.7
aho-corasick-0.7.15
ansi_term-0.11.0
ansi_term-0.12.1
arrayref-0.3.6
arrayvec-0.5.2
async-io-1.3.1
attohttpc-0.16.3
atty-0.2.14
autocfg-1.0.1
base64-0.13.0
battery-0.7.8
bitflags-0.9.1
bitflags-1.2.1
blake2b_simd-0.5.11
block-0.1.6
block-buffer-0.7.3
block-padding-0.1.5
byte-tools-0.3.1
byte-unit-4.0.10
byteorder-1.4.3
bytes-1.0.1
cache-padded-1.1.1
cc-1.0.67
cfg-if-0.1.10
cfg-if-1.0.0
chrono-0.4.19
clap-2.33.3
concurrent-queue-1.2.2
constant_time_eq-0.1.5
core-foundation-0.7.0
core-foundation-0.9.1
core-foundation-sys-0.7.0
core-foundation-sys-0.8.2
crossbeam-channel-0.5.0
crossbeam-deque-0.8.0
crossbeam-epoch-0.9.3
crossbeam-utils-0.8.3
derivative-2.2.0
digest-0.8.1
dirs-1.0.5
dirs-next-2.0.0
dirs-sys-next-0.1.2
dlv-list-0.2.2
dtoa-0.4.7
either-1.6.1
enumflags2-0.6.4
enumflags2_derive-0.6.4
fake-simd-0.1.2
fastrand-1.4.0
fnv-1.0.7
foreign-types-0.3.2
foreign-types-shared-0.1.1
form_urlencoded-1.0.1
futures-0.3.13
futures-channel-0.3.13
futures-core-0.3.13
futures-executor-0.3.13
futures-io-0.3.13
futures-lite-1.11.3
futures-macro-0.3.13
futures-sink-0.3.13
futures-task-0.3.13
futures-util-0.3.13
generic-array-0.12.4
gethostname-0.2.1
getrandom-0.1.16
getrandom-0.2.2
git2-0.13.17
hashbrown-0.9.1
hermit-abi-0.1.18
http-0.2.3
idna-0.2.2
indexmap-1.6.2
instant-0.1.9
itoa-0.4.7
jobserver-0.1.21
lazy_static-1.4.0
lazycell-1.3.0
libc-0.2.91
libgit2-sys-0.12.18+1.1.0
libz-sys-1.1.2
linked-hash-map-0.5.4
log-0.4.14
mac-notification-sys-0.3.0
mach-0.3.2
malloc_buf-0.0.6
maplit-1.0.2
matches-0.1.8
memchr-2.3.4
memoffset-0.6.1
native-tls-0.2.7
nb-connect-1.1.0
nix-0.17.0
nix-0.19.1
nix-0.20.0
notify-rust-4.3.0
num-integer-0.1.44
num-traits-0.2.14
num_cpus-1.13.0
objc-0.2.7
objc-foundation-0.1.1
objc_id-0.1.1
once_cell-1.7.2
opaque-debug-0.2.3
open-1.6.0
openssl-0.10.33
openssl-probe-0.1.2
openssl-src-111.14.0+1.1.1j
openssl-sys-0.9.61
ordered-multimap-0.3.1
os_info-3.0.1
parking-2.0.0
path-slash-0.1.4
percent-encoding-2.1.0
pest-2.1.3
pest_derive-2.1.0
pest_generator-2.1.3
pest_meta-2.1.3
pin-project-lite-0.2.6
pin-utils-0.1.0
pkg-config-0.3.19
polling-2.0.3
ppv-lite86-0.2.10
proc-macro-crate-0.1.5
proc-macro-hack-0.5.19
proc-macro-nested-0.1.7
proc-macro2-1.0.24
process_control-3.0.1
quick-xml-0.22.0
quote-0.3.15
quote-1.0.9
rand-0.7.3
rand-0.8.3
rand_chacha-0.2.2
rand_chacha-0.3.0
rand_core-0.5.1
rand_core-0.6.2
rand_hc-0.2.0
rand_hc-0.3.0
rayon-1.5.0
rayon-core-1.9.0
redox_syscall-0.1.57
redox_syscall-0.2.5
redox_users-0.3.5
redox_users-0.4.0
regex-1.4.5
regex-syntax-0.6.23
remove_dir_all-0.5.3
rust-argon2-0.8.3
rust-ini-0.16.1
ryu-1.0.5
schannel-0.1.19
scoped-tls-1.0.0
scopeguard-1.1.0
security-framework-2.1.2
security-framework-sys-2.1.1
semver-0.11.0
semver-parser-0.10.2
serde-1.0.125
serde_derive-1.0.125
serde_json-1.0.64
serde_repr-0.1.6
serde_urlencoded-0.6.1
sha-1-0.8.2
shadow-rs-0.5.24
shell-words-1.0.0
slab-0.4.2
socket2-0.4.0
starship-0.51.0
starship_module_config_derive-0.1.2
strsim-0.8.0
strum-0.8.0
strum_macros-0.8.0
syn-0.11.11
syn-1.0.64
synom-0.11.3
sys-info-0.8.0
tempfile-3.2.0
term_size-0.3.2
textwrap-0.11.0
thiserror-1.0.24
thiserror-impl-1.0.24
time-0.1.44
tinyvec-1.1.1
tinyvec_macros-0.1.0
toml-0.5.8
typenum-1.13.0
ucd-trie-0.1.3
unicode-bidi-0.3.4
unicode-normalization-0.1.17
unicode-segmentation-1.7.1
unicode-width-0.1.8
unicode-xid-0.0.4
unicode-xid-0.2.1
uom-0.30.0
url-2.2.1
urlencoding-1.1.1
utf8-width-0.1.4
vcpkg-0.2.11
vec-arena-1.1.0
vec_map-0.8.2
void-1.0.2
waker-fn-1.1.0
wasi-0.10.0+wasi-snapshot-preview1
wasi-0.9.0+wasi-snapshot-preview1
wepoll-sys-3.0.1
which-4.0.2
wildmatch-1.1.0
winapi-0.3.9
winapi-i686-pc-windows-gnu-0.4.0
winapi-x86_64-pc-windows-gnu-0.4.0
winrt-0.4.0
winrt-notification-0.2.4
xml-rs-0.6.1
yaml-rust-0.4.5
zbus-1.8.0
zbus_macros-1.8.0
zvariant-2.6.0
zvariant_derive-2.6.0
"

inherit cargo

DESCRIPTION="The minimal, blazing-fast, and infinitely customizable prompt for any shell!"
# Double check the homepage as the cargo_metadata crate
# does not provide this value so instead repository is used
HOMEPAGE="https://github.com/starship/starship"
SRC_URI="$(cargo_crate_uris ${CRATES})"

# License set may be more restrictive as OR is not respected
# use cargo-license for a more accurate license picture
LICENSE="Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD-2 ISC MIT MPL-2.0 Unlicense ZLIB"
SLOT="0"
KEYWORDS="~amd64"
IUSE="+battery +http tls-vendored"

DEPEND="
	!tls-vendored? ( dev-libs/openssl:0= )
"
RDEPEND="${DEPEND}
"

DOCS=( CONTRIBUTING.md README.md )

# Rust packages ignore CFLAGS and LDFLAGS so let's silence the QA warnings
QA_FLAGS_IGNORED="usr/bin/starship"

src_configure() {
	myfeatures=(
		$(usev battery)
		$(usev http)
		$(usev tls-vendored)
	)
	cargo_src_configure --no-default-features
}

src_install() {
	cargo_src_install

	einstalldocs
}
