# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# shellcheck disable=SC2086

EAPI=8

CRATES="
	addr2line-0.17.0
	adler-1.0.2
	adler32-1.2.0
	aho-corasick-0.7.18
	ansi_term-0.12.1
	anyhow-1.0.51
	async-trait-0.1.52
	atty-0.2.14
	autocfg-1.0.1
	backtrace-0.3.63
	base64-0.13.0
	big_enum_set-0.2.1
	big_enum_set_derive-0.2.1
	bigml-0.9.1
	bigml_derive-0.4.0
	bit-vec-0.5.1
	bitflags-1.3.2
	block-buffer-0.9.0
	block-buffer-0.10.0
	bstr-0.2.17
	bumpalo-3.8.0
	byteorder-1.4.3
	bytes-1.1.0
	cast-0.3.0
	cc-1.0.72
	cfg-if-1.0.0
	chrono-0.4.19
	clap-2.34.0
	cli_test_dir-0.1.7
	codespan-reporting-0.11.1
	combine-4.6.2
	core-foundation-0.9.2
	core-foundation-sys-0.8.3
	cpufeatures-0.2.1
	crc32c-0.6.0
	crc32fast-1.3.0
	crypto-common-0.1.1
	csv-1.1.6
	csv-core-0.1.10
	ct-logs-0.8.0
	ctor-0.1.21
	darling-0.10.2
	darling_core-0.10.2
	darling_macro-0.10.2
	diff-0.1.12
	difference-2.0.0
	digest-0.9.0
	digest-0.10.1
	dirs-4.0.0
	dirs-sys-0.3.6
	either-1.6.1
	encoding_rs-0.8.30
	fallible-iterator-0.2.0
	fnv-1.0.7
	form_urlencoded-1.0.1
	futures-0.3.19
	futures-channel-0.3.19
	futures-core-0.3.19
	futures-executor-0.3.19
	futures-io-0.3.19
	futures-macro-0.3.19
	futures-sink-0.3.19
	futures-task-0.3.19
	futures-util-0.3.19
	generic-array-0.14.4
	geo-types-0.7.2
	geojson-0.22.2
	getrandom-0.2.3
	gimli-0.26.1
	h2-0.3.9
	hashbrown-0.11.2
	headers-0.3.5
	headers-core-0.2.0
	heck-0.3.3
	hermit-abi-0.1.19
	hex-0.4.3
	hmac-0.12.0
	http-0.2.5
	http-body-0.4.4
	httparse-1.5.1
	httpdate-1.0.2
	humanize-rs-0.1.5
	hyper-0.14.16
	hyper-rustls-0.22.1
	hyper-rustls-0.23.0
	ident_case-1.0.1
	idna-0.2.3
	include-flate-0.1.4
	include-flate-codegen-0.1.4
	include-flate-codegen-exports-0.1.4
	indexmap-1.7.0
	instant-0.1.12
	ipnet-2.3.1
	itertools-0.10.3
	itoa-0.4.8
	itoa-1.0.1
	js-sys-0.3.55
	kstring-1.0.6
	lazy_static-1.4.0
	libc-0.2.112
	libflate-1.1.1
	libflate_lz77-1.1.0
	lock_api-0.4.5
	log-0.4.14
	matchers-0.1.0
	matches-0.1.9
	md-5-0.10.0
	memchr-2.4.1
	mime-0.3.16
	mime_guess-2.0.3
	miniz_oxide-0.4.4
	mio-0.7.14
	miow-0.3.7
	ntapi-0.3.6
	num-integer-0.1.44
	num-traits-0.2.14
	num_cpus-1.13.0
	object-0.27.1
	once_cell-1.9.0
	opaque-debug-0.3.0
	opener-0.5.0
	openssl-probe-0.1.4
	output_vt100-0.1.2
	parking_lot-0.11.2
	parking_lot_core-0.8.5
	parse_link_header-0.2.1
	peg-0.7.0
	peg-macros-0.7.0
	peg-runtime-0.7.0
	percent-encoding-2.1.0
	phf-0.10.1
	phf_shared-0.10.0
	pin-project-1.0.8
	pin-project-internal-1.0.8
	pin-project-lite-0.2.7
	pin-utils-0.1.0
	postgis-0.9.0
	postgres-protocol-0.6.3
	postgres-types-0.2.2
	ppv-lite86-0.2.15
	pretty_assertions-1.0.0
	proc-macro-error-1.0.4
	proc-macro-error-attr-1.0.4
	proc-macro-hack-0.5.19
	proc-macro2-1.0.34
	quote-1.0.10
	rand-0.8.4
	rand_chacha-0.3.1
	rand_core-0.6.3
	rand_hc-0.3.1
	redox_syscall-0.2.10
	redox_users-0.4.0
	regex-1.5.4
	regex-automata-0.1.10
	regex-syntax-0.6.25
	remove_dir_all-0.5.3
	reqwest-0.11.7
	ring-0.16.20
	rle-decode-fast-1.0.1
	rustc-demangle-0.1.21
	rustc_version-0.2.3
	rustls-0.19.1
	rustls-0.20.2
	rustls-native-certs-0.5.0
	rustls-native-certs-0.6.1
	rustls-pemfile-0.2.1
	rustversion-1.0.6
	ryu-1.0.9
	same-file-1.0.6
	schannel-0.1.19
	scopeguard-1.1.0
	sct-0.6.1
	sct-0.7.0
	seahash-4.1.0
	security-framework-2.4.2
	security-framework-sys-2.4.2
	semver-0.9.0
	semver-parser-0.7.0
	serde-1.0.132
	serde_derive-1.0.132
	serde_json-1.0.73
	serde_urlencoded-0.7.0
	sha-1-0.9.8
	sha-1-0.10.0
	sha2-0.10.0
	sharded-slab-0.1.4
	signal-hook-registry-1.4.0
	siphasher-0.3.7
	slab-0.4.5
	smallvec-1.7.0
	socket2-0.4.2
	spin-0.5.2
	static_assertions-0.3.4
	stringprep-0.1.2
	strsim-0.8.0
	strsim-0.9.3
	structopt-0.3.25
	structopt-derive-0.4.18
	strum-0.23.0
	strum_macros-0.23.1
	subtle-2.4.1
	syn-1.0.82
	tempfile-3.2.0
	term_size-0.3.2
	termcolor-1.1.2
	textwrap-0.11.0
	thiserror-1.0.30
	thiserror-impl-1.0.30
	thread_local-1.1.3
	time-0.1.43
	tinyvec-1.5.1
	tinyvec_macros-0.1.0
	tokio-1.15.0
	tokio-macros-1.7.0
	tokio-postgres-0.7.5
	tokio-postgres-rustls-0.9.0
	tokio-rustls-0.22.0
	tokio-rustls-0.23.2
	tokio-stream-0.1.8
	tokio-util-0.6.9
	toml_edit-0.11.0
	tower-service-0.3.1
	tracing-0.1.29
	tracing-attributes-0.1.18
	tracing-core-0.1.21
	tracing-futures-0.2.5
	tracing-log-0.1.2
	tracing-subscriber-0.3.3
	try-lock-0.2.3
	typenum-1.14.0
	unicase-2.6.0
	unicode-bidi-0.3.7
	unicode-normalization-0.1.19
	unicode-segmentation-1.8.0
	unicode-width-0.1.9
	unicode-xid-0.2.2
	untrusted-0.7.1
	url-2.2.2
	uuid-0.8.2
	vec_map-0.8.2
	version_check-0.9.3
	walkdir-2.3.2
	want-0.3.0
	wasi-0.10.2+wasi-snapshot-preview1
	wasm-bindgen-0.2.78
	wasm-bindgen-backend-0.2.78
	wasm-bindgen-futures-0.4.28
	wasm-bindgen-macro-0.2.78
	wasm-bindgen-macro-support-0.2.78
	wasm-bindgen-shared-0.2.78
	web-sys-0.3.55
	webpki-0.21.4
	webpki-0.22.0
	winapi-0.3.9
	winapi-i686-pc-windows-gnu-0.4.0
	winapi-util-0.1.5
	winapi-x86_64-pc-windows-gnu-0.4.0
	winreg-0.7.0
	yup-oauth2-6.1.0
"

inherit cargo

MY_BUILD="$(ver_cut 5)"
MY_PV="${PV//_/-}"

DESCRIPTION="Copy tabular data between databases, CSV files and cloud storage"
HOMEPAGE="https://www.dbcrossbar.org"
SRC_URI="https://github.com/dbcrossbar/dbcrossbar/archive/v${MY_PV%?}.${MY_BUILD}.tar.gz
	$(cargo_crate_uris ${CRATES})"

LICENSE="Apache-2.0 BSD ISC MIT ZLIB"
KEYWORDS="~amd64 ~x86"
SLOT="0"

S="${WORKDIR}/${PN}-${MY_PV%?}.${MY_BUILD}"

DOCS=( {CHANGELOG,DESIGN,README}.md )

QA_FLAGS_IGNORED="usr/bin/dbcrossbar"

src_install() {
	einstalldocs
	cargo_src_install --path dbcrossbar
}