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

# Auto-Generated by cargo-ebuild 0.5.1 with manual fixes and extras

EAPI=8

CRATES="
	adler-1.0.2
	aes-0.7.5
	aho-corasick-0.7.18
	anyhow-1.0.57
	ascii-1.0.0
	atomic-polyfill-0.1.8
	atty-0.2.14
	autocfg-0.1.8
	autocfg-1.1.0
	bare-metal-0.2.5
	bare-metal-1.0.0
	base16ct-0.1.1
	base64-0.13.0
	base64ct-1.1.1
	bit_field-0.10.1
	bitfield-0.13.2
	bitflags-1.3.2
	block-buffer-0.9.0
	block-buffer-0.10.2
	bumpalo-3.9.1
	byteorder-1.4.3
	cc-1.0.73
	cfg-if-1.0.0
	chrono-0.4.19
	chunked_transfer-1.4.0
	cipher-0.3.0
	clap-3.1.18
	clap_complete-3.1.4
	clap_derive-3.1.18
	clap_lex-0.2.0
	console-0.15.0
	const-oid-0.6.2
	const-oid-0.7.1
	cortex-m-0.7.4
	cpufeatures-0.2.2
	crc32fast-1.3.2
	critical-section-0.2.7
	crypto-bigint-0.2.11
	crypto-bigint-0.3.2
	crypto-common-0.1.3
	crypto-mac-0.11.1
	ctr-0.8.0
	ctrlc-3.2.2
	data-encoding-2.3.2
	delog-0.1.4
	der-0.4.5
	der-0.5.1
	der-oid-macro-0.5.0
	der-parser-6.0.1
	dialoguer-0.9.0
	digest-0.9.0
	digest-0.10.3
	ecdsa-0.13.4
	elliptic-curve-0.11.12
	embedded-hal-0.2.7
	encode_unicode-0.3.6
	enum-iterator-0.7.0
	enum-iterator-derive-0.7.0
	env_logger-0.7.1
	fastrand-1.7.0
	ff-0.11.1
	flate2-1.0.23
	flexiber-0.1.0
	fnv-1.0.7
	form_urlencoded-1.0.1
	generic-array-0.14.5
	getrandom-0.2.6
	group-0.11.0
	hash32-0.2.1
	hashbrown-0.11.2
	heapless-0.7.13
	heck-0.4.0
	hermit-abi-0.1.19
	hex-0.4.3
	hex-literal-0.3.4
	hidapi-1.4.1
	hmac-0.11.0
	hmac-0.12.1
	humantime-1.3.0
	idna-0.2.3
	indexmap-1.8.1
	indicatif-0.16.2
	instant-0.1.12
	iso7816-0.1.0
	itoa-1.0.2
	js-sys-0.3.57
	lazy_static-1.4.0
	libc-0.2.126
	libloading-0.5.2
	libm-0.2.2
	linked-hash-map-0.5.4
	lock_api-0.4.7
	log-0.4.17
	lpc55-0.1.1
	matches-0.1.9
	memchr-2.5.0
	minimal-lexical-0.2.1
	miniz_oxide-0.5.1
	nb-0.1.3
	nb-1.0.0
	nix-0.24.1
	nom-7.1.1
	num-bigint-0.2.6
	num-bigint-0.4.3
	num-bigint-dig-0.7.0
	num-integer-0.1.45
	num-iter-0.1.43
	num-traits-0.2.15
	number_prefix-0.4.0
	oid-registry-0.2.0
	once_cell-1.12.0
	opaque-debug-0.3.0
	os_str_bytes-6.0.1
	p256-0.10.1
	pcsc-2.7.0
	pcsc-sys-1.2.0
	pem-1.0.2
	pem-parser-0.1.1
	pem-rfc7468-0.2.4
	percent-encoding-2.1.0
	pkcs1-0.2.4
	pkcs11-0.5.0
	pkcs11-uri-0.1.3
	pkcs8-0.7.6
	pkcs8-0.8.0
	pkg-config-0.3.25
	ppv-lite86-0.2.16
	pretty_env_logger-0.4.0
	proc-macro-error-1.0.4
	proc-macro-error-attr-1.0.4
	proc-macro2-1.0.39
	quick-error-1.2.3
	quote-1.0.18
	rand-0.8.5
	rand_chacha-0.3.1
	rand_core-0.6.3
	rcgen-0.8.14
	redox_syscall-0.2.13
	regex-1.5.6
	regex-syntax-0.6.26
	remove_dir_all-0.5.3
	rfc6979-0.1.0
	ring-0.16.20
	riscv-0.7.0
	riscv-target-0.1.2
	rsa-0.5.0
	rustc-serialize-0.3.24
	rustc_version-0.2.3
	rustc_version-0.4.0
	rusticata-macros-4.1.0
	rustls-0.20.6
	ryu-1.0.10
	scopeguard-1.1.0
	sct-0.7.0
	sec1-0.2.1
	semver-0.9.0
	semver-1.0.9
	semver-parser-0.7.0
	serde-1.0.137
	serde-big-array-0.3.3
	serde_derive-1.0.137
	serde_json-1.0.81
	serde_yaml-0.8.24
	sha-1-0.10.0
	sha2-0.9.9
	sha2-0.10.2
	signature-1.4.0
	smallvec-1.8.0
	spin-0.5.2
	spin-0.9.3
	spki-0.4.1
	spki-0.5.4
	stable_deref_trait-1.2.0
	strsim-0.10.0
	subtle-2.4.1
	syn-1.0.95
	synstructure-0.12.6
	tempfile-3.3.0
	termcolor-1.1.3
	terminal_size-0.1.17
	textwrap-0.15.0
	thiserror-1.0.31
	thiserror-impl-1.0.31
	time-0.1.44
	tiny_http-0.9.0
	tinyvec-1.6.0
	tinyvec_macros-0.1.0
	toml-0.5.9
	typenum-1.15.0
	unicode-bidi-0.3.8
	unicode-ident-1.0.0
	unicode-normalization-0.1.19
	unicode-width-0.1.9
	unicode-xid-0.2.3
	untrusted-0.7.1
	ureq-2.4.0
	uriparse-0.6.4
	url-2.2.2
	uuid-0.8.2
	vcell-0.1.3
	version_check-0.9.4
	void-1.0.2
	volatile-register-0.2.1
	wasi-0.10.0+wasi-snapshot-preview1
	wasm-bindgen-0.2.80
	wasm-bindgen-backend-0.2.80
	wasm-bindgen-macro-0.2.80
	wasm-bindgen-macro-support-0.2.80
	wasm-bindgen-shared-0.2.80
	web-sys-0.3.57
	webbrowser-0.5.5
	webpki-0.22.0
	webpki-roots-0.22.3
	widestring-0.4.3
	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
	x509-parser-0.12.0
	yaml-rust-0.4.5
	yasna-0.4.0
	zeroize-1.4.3
	zeroize_derive-1.3.2
"

inherit cargo udev

DESCRIPTION="Library and CLI for the SoloKeys Solo 2 security key"
# Double check the homepage as the cargo_metadata crate
# does not provide this value so instead repository is used
HOMEPAGE="https://github.com/solokeys/solo2-cli"
SRC_URI="$(cargo_crate_uris) https://github.com/solokeys/solo2-cli/archive/refs/tags/v${PV}.tar.gz"

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

src_install() {
	cargo_src_install
	udev_dorules 70-solo2.rules
}

pkg_postinst() {
	udev_reload
}