# Copyright 2025-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

# Autogenerated by pycargoebuild 0.15.1

EAPI=8

CRATES="
	aho-corasick@1.1.4
	android_system_properties@0.1.5
	anstream@1.0.0
	anstyle-parse@1.0.0
	anstyle-query@1.1.5
	anstyle-wincon@3.0.11
	anstyle@1.0.14
	autocfg@1.5.1
	bit_field@0.10.3
	bitflags@1.3.2
	bitflags@2.13.0
	block-buffer@0.10.4
	built@0.8.1
	bumpalo@3.20.3
	cc@1.2.65
	cfg-if@1.0.4
	cfg_aliases@0.2.1
	chrono@0.4.45
	clap-num@1.2.0
	clap-verbosity-flag@3.0.4
	clap@4.6.1
	clap_builder@4.6.0
	clap_complete@4.6.6
	clap_derive@4.6.1
	clap_lex@1.1.0
	colorchoice@1.0.5
	core-foundation-sys@0.8.7
	cpufeatures@0.2.17
	crypto-common@0.1.7
	darling@0.20.11
	darling_core@0.20.11
	darling_macro@0.20.11
	defmt-macros@1.1.0
	defmt-parser@1.0.0
	defmt@1.1.0
	digest@0.10.7
	dmidecode@1.0.1
	embed-resource@3.0.9
	env_filter@2.0.0
	env_logger@0.11.11
	equivalent@1.0.2
	find-msvc-tools@0.1.9
	fnv@1.0.7
	futures-channel@0.3.32
	futures-core@0.3.32
	futures-executor@0.3.32
	futures-io@0.3.32
	futures-macro@0.3.32
	futures-sink@0.3.32
	futures-task@0.3.32
	futures-util@0.3.32
	futures@0.3.32
	generic-array@0.14.7
	getrandom@0.3.4
	git2@0.21.0
	guid-create@0.5.2
	hashbrown@0.17.1
	heck@0.5.0
	hidapi@2.6.6
	iana-time-zone-haiku@0.1.2
	iana-time-zone@0.1.65
	ident_case@1.0.1
	indexmap@2.14.0
	is_terminal_polyfill@1.70.2
	jiff-static@0.2.31
	jiff@0.2.31
	jobserver@0.1.34
	js-sys@0.3.103
	lazy_static@1.5.0
	libc@0.2.186
	libgit2-sys@0.18.5+1.9.4
	libloading@0.8.9
	libusb1-sys@0.7.0
	libz-sys@1.1.29
	lock_api@0.4.14
	log@0.4.33
	memchr@2.8.2
	nix@0.30.1
	no-std-compat@0.4.1
	num-complex@0.4.6
	num-derive@0.4.2
	num-integer@0.1.46
	num-iter@0.1.45
	num-rational@0.4.2
	num-traits@0.2.19
	num@0.4.3
	nvml-wrapper-sys@0.9.1
	nvml-wrapper@0.11.0
	once_cell@1.21.4
	once_cell_polyfill@1.70.2
	pin-project-lite@0.2.17
	pkg-config@0.3.33
	plain@0.2.3
	portable-atomic-util@0.2.7
	portable-atomic@1.13.1
	ppv-lite86@0.2.21
	proc-macro-error-attr2@2.0.0
	proc-macro-error2@2.0.1
	proc-macro2@1.0.106
	ptr_meta@0.3.1
	ptr_meta_derive@0.3.1
	quote@1.0.46
	r-efi@5.3.0
	rand@0.9.4
	rand_chacha@0.9.0
	rand_core@0.9.5
	regex-automata@0.4.14
	regex-syntax@0.8.11
	regex@1.12.4
	rusb@0.9.4
	rustc_version@0.4.1
	rustversion@1.0.22
	scopeguard@1.2.0
	semver@1.0.28
	serde@1.0.228
	serde_core@1.0.228
	serde_derive@1.0.228
	serde_spanned@1.1.1
	sha1@0.10.6
	sha2@0.10.9
	shlex@2.0.1
	slab@0.4.12
	spin@0.10.0
	spin@0.9.8
	static_assertions@1.1.0
	static_vcruntime@3.0.0
	strsim@0.11.1
	syn@2.0.118
	thiserror-impl@1.0.69
	thiserror-impl@2.0.18
	thiserror@1.0.69
	thiserror@2.0.18
	toml@1.1.2+spec-1.1.0
	toml_datetime@1.1.1+spec-1.1.0
	toml_parser@1.1.2+spec-1.1.0
	toml_writer@1.1.1+spec-1.1.0
	typenum@1.20.1
	ucs2@0.3.3
	uefi-macros@0.19.0
	uefi-raw@0.13.0
	uefi@0.36.1
	uguid@2.2.1
	unicode-ident@1.0.24
	utf8parse@0.2.2
	uuid@1.23.4
	vcpkg@0.2.15
	version_check@0.9.5
	vswhom-sys@0.1.3
	vswhom@0.1.0
	wasip2@1.0.4+wasi-0.2.12
	wasm-bindgen-macro-support@0.2.126
	wasm-bindgen-macro@0.2.126
	wasm-bindgen-shared@0.2.126
	wasm-bindgen@0.2.126
	winapi-i686-pc-windows-gnu@0.4.0
	winapi-x86_64-pc-windows-gnu@0.4.0
	winapi@0.3.9
	windows-collections@0.3.2
	windows-core@0.62.2
	windows-future@0.3.2
	windows-implement@0.60.2
	windows-interface@0.59.3
	windows-link@0.2.1
	windows-numerics@0.3.1
	windows-result@0.4.1
	windows-strings@0.5.1
	windows-sys@0.59.0
	windows-sys@0.61.2
	windows-targets@0.52.6
	windows-threading@0.2.1
	windows-version@0.1.7
	windows@0.62.2
	windows_aarch64_gnullvm@0.52.6
	windows_aarch64_msvc@0.52.6
	windows_i686_gnu@0.52.6
	windows_i686_gnullvm@0.52.6
	windows_i686_msvc@0.52.6
	windows_x86_64_gnu@0.52.6
	windows_x86_64_gnullvm@0.52.6
	windows_x86_64_msvc@0.52.6
	winnow@1.0.3
	winreg@0.55.0
	winresource@0.1.31
	wit-bindgen@0.57.1
	wmi@0.17.3
	wrapcenum-derive@0.4.1
	zerocopy-derive@0.8.52
	zerocopy@0.8.52
"

RUST_MIN_VER="1.87.0"

inherit shell-completion cargo

DESCRIPTION="Tool to control Framework Computer systems"
HOMEPAGE="https://github.com/FrameworkComputer/framework-system"
SRC_URI="
	https://github.com/FrameworkComputer/framework-system/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz
	${CARGO_CRATE_URIS}
"
S="${WORKDIR}/framework-system-${PV}/${PN}"

LICENSE="BSD"
# Dependent crate licenses
LICENSE+=" ISC MIT MPL-2.0 Unicode-3.0"
SLOT="0"
KEYWORDS="~amd64"

QA_FLAGS_IGNORED="usr/bin/.*"

DOCS=(
	README.md
	support-matrices.md
)

src_unpack() {
	cargo_src_unpack

	# if more packages require this sort of hack, probably want to change the eclass
	sed -e "s|'https://github.com/FrameworkComputer/uefi-rs'|crates-io|" \
		-i ${CARGO_HOME}/config.toml || die
}

src_install() {
	cargo_src_install

	pushd "${S%${PN}}" > /dev/null || die
	dodoc "${DOCS[@]}"

	dobashcomp framework_tool/completions/bash/${PN}
	dozshcomp framework_tool/completions/zsh/_${PN}
	popd > /dev/null || die
}
