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

# Auto-Generated by cargo-ebuild 0.5.4, edited as appropriate

EAPI=8

CRATES="
	addr2line-0.19.0
	adler-1.0.2
	adler32-1.2.0
	aho-corasick-0.7.20
	android_system_properties-0.1.5
	ansi_term-0.12.1
	anyhow-1.0.69
	arboard-1.2.1
	atty-0.2.14
	autocfg-0.1.8
	autocfg-1.1.0
	backtrace-0.3.67
	base64-0.10.1
	base64-0.13.1
	bitflags-1.2.1
	block-0.1.6
	bumpalo-3.12.0
	bytemuck-1.13.0
	byteorder-1.4.3
	bytes-0.4.12
	bytes-0.5.6
	bytes-1.4.0
	cassowary-0.3.0
	cc-1.0.79
	cfg-if-0.1.10
	cfg-if-1.0.0
	chrono-0.4.23
	clap-2.34.0
	clipboard-win-4.5.0
	cloudabi-0.0.3
	codespan-reporting-0.11.1
	color_quant-1.1.0
	core-foundation-0.9.3
	core-foundation-sys-0.8.3
	core-graphics-0.21.0
	crc32fast-1.3.2
	crossterm-0.20.0
	crossterm_winapi-0.8.0
	cxx-1.0.90
	cxx-build-1.0.90
	cxxbridge-flags-1.0.90
	cxxbridge-macro-1.0.90
	darling-0.9.0
	darling_core-0.9.0
	darling_macro-0.9.0
	deflate-0.8.6
	derive_builder-0.7.2
	derive_builder_core-0.5.0
	dirs-3.0.2
	dirs-sys-0.3.7
	dotenv-0.13.0
	either-1.8.1
	encoding_rs-0.8.32
	env_logger-0.6.2
	error-code-2.3.1
	failure-0.1.8
	failure_derive-0.1.8
	fastrand-1.9.0
	fnv-1.0.7
	foreign-types-0.3.2
	foreign-types-shared-0.1.1
	form_urlencoded-1.1.0
	fuchsia-cprng-0.1.1
	fuchsia-zircon-0.3.3
	fuchsia-zircon-sys-0.3.3
	futures-0.3.26
	futures-channel-0.3.26
	futures-core-0.3.26
	futures-executor-0.3.26
	futures-io-0.3.26
	futures-macro-0.3.26
	futures-sink-0.3.26
	futures-task-0.3.26
	futures-util-0.3.26
	gethostname-0.2.3
	getrandom-0.2.8
	gimli-0.27.1
	h2-0.2.7
	hashbrown-0.12.3
	hermit-abi-0.1.19
	hermit-abi-0.2.6
	http-0.2.8
	http-body-0.3.1
	httparse-1.8.0
	httpdate-0.3.2
	humantime-1.3.0
	hyper-0.13.10
	hyper-tls-0.4.3
	iana-time-zone-0.1.53
	iana-time-zone-haiku-0.1.1
	ident_case-1.0.1
	idna-0.1.5
	idna-0.3.0
	image-0.23.14
	indexmap-1.9.2
	instant-0.1.12
	iovec-0.1.4
	ipnet-2.7.1
	itertools-0.8.2
	itoa-0.4.8
	itoa-1.0.5
	jpeg-decoder-0.1.22
	js-sys-0.3.61
	kernel32-sys-0.2.2
	lazy_static-1.4.0
	libc-0.2.139
	link-cplusplus-1.0.8
	linked-hash-map-0.5.6
	lock_api-0.4.9
	log-0.4.17
	malloc_buf-0.0.6
	matches-0.1.10
	memchr-2.5.0
	memoffset-0.6.5
	mime-0.3.16
	mime_guess-2.0.4
	miniz_oxide-0.3.7
	miniz_oxide-0.4.4
	miniz_oxide-0.6.2
	mio-0.6.23
	mio-0.7.14
	mio-named-pipes-0.1.7
	mio-uds-0.6.8
	miow-0.2.2
	miow-0.3.7
	native-tls-0.2.11
	net2-0.2.38
	nix-0.20.2
	ntapi-0.3.7
	num-integer-0.1.45
	num-iter-0.1.43
	num-rational-0.3.2
	num-traits-0.2.15
	num_cpus-1.15.0
	objc-0.2.7
	objc-foundation-0.1.1
	objc_id-0.1.1
	object-0.30.3
	once_cell-1.17.0
	openssl-0.10.45
	openssl-macros-0.1.0
	openssl-probe-0.1.5
	openssl-sys-0.9.80
	parking_lot-0.11.2
	parking_lot_core-0.8.6
	percent-encoding-1.0.1
	percent-encoding-2.2.0
	pin-project-1.0.12
	pin-project-internal-1.0.12
	pin-project-lite-0.1.12
	pin-project-lite-0.2.9
	pin-utils-0.1.0
	pkg-config-0.3.26
	png-0.16.8
	ppv-lite86-0.2.17
	proc-macro2-0.4.30
	proc-macro2-1.0.51
	quick-error-1.2.3
	quote-0.6.13
	quote-1.0.23
	rand-0.6.5
	rand-0.8.5
	rand_chacha-0.1.1
	rand_chacha-0.3.1
	rand_core-0.3.1
	rand_core-0.4.2
	rand_core-0.6.4
	rand_hc-0.1.0
	rand_isaac-0.1.1
	rand_jitter-0.1.4
	rand_os-0.1.3
	rand_pcg-0.1.2
	rand_xorshift-0.1.1
	random-0.12.2
	rdrand-0.4.0
	redox_syscall-0.2.16
	redox_users-0.4.3
	regex-1.7.1
	regex-syntax-0.6.28
	remove_dir_all-0.5.3
	reqwest-0.10.10
	rspotify-0.10.0
	rustc-demangle-0.1.21
	rustc-serialize-0.3.24
	ryu-1.0.12
	schannel-0.1.21
	scopeguard-1.1.0
	scratch-1.0.3
	security-framework-2.3.1
	security-framework-sys-2.8.0
	serde-1.0.152
	serde_derive-1.0.152
	serde_json-1.0.93
	serde_urlencoded-0.7.1
	serde_yaml-0.8.26
	signal-hook-0.3.15
	signal-hook-mio-0.2.3
	signal-hook-registry-1.4.1
	slab-0.4.7
	smallvec-1.10.0
	socket2-0.3.19
	str-buf-1.0.6
	strsim-0.7.0
	strsim-0.8.0
	syn-0.15.44
	syn-1.0.107
	synstructure-0.12.6
	tempfile-3.3.0
	termcolor-1.2.0
	textwrap-0.11.0
	thiserror-1.0.38
	thiserror-impl-1.0.38
	tiff-0.6.1
	time-0.1.45
	tinyvec-1.6.0
	tinyvec_macros-0.1.1
	tokio-0.2.25
	tokio-macros-0.2.6
	tokio-socks-0.3.0
	tokio-tls-0.3.1
	tokio-util-0.3.1
	tower-service-0.3.2
	tracing-0.1.37
	tracing-core-0.1.30
	tracing-futures-0.2.5
	try-lock-0.2.4
	tui-0.16.0
	unicase-2.6.0
	unicode-bidi-0.3.10
	unicode-ident-1.0.6
	unicode-normalization-0.1.22
	unicode-segmentation-1.10.1
	unicode-width-0.1.10
	unicode-xid-0.1.0
	unicode-xid-0.2.4
	url-1.7.2
	url-2.3.1
	vcpkg-0.2.15
	vec_map-0.8.2
	version_check-0.9.4
	want-0.3.0
	wasi-0.10.0+wasi-snapshot-preview1
	wasi-0.11.0+wasi-snapshot-preview1
	wasm-bindgen-0.2.84
	wasm-bindgen-backend-0.2.84
	wasm-bindgen-futures-0.4.34
	wasm-bindgen-macro-0.2.84
	wasm-bindgen-macro-support-0.2.84
	wasm-bindgen-shared-0.2.84
	web-sys-0.3.61
	webbrowser-0.5.5
	weezl-0.1.7
	widestring-0.4.3
	winapi-0.2.8
	winapi-0.3.9
	winapi-build-0.1.1
	winapi-i686-pc-windows-gnu-0.4.0
	winapi-util-0.1.5
	winapi-wsapoll-0.1.1
	winapi-x86_64-pc-windows-gnu-0.4.0
	windows-sys-0.42.0
	windows_aarch64_gnullvm-0.42.1
	windows_aarch64_msvc-0.42.1
	windows_i686_gnu-0.42.1
	windows_i686_msvc-0.42.1
	windows_x86_64_gnu-0.42.1
	windows_x86_64_gnullvm-0.42.1
	windows_x86_64_msvc-0.42.1
	winreg-0.7.0
	ws2_32-sys-0.2.1
	x11rb-0.8.1
	yaml-rust-0.4.5
"

inherit cargo

DESCRIPTION="A Spotify terminal client"

HOMEPAGE="https://github.com/Rigellute/spotify-tui"

SRC_URI="https://github.com/Rigellute/spotify-tui/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz
	$(cargo_crate_uris ${CRATES})"

RESTRICT="mirror"

LICENSE="MIT"

SLOT="0"

KEYWORDS="~amd64"

RDEPEND=">=dev-libs/openssl-1.1"

BDEPEND=">=dev-libs/openssl-1.1
		>=virtual/rust-1.53.0"

src_prepare() {
	# patch Cargo.files to use updated openssl crates
	eapply $FILESDIR/01-openssl-update.patch
	# patch rspotify, Collection bug
	pushd $WORKDIR; eapply $FILESDIR/02-Add-Collection-SearchType.patch; popd
	# patch Cargo.files to use updated openssl crates
	default
}

src_install() {
	cargo_src_install
	#install documentation
	dodoc "${S}/README.md"
}

pkg_postinst() {
	elog "The spotify-tui executable is called spt."
	elog "See the README at /usr/share/doc/${PF} for information about configurating and running spotify-tui."
}